Commit 39e1ba51 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch '199718-fe-remove-jump-btn-in-mr-thread' into 'master'

Remove Jump to next unresolved thread button in merge request threads

Closes #199718

See merge request gitlab-org/gitlab!37875
parents 90f91f44 c3710f2f
...@@ -3,6 +3,7 @@ import ReplyPlaceholder from './discussion_reply_placeholder.vue'; ...@@ -3,6 +3,7 @@ import ReplyPlaceholder from './discussion_reply_placeholder.vue';
import ResolveDiscussionButton from './discussion_resolve_button.vue'; import ResolveDiscussionButton from './discussion_resolve_button.vue';
import ResolveWithIssueButton from './discussion_resolve_with_issue_button.vue'; import ResolveWithIssueButton from './discussion_resolve_with_issue_button.vue';
import JumpToNextDiscussionButton from './discussion_jump_to_next_button.vue'; import JumpToNextDiscussionButton from './discussion_jump_to_next_button.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default { export default {
name: 'DiscussionActions', name: 'DiscussionActions',
...@@ -12,6 +13,7 @@ export default { ...@@ -12,6 +13,7 @@ export default {
ResolveWithIssueButton, ResolveWithIssueButton,
JumpToNextDiscussionButton, JumpToNextDiscussionButton,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
discussion: { discussion: {
type: Object, type: Object,
...@@ -36,6 +38,9 @@ export default { ...@@ -36,6 +38,9 @@ export default {
}, },
}, },
computed: { computed: {
hideJumpToNextUnresolvedInThreads() {
return this.glFeatures.hideJumpToNextUnresolvedInThreads;
},
resolvableNotes() { resolvableNotes() {
return this.discussion.notes.filter(x => x.resolvable); return this.discussion.notes.filter(x => x.resolvable);
}, },
...@@ -70,7 +75,11 @@ export default { ...@@ -70,7 +75,11 @@ export default {
/> />
</div> </div>
<div <div
v-if="discussion.resolvable && shouldShowJumpToNextDiscussion" v-if="
!hideJumpToNextUnresolvedInThreads &&
discussion.resolvable &&
shouldShowJumpToNextDiscussion
"
class="btn-group discussion-actions ml-sm-2" class="btn-group discussion-actions ml-sm-2"
> >
<jump-to-next-discussion-button :from-discussion-id="discussion.id" /> <jump-to-next-discussion-button :from-discussion-id="discussion.id" />
......
...@@ -21,7 +21,7 @@ const createUnallowedNote = () => ...@@ -21,7 +21,7 @@ const createUnallowedNote = () =>
describe('DiscussionActions', () => { describe('DiscussionActions', () => {
let wrapper; let wrapper;
const createComponentFactory = (shallow = true) => props => { const createComponentFactory = (shallow = true) => (props, options) => {
const store = createStore(); const store = createStore();
const mountFn = shallow ? shallowMount : mount; const mountFn = shallow ? shallowMount : mount;
...@@ -35,6 +35,11 @@ describe('DiscussionActions', () => { ...@@ -35,6 +35,11 @@ describe('DiscussionActions', () => {
shouldShowJumpToNextDiscussion: true, shouldShowJumpToNextDiscussion: true,
...props, ...props,
}, },
provide: {
glFeatures: {
hideJumpToNextUnresolvedInThreads: options?.hideJumpToNextUnresolvedInThreads,
},
},
}); });
}; };
...@@ -96,6 +101,13 @@ describe('DiscussionActions', () => { ...@@ -96,6 +101,13 @@ describe('DiscussionActions', () => {
}); });
}); });
it('does not render jump to next discussion button if feature flag is enabled', () => {
const createComponent = createComponentFactory();
createComponent({}, { hideJumpToNextUnresolvedInThreads: true });
expect(wrapper.find(JumpToNextDiscussionButton).exists()).toBe(false);
});
describe('events handling', () => { describe('events handling', () => {
const createComponent = createComponentFactory(false); const createComponent = createComponentFactory(false);
......
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