Commit e9e0e66c authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '341675-remove-feature-flag' into 'master'

Remove new_dir_modal feature flag

See merge request gitlab-org/gitlab!83518
parents 9b2ce0d9 692c1767
...@@ -9,7 +9,6 @@ import { ...@@ -9,7 +9,6 @@ import {
} from '@gitlab/ui'; } from '@gitlab/ui';
import permissionsQuery from 'shared_queries/repository/permissions.query.graphql'; import permissionsQuery from 'shared_queries/repository/permissions.query.graphql';
import { joinPaths, escapeFileUrl } from '~/lib/utils/url_utility'; import { joinPaths, escapeFileUrl } from '~/lib/utils/url_utility';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { __ } from '../../locale'; import { __ } from '../../locale';
import getRefMixin from '../mixins/get_ref'; import getRefMixin from '../mixins/get_ref';
import projectPathQuery from '../queries/project_path.query.graphql'; import projectPathQuery from '../queries/project_path.query.graphql';
...@@ -58,7 +57,7 @@ export default { ...@@ -58,7 +57,7 @@ export default {
directives: { directives: {
GlModal: GlModalDirective, GlModal: GlModalDirective,
}, },
mixins: [getRefMixin, glFeatureFlagsMixin()], mixins: [getRefMixin],
props: { props: {
currentPath: { currentPath: {
type: String, type: String,
...@@ -176,11 +175,7 @@ export default { ...@@ -176,11 +175,7 @@ export default {
return this.canEditTree && !this.$apollo.queries.userPermissions.loading; return this.canEditTree && !this.$apollo.queries.userPermissions.loading;
}, },
showNewDirectoryModal() { showNewDirectoryModal() {
return ( return this.canEditTree && !this.$apollo.queries.userPermissions.loading;
this.glFeatures.newDirModal &&
this.canEditTree &&
!this.$apollo.queries.userPermissions.loading
);
}, },
dropdownItems() { dropdownItems() {
const items = []; const items = [];
...@@ -209,24 +204,13 @@ export default { ...@@ -209,24 +204,13 @@ export default {
}, },
); );
if (this.glFeatures.newDirModal) { items.push({
items.push({ attrs: {
attrs: { href: '#modal-create-new-dir',
href: '#modal-create-new-dir', },
}, text: __('New directory'),
text: __('New directory'), modalId: NEW_DIRECTORY_MODAL_ID,
modalId: NEW_DIRECTORY_MODAL_ID, });
});
} else {
items.push({
attrs: {
href: '#modal-create-new-dir',
'data-target': '#modal-create-new-dir',
'data-toggle': 'modal',
},
text: __('New directory'),
});
}
} else if (this.canCreateMrFromFork) { } else if (this.canCreateMrFromFork) {
items.push( items.push(
{ {
......
...@@ -18,7 +18,6 @@ class Projects::TreeController < Projects::ApplicationController ...@@ -18,7 +18,6 @@ class Projects::TreeController < Projects::ApplicationController
before_action do before_action do
push_frontend_feature_flag(:lazy_load_commits, @project, default_enabled: :yaml) push_frontend_feature_flag(:lazy_load_commits, @project, default_enabled: :yaml)
push_frontend_feature_flag(:new_dir_modal, @project, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml) push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml)
push_frontend_feature_flag(:highlight_js, @project, default_enabled: :yaml) push_frontend_feature_flag(:highlight_js, @project, default_enabled: :yaml)
push_licensed_feature(:file_locks) if @project.licensed_feature_available?(:file_locks) push_licensed_feature(:file_locks) if @project.licensed_feature_available?(:file_locks)
......
...@@ -39,7 +39,6 @@ class ProjectsController < Projects::ApplicationController ...@@ -39,7 +39,6 @@ class ProjectsController < Projects::ApplicationController
push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml) push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml)
push_frontend_feature_flag(:highlight_js, @project, default_enabled: :yaml) push_frontend_feature_flag(:highlight_js, @project, default_enabled: :yaml)
push_frontend_feature_flag(:increase_page_size_exponentially, @project, default_enabled: :yaml) push_frontend_feature_flag(:increase_page_size_exponentially, @project, default_enabled: :yaml)
push_frontend_feature_flag(:new_dir_modal, @project, default_enabled: :yaml)
push_licensed_feature(:file_locks) if @project.present? && @project.licensed_feature_available?(:file_locks) push_licensed_feature(:file_locks) if @project.present? && @project.licensed_feature_available?(:file_locks)
push_force_frontend_feature_flag(:work_items, @project&.work_items_feature_flag_enabled?) push_force_frontend_feature_flag(:work_items, @project&.work_items_feature_flag_enabled?)
end end
......
...@@ -20,6 +20,6 @@ ...@@ -20,6 +20,6 @@
= render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout), project_buttons: true = render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout), project_buttons: true
#js-tree-list{ data: vue_file_list_data(project, ref) } #js-tree-list{ data: vue_file_list_data(project, ref) }
- if !Feature.enabled?(:new_dir_modal, default_enabled: :yaml) && can_edit_tree? - if can_edit_tree?
= render 'projects/blob/new_dir' = render 'projects/blob/new_dir'
---
name: new_dir_modal
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71154
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341675
milestone: '14.4'
type: development
group: group::source code
default_enabled: true
...@@ -12,7 +12,7 @@ const defaultMockRoute = { ...@@ -12,7 +12,7 @@ const defaultMockRoute = {
describe('Repository breadcrumbs component', () => { describe('Repository breadcrumbs component', () => {
let wrapper; let wrapper;
const factory = (currentPath, extraProps = {}, mockRoute = {}, newDirModal = true) => { const factory = (currentPath, extraProps = {}, mockRoute = {}) => {
const $apollo = { const $apollo = {
queries: { queries: {
userPermissions: { userPermissions: {
...@@ -36,7 +36,6 @@ describe('Repository breadcrumbs component', () => { ...@@ -36,7 +36,6 @@ describe('Repository breadcrumbs component', () => {
}, },
$apollo, $apollo,
}, },
provide: { glFeatures: { newDirModal } },
}); });
}; };
...@@ -147,37 +146,21 @@ describe('Repository breadcrumbs component', () => { ...@@ -147,37 +146,21 @@ describe('Repository breadcrumbs component', () => {
}); });
describe('renders the new directory modal', () => { describe('renders the new directory modal', () => {
describe('with the feature flag enabled', () => { beforeEach(() => {
beforeEach(() => { factory('/', { canEditTree: true });
window.gon.features = { });
newDirModal: true, it('does not render the modal while loading', () => {
}; expect(findNewDirectoryModal().exists()).toBe(false);
factory('/', { canEditTree: true });
});
it('does not render the modal while loading', () => {
expect(findNewDirectoryModal().exists()).toBe(false);
});
it('renders the modal once loaded', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ $apollo: { queries: { userPermissions: { loading: false } } } });
await nextTick();
expect(findNewDirectoryModal().exists()).toBe(true);
});
}); });
describe('with the feature flag disabled', () => { it('renders the modal once loaded', async () => {
it('does not render the modal', () => { // setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
window.gon.features = { // eslint-disable-next-line no-restricted-syntax
newDirModal: false, wrapper.setData({ $apollo: { queries: { userPermissions: { loading: false } } } });
};
factory('/', { canEditTree: true }, {}, {}, false); await nextTick();
expect(findNewDirectoryModal().exists()).toBe(false);
}); expect(findNewDirectoryModal().exists()).toBe(true);
}); });
}); });
}); });
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