Commit dee082a8 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'dennis-refactor-project-transfer-modal' into 'master'

Tidy up "Transfer project" of project edit

See merge request gitlab-org/gitlab!46294
parents 32ae33c6 0f82cf85
- return unless can?(current_user, :change_namespace, @project)
.sub-section
%h4.danger-title= _('Transfer project')
= form_for @project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } do |f|
.form-group
= label_tag :new_namespace_id, nil, class: 'label-bold' do
%span= _('Select a new namespace')
.form-group
= select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2'
%ul
%li= _("Be careful. Changing the project's namespace can have unintended side effects.")
%li= _('You can only transfer the project to namespaces you manage.')
%li= _('You will need to update your local repositories to point to the new location.')
%li= _('Project visibility level will be changed to match namespace rules when transferring to a group.')
= f.submit 'Transfer project', class: "gl-button btn btn-danger js-confirm-danger qa-transfer-button", data: { "confirm-danger-message" => transfer_project_message(@project) }
...@@ -93,21 +93,7 @@ ...@@ -93,21 +93,7 @@
%li= _('Your deployment services will be broken, you will need to manually fix the services after renaming.') %li= _('Your deployment services will be broken, you will need to manually fix the services after renaming.')
= f.submit _('Change path'), class: "btn btn-warning qa-change-path-button" = f.submit _('Change path'), class: "btn btn-warning qa-change-path-button"
- if can?(current_user, :change_namespace, @project) = render 'transfer', project: @project
.sub-section
%h4.danger-title= _('Transfer project')
= form_for @project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } do |f|
.form-group
= label_tag :new_namespace_id, nil, class: 'label-bold' do
%span= _('Select a new namespace')
.form-group
= select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2'
%ul
%li= _("Be careful. Changing the project's namespace can have unintended side effects.")
%li= _('You can only transfer the project to namespaces you manage.')
%li= _('You will need to update your local repositories to point to the new location.')
%li= _('Project visibility level will be changed to match namespace rules when transferring to a group.')
= f.submit 'Transfer project', class: "gl-button btn btn-danger js-confirm-danger qa-transfer-button", data: { "confirm-danger-message" => transfer_project_message(@project) }
= render 'remove_fork', project: @project = render 'remove_fork', project: @project
......
...@@ -11,6 +11,9 @@ module QA ...@@ -11,6 +11,9 @@ module QA
view 'app/views/projects/edit.html.haml' do view 'app/views/projects/edit.html.haml' do
element :project_path_field element :project_path_field
element :change_path_button element :change_path_button
end
view 'app/views/projects/_transfer.html.haml' do
element :transfer_button element :transfer_button
end end
......
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