Commit 4667b569 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'ee-fl-boards-tech-debt' into 'master'

EE port of Uses tooltip vue directive in issue card component

See merge request gitlab-org/gitlab-ee!6309
parents ebc5615a eb87ddb5
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import IssueCardWeight from 'ee/boards/components/issue_card_weight.vue'; import IssueCardWeight from 'ee/boards/components/issue_card_weight.vue';
import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
import tooltip from '../../vue_shared/directives/tooltip';
const Store = gl.issueBoards.BoardsStore; const Store = gl.issueBoards.BoardsStore;
...@@ -11,6 +12,9 @@ ...@@ -11,6 +12,9 @@
UserAvatarLink, UserAvatarLink,
IssueCardWeight, IssueCardWeight,
}, },
directives: {
tooltip,
},
props: { props: {
issue: { issue: {
type: Object, type: Object,
...@@ -172,9 +176,10 @@ ...@@ -172,9 +176,10 @@
tooltip-placement="bottom" tooltip-placement="bottom"
/> />
<span <span
v-tooltip
v-if="shouldRenderCounter" v-if="shouldRenderCounter"
:title="assigneeCounterTooltip" :title="assigneeCounterTooltip"
class="avatar-counter has-tooltip" class="avatar-counter"
> >
{{ assigneeCounterLabel }} {{ assigneeCounterLabel }}
</span> </span>
...@@ -185,12 +190,13 @@ ...@@ -185,12 +190,13 @@
class="board-card-footer" class="board-card-footer"
> >
<button <button
v-tooltip
v-for="label in issue.labels" v-for="label in issue.labels"
v-if="showLabel(label)" v-if="showLabel(label)"
:key="label.id" :key="label.id"
:style="labelStyle(label)" :style="labelStyle(label)"
:title="label.description" :title="label.description"
class="badge color-label has-tooltip" class="badge color-label"
type="button" type="button"
data-container="body" data-container="body"
@click="filterByLabel(label, $event)" @click="filterByLabel(label, $event)"
......
...@@ -258,7 +258,7 @@ describe('Issue card component', () => { ...@@ -258,7 +258,7 @@ describe('Issue card component', () => {
it('renders label', () => { it('renders label', () => {
const nodes = []; const nodes = [];
component.$el.querySelectorAll('.badge').forEach((label) => { component.$el.querySelectorAll('.badge').forEach((label) => {
nodes.push(label.title); nodes.push(label.getAttribute('data-original-title'));
}); });
expect( expect(
...@@ -268,7 +268,7 @@ describe('Issue card component', () => { ...@@ -268,7 +268,7 @@ describe('Issue card component', () => {
it('sets label description as title', () => { it('sets label description as title', () => {
expect( expect(
component.$el.querySelector('.badge').getAttribute('title'), component.$el.querySelector('.badge').getAttribute('data-original-title'),
).toContain(label1.description); ).toContain(label1.description);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment