Commit a5d1c006 authored by Thomas Randolph's avatar Thomas Randolph

Add feature flag for commit neighbor nav feature

parent 3c071011
......@@ -346,7 +346,7 @@ export default {
}
});
if (this.commit) {
if (this.commit && this.glFeatures.mrCommitNeighborNav) {
Mousetrap.bind('c', () => this.moveToNeighboringCommit({ direction: 'next' }));
Mousetrap.bind('x', () => this.moveToNeighboringCommit({ direction: 'previous' }));
}
......
......@@ -2,6 +2,8 @@
import { mapActions } from 'vuex';
import { GlButtonGroup, GlButton, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import Icon from '~/vue_shared/components/icon.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
......@@ -48,6 +50,7 @@ export default {
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [glFeatureFlagsMixin()],
props: {
commit: {
type: Object,
......@@ -160,7 +163,10 @@ export default {
class="btn btn-default"
/>
</div>
<div v-if="hasNeighborCommits" class="commit-nav-buttons ml-3">
<div
v-if="hasNeighborCommits && glFeatures.mrCommitNeighborNav"
class="commit-nav-buttons ml-3"
>
<gl-button-group>
<gl-button
:href="previousCommitUrl"
......
......@@ -27,6 +27,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:widget_visibility_polling, @project, default_enabled: true)
push_frontend_feature_flag(:merge_ref_head_comments, @project)
push_frontend_feature_flag(:accessibility_merge_request_widget, @project)
push_frontend_feature_flag(:mr_commit_neighbor_nav, @project, default_enabled: true)
end
before_action do
......
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