Commit 3ee41a90 authored by Phil Hughes's avatar Phil Hughes

Merge branch '335936-design-discussion-user-popovers-do-not-work' into 'master'

Fix user popovers in design management discussions

See merge request gitlab-org/gitlab!66027
parents 14f4b2e5 61b5dce3
<script> <script>
import { GlTooltipDirective, GlIcon, GlLink, GlSafeHtmlDirective } from '@gitlab/ui'; import { GlTooltipDirective, GlIcon, GlLink, GlSafeHtmlDirective } from '@gitlab/ui';
import { ApolloMutation } from 'vue-apollo'; import { ApolloMutation } from 'vue-apollo';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { __ } from '~/locale'; import { __ } from '~/locale';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
...@@ -48,6 +49,9 @@ export default { ...@@ -48,6 +49,9 @@ export default {
author() { author() {
return this.note.author; return this.note.author;
}, },
authorId() {
return getIdFromGraphQLId(this.author.id);
},
noteAnchorId() { noteAnchorId() {
return findNoteId(this.note.id); return findNoteId(this.note.id);
}, },
...@@ -94,7 +98,7 @@ export default { ...@@ -94,7 +98,7 @@ export default {
v-once v-once
:href="author.webUrl" :href="author.webUrl"
class="js-user-link" class="js-user-link"
:data-user-id="author.id" :data-user-id="authorId"
:data-username="author.username" :data-username="author.username"
> >
<span class="note-header-author-name gl-font-weight-bold">{{ author.name }}</span> <span class="note-header-author-name gl-font-weight-bold">{{ author.name }}</span>
......
...@@ -6,7 +6,7 @@ exports[`Design note component should match the snapshot 1`] = ` ...@@ -6,7 +6,7 @@ exports[`Design note component should match the snapshot 1`] = `
id="note_123" id="note_123"
> >
<user-avatar-link-stub <user-avatar-link-stub
imgalt="" imgalt="foo-bar"
imgcssclasses="" imgcssclasses=""
imgsize="40" imgsize="40"
imgsrc="" imgsrc=""
...@@ -22,7 +22,8 @@ exports[`Design note component should match the snapshot 1`] = ` ...@@ -22,7 +22,8 @@ exports[`Design note component should match the snapshot 1`] = `
<div> <div>
<gl-link-stub <gl-link-stub
class="js-user-link" class="js-user-link"
data-user-id="author-id" data-user-id="1"
data-username="foo-bar"
> >
<span <span
class="note-header-author-name gl-font-weight-bold" class="note-header-author-name gl-font-weight-bold"
...@@ -35,7 +36,7 @@ exports[`Design note component should match the snapshot 1`] = ` ...@@ -35,7 +36,7 @@ exports[`Design note component should match the snapshot 1`] = `
<span <span
class="note-headline-light" class="note-headline-light"
> >
@ @foo-bar
</span> </span>
</gl-link-stub> </gl-link-stub>
......
...@@ -9,7 +9,8 @@ const scrollIntoViewMock = jest.fn(); ...@@ -9,7 +9,8 @@ const scrollIntoViewMock = jest.fn();
const note = { const note = {
id: 'gid://gitlab/DiffNote/123', id: 'gid://gitlab/DiffNote/123',
author: { author: {
id: 'author-id', id: 'gid://gitlab/User/1',
username: 'foo-bar',
}, },
body: 'test', body: 'test',
userPermissions: { userPermissions: {
......
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