Commit 5086bcd9 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '224649-fix-resolved-threads-popup-link-and-placement' into 'master'

Resolve "Fix 'Resolved threads' popup link and placement"

See merge request gitlab-org/gitlab!40489
parents 51c9fdbf a615a75c
...@@ -60,6 +60,18 @@ export default { ...@@ -60,6 +60,18 @@ export default {
return this.resolvedDiscussionsExpanded ? 'chevron-down' : 'chevron-right'; return this.resolvedDiscussionsExpanded ? 'chevron-down' : 'chevron-right';
}, },
}, },
watch: {
isResolvedCommentsPopoverHidden(newVal) {
if (!newVal) {
this.$refs.resolvedComments.scrollIntoView();
}
},
},
mounted() {
if (!this.isResolvedCommentsPopoverHidden && this.$refs.resolvedComments) {
this.$refs.resolvedComments.$el.scrollIntoView();
}
},
methods: { methods: {
handleSidebarClick() { handleSidebarClick() {
this.isResolvedCommentsPopoverHidden = true; this.isResolvedCommentsPopoverHidden = true;
...@@ -129,6 +141,7 @@ export default { ...@@ -129,6 +141,7 @@ export default {
<template v-if="resolvedDiscussions.length > 0"> <template v-if="resolvedDiscussions.length > 0">
<gl-button <gl-button
id="resolved-comments" id="resolved-comments"
ref="resolvedComments"
data-testid="resolved-comments" data-testid="resolved-comments"
:icon="resolvedCommentsToggleIcon" :icon="resolvedCommentsToggleIcon"
variant="link" variant="link"
...@@ -151,9 +164,12 @@ export default { ...@@ -151,9 +164,12 @@ export default {
) )
}} }}
</p> </p>
<a href="#" rel="noopener noreferrer" target="_blank">{{ <a
s__('DesignManagement|Learn more about resolving comments') href="https://docs.gitlab.com/ee/user/project/issues/design_management.html#resolve-design-threads"
}}</a> rel="noopener noreferrer"
target="_blank"
>{{ s__('DesignManagement|Learn more about resolving comments') }}</a
>
</gl-popover> </gl-popover>
<gl-collapse :visible="resolvedDiscussionsExpanded" class="gl-mt-3"> <gl-collapse :visible="resolvedDiscussionsExpanded" class="gl-mt-3">
<design-discussion <design-discussion
......
---
title: Resolve Fix Resolved threads popup link and placement
merge_request: 40489
author:
type: fixed
...@@ -7,6 +7,9 @@ import DesignDiscussion from '~/design_management/components/design_notes/design ...@@ -7,6 +7,9 @@ import DesignDiscussion from '~/design_management/components/design_notes/design
import design from '../mock_data/design'; import design from '../mock_data/design';
import updateActiveDiscussionMutation from '~/design_management/graphql/mutations/update_active_discussion.mutation.graphql'; import updateActiveDiscussionMutation from '~/design_management/graphql/mutations/update_active_discussion.mutation.graphql';
const scrollIntoViewMock = jest.fn();
HTMLElement.prototype.scrollIntoView = scrollIntoViewMock;
const updateActiveDiscussionMutationVariables = { const updateActiveDiscussionMutationVariables = {
mutation: updateActiveDiscussionMutation, mutation: updateActiveDiscussionMutation,
variables: { variables: {
...@@ -53,6 +56,7 @@ describe('Design management design sidebar component', () => { ...@@ -53,6 +56,7 @@ describe('Design management design sidebar component', () => {
mutate, mutate,
}, },
}, },
stubs: { GlPopover },
}); });
} }
...@@ -220,6 +224,10 @@ describe('Design management design sidebar component', () => { ...@@ -220,6 +224,10 @@ describe('Design management design sidebar component', () => {
expect(findPopover().exists()).toBe(true); expect(findPopover().exists()).toBe(true);
}); });
it('scrolls to resolved threads link', () => {
expect(scrollIntoViewMock).toHaveBeenCalled();
});
it('dismisses a popover on the outside click', () => { it('dismisses a popover on the outside click', () => {
wrapper.trigger('click'); wrapper.trigger('click');
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
......
...@@ -92,7 +92,7 @@ exports[`Design management design index page renders design index 1`] = ` ...@@ -92,7 +92,7 @@ exports[`Design management design index page renders design index 1`] = `
</p> </p>
<a <a
href="#" href="https://docs.gitlab.com/ee/user/project/issues/design_management.html#resolve-design-threads"
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >
......
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