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 {
} from '@gitlab/ui';
import permissionsQuery from 'shared_queries/repository/permissions.query.graphql';
import { joinPaths, escapeFileUrl } from '~/lib/utils/url_utility';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { __ } from '../../locale';
import getRefMixin from '../mixins/get_ref';
import projectPathQuery from '../queries/project_path.query.graphql';
......@@ -58,7 +57,7 @@ export default {
directives: {
GlModal: GlModalDirective,
},
mixins: [getRefMixin, glFeatureFlagsMixin()],
mixins: [getRefMixin],
props: {
currentPath: {
type: String,
......@@ -176,11 +175,7 @@ export default {
return this.canEditTree && !this.$apollo.queries.userPermissions.loading;
},
showNewDirectoryModal() {
return (
this.glFeatures.newDirModal &&
this.canEditTree &&
!this.$apollo.queries.userPermissions.loading
);
return this.canEditTree && !this.$apollo.queries.userPermissions.loading;
},
dropdownItems() {
const items = [];
......@@ -209,24 +204,13 @@ export default {
},
);
if (this.glFeatures.newDirModal) {
items.push({
attrs: {
href: '#modal-create-new-dir',
},
text: __('New directory'),
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'),
});
}
items.push({
attrs: {
href: '#modal-create-new-dir',
},
text: __('New directory'),
modalId: NEW_DIRECTORY_MODAL_ID,
});
} else if (this.canCreateMrFromFork) {
items.push(
{
......
......@@ -18,7 +18,6 @@ class Projects::TreeController < Projects::ApplicationController
before_action do
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(:highlight_js, @project, default_enabled: :yaml)
push_licensed_feature(:file_locks) if @project.licensed_feature_available?(:file_locks)
......
......@@ -39,7 +39,6 @@ class ProjectsController < Projects::ApplicationController
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(: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_force_frontend_feature_flag(:work_items, @project&.work_items_feature_flag_enabled?)
end
......
......@@ -20,6 +20,6 @@
= 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) }
- if !Feature.enabled?(:new_dir_modal, default_enabled: :yaml) && can_edit_tree?
- if can_edit_tree?
= 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 = {
describe('Repository breadcrumbs component', () => {
let wrapper;
const factory = (currentPath, extraProps = {}, mockRoute = {}, newDirModal = true) => {
const factory = (currentPath, extraProps = {}, mockRoute = {}) => {
const $apollo = {
queries: {
userPermissions: {
......@@ -36,7 +36,6 @@ describe('Repository breadcrumbs component', () => {
},
$apollo,
},
provide: { glFeatures: { newDirModal } },
});
};
......@@ -147,37 +146,21 @@ describe('Repository breadcrumbs component', () => {
});
describe('renders the new directory modal', () => {
describe('with the feature flag enabled', () => {
beforeEach(() => {
window.gon.features = {
newDirModal: true,
};
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);
});
beforeEach(() => {
factory('/', { canEditTree: true });
});
it('does not render the modal while loading', () => {
expect(findNewDirectoryModal().exists()).toBe(false);
});
describe('with the feature flag disabled', () => {
it('does not render the modal', () => {
window.gon.features = {
newDirModal: false,
};
factory('/', { canEditTree: true }, {}, {}, false);
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);
});
});
});
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