Commit b4c7ab67 authored by Kerri Miller's avatar Kerri Miller

Merge branch 'kerrizor/remove-mr_comment_neighbor_nav-feature-flag' into 'master'

Remove mr_comment_neighbor_nav flag

See merge request gitlab-org/gitlab!51522
parents cd36ef64 f35664da
......@@ -425,7 +425,7 @@ export default {
}
});
if (this.commit && this.glFeatures.mrCommitNeighborNav) {
if (this.commit) {
Mousetrap.bind('c', () => this.moveToNeighboringCommit({ direction: 'next' }));
Mousetrap.bind('x', () => this.moveToNeighboringCommit({ direction: 'previous' }));
}
......
......@@ -148,10 +148,7 @@ export default {
class="input-group-text"
/>
</gl-button-group>
<div
v-if="hasNeighborCommits && glFeatures.mrCommitNeighborNav"
class="commit-nav-buttons ml-3"
>
<div v-if="hasNeighborCommits" class="commit-nav-buttons ml-3">
<gl-button-group>
<gl-button
:href="previousCommitUrl"
......
......@@ -28,7 +28,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action :authenticate_user!, only: [:assign_related_issues]
before_action :check_user_can_push_to_source_branch!, only: [:rebase]
before_action only: [:show] do
push_frontend_feature_flag(:mr_commit_neighbor_nav, @project, default_enabled: true)
push_frontend_feature_flag(:multiline_comments, @project, default_enabled: true)
push_frontend_feature_flag(:file_identifier_hash)
push_frontend_feature_flag(:batch_suggestions, @project, default_enabled: true)
......
---
name: mr_commit_neighbor_nav
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28596
rollout_issue_url:
milestone: '13.0'
type: development
group: group::code review
default_enabled: true
......@@ -288,7 +288,7 @@ describe('diffs/components/app', () => {
({ state }) => {
state.diffs.commit = { id: 'SHA123' };
},
{ glFeatures: { mrCommitNeighborNav: true, ...featureFlags } },
{ glFeatures: featureFlags },
);
moveSpy = jest.spyOn(wrapper.vm, 'moveToNeighboringCommit').mockImplementation(() => {});
......@@ -303,8 +303,8 @@ describe('diffs/components/app', () => {
${'k'} | ${'jumpToFile'} | ${0} | ${[-1]} | ${{}}
${']'} | ${'jumpToFile'} | ${0} | ${[+1]} | ${{}}
${'j'} | ${'jumpToFile'} | ${0} | ${[+1]} | ${{}}
${'x'} | ${'moveToNeighboringCommit'} | ${1} | ${[{ direction: 'previous' }]} | ${{ mrCommitNeighborNav: true }}
${'c'} | ${'moveToNeighboringCommit'} | ${1} | ${[{ direction: 'next' }]} | ${{ mrCommitNeighborNav: true }}
${'x'} | ${'moveToNeighboringCommit'} | ${1} | ${[{ direction: 'previous' }]} | ${{}}
${'c'} | ${'moveToNeighboringCommit'} | ${1} | ${[{ direction: 'next' }]} | ${{}}
`(
'calls `$name()` with correct parameters whenever the "$key" key is pressed',
async ({ key, spy, args, featureFlags }) => {
......@@ -319,24 +319,6 @@ describe('diffs/components/app', () => {
},
);
it.each`
key | name | spy | featureFlags
${'x'} | ${'moveToNeighboringCommit'} | ${1} | ${{ mrCommitNeighborNav: false }}
${'c'} | ${'moveToNeighboringCommit'} | ${1} | ${{ mrCommitNeighborNav: false }}
`(
'does not call `$name()` even when the correct key is pressed if the feature flag is disabled',
async ({ key, spy, featureFlags }) => {
setup({ shouldShow: true }, featureFlags);
await nextTick();
expect(spies[spy]).not.toHaveBeenCalled();
Mousetrap.trigger(key);
expect(spies[spy]).not.toHaveBeenCalled();
},
);
it.each`
key | name | spy | allowed
${'d'} | ${'jumpToFile'} | ${0} | ${['[', ']', 'j', 'k']}
......@@ -344,7 +326,7 @@ describe('diffs/components/app', () => {
`(
`does not call \`$name()\` when a key that is not one of \`$allowed\` is pressed`,
async ({ key, spy }) => {
setup({ shouldShow: true }, { mrCommitNeighborNav: true });
setup({ shouldShow: true });
await nextTick();
Mousetrap.trigger(key);
......@@ -356,7 +338,7 @@ describe('diffs/components/app', () => {
describe('hidden app', () => {
beforeEach(async () => {
setup({ shouldShow: false }, { mrCommitNeighborNav: true });
setup({ shouldShow: false });
await nextTick();
Mousetrap.reset();
......
......@@ -44,10 +44,7 @@ describe('diffs/components/commit_item', () => {
...propsData,
},
provide: {
glFeatures: {
mrCommitNeighborNav: true,
...featureFlags,
},
glFeatures: featureFlags,
},
stubs: {
CommitPipelineStatus: true,
......@@ -224,12 +221,6 @@ describe('diffs/components/commit_item', () => {
expect(getCommitNavButtonsElement().exists()).toEqual(true);
});
it('does not render the commit navigation buttons if the `mrCommitNeighborNav` feature flag is disabled', () => {
mountComponent({ commit: mrCommit }, { mrCommitNeighborNav: false });
expect(getCommitNavButtonsElement().exists()).toEqual(false);
});
describe('prev commit', () => {
const { location } = window;
......
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