Commit 5327b6ff authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch 'add_import_from_another_project_link' into 'master'

Replace import project link behind feature flag

See merge request gitlab-org/gitlab!60207
parents 005cb5be 0ead313d
......@@ -18,7 +18,11 @@
= html_escape(_("Members can be added by project %{i_open}Maintainers%{i_close} or %{i_open}Owners%{i_close}")) % { i_open: '<i>'.html_safe, i_close: '</i>'.html_safe }
.col-md-12.col-lg-6
.gl-display-flex.gl-flex-wrap.gl-justify-content-end
.js-invite-group-trigger{ data: { classes: 'gl-mt-3 gl-sm-w-auto gl-w-full', display_text: _('Invite a group') } }
= link_to _("Import a project"),
import_project_project_members_path(@project),
class: "btn btn-default btn-md gl-button gl-mt-3 gl-sm-w-auto gl-w-full",
title: _("Import members from another project")
.js-invite-group-trigger{ data: { classes: 'gl-mt-3 gl-sm-w-auto gl-w-full gl-sm-ml-3', display_text: _('Invite a group') } }
.js-invite-members-trigger{ data: { variant: 'success', classes: 'gl-mt-3 gl-sm-w-auto gl-w-full gl-sm-ml-3', display_text: _('Invite members') } }
= render 'projects/invite_members_modal', project: @project
......
......@@ -16487,6 +16487,9 @@ msgstr ""
msgid "Import Projects from Gitea"
msgstr ""
msgid "Import a project"
msgstr ""
msgid "Import an exported GitLab project"
msgstr ""
......
......@@ -38,16 +38,12 @@ RSpec.describe 'Projects > Settings > User manages project members' do
end
it 'imports a team from another project', :js do
stub_feature_flags(invite_members_group_modal: false)
project2.add_maintainer(user)
project2.add_reporter(user_mike)
visit(project_project_members_path(project))
page.within('.invite-users-form') do
click_link('Import')
end
click_link('Import a project')
select2(project2.id, from: '#source_project_id')
click_button('Import project members')
......@@ -55,6 +51,26 @@ RSpec.describe 'Projects > Settings > User manages project members' do
expect(find_member_row(user_mike)).to have_content('Reporter')
end
describe 'when the :invite_members_group_modal is disabled' do
it 'imports a team from another project', :js do
stub_feature_flags(invite_members_group_modal: false)
project2.add_maintainer(user)
project2.add_reporter(user_mike)
visit(project_project_members_path(project))
page.within('.invite-users-form') do
click_link('Import')
end
select2(project2.id, from: '#source_project_id')
click_button('Import project members')
expect(find_member_row(user_mike)).to have_content('Reporter')
end
end
it 'shows all members of project shared group', :js do
group.add_owner(user)
group.add_developer(user_dmitriy)
......
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