Commit 71ce21e3 authored by Nathan Friend's avatar Nathan Friend

Merge branch '24401-update-delete-project-confirm-phrase' into 'master'

Update delete project confirmation phrase

Closes #24401

See merge request gitlab-org/gitlab!38700
parents fe9d2fe0 3cbb8540
- return unless can?(current_user, :remove_project, project)
- confirm_phrase = s_('DeleteProject|Delete %{name}') % { name: project.full_name }
.sub-section
%h4.danger-title= _('Remove project')
......@@ -6,4 +7,4 @@
%strong= _('Removing the project will delete its repository and all related resources including issues, merge requests etc.')
%p
%strong= _('Removed projects cannot be restored!')
#js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: project.path } }
#js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: confirm_phrase } }
---
title: Update the project deletion confirmation modal to be more specific, the confirmation
phrase now includes the project full path
merge_request: 38700
author:
type: changed
......@@ -3,6 +3,7 @@
- adjourned_date = adjourned_deletion ? permanent_deletion_date(Time.now.utc).to_s : nil;
- admin_help_path = help_page_path('user/admin_area/settings/visibility_and_access_controls', anchor: 'default-deletion-adjourned-period-premium-only')
- recovery_help_path = help_page_path('user/project/settings/index', anchor: 'remove-a-project')
- confirm_phrase = s_('DeleteProject|Delete %{name}') % { name: project.full_name }
- unless project.marked_for_deletion?
.sub-section
......@@ -19,7 +20,7 @@
%p= permanent_delete_message(project)
%p
%strong= _('Are you ABSOLUTELY SURE you wish to delete this project?')
#js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: project.path } }
#js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: confirm_phrase } }
- else
= render 'projects/settings/restore', project: project
......@@ -7815,6 +7815,9 @@ msgstr ""
msgid "Delete variable"
msgstr ""
msgid "DeleteProject|Delete %{name}"
msgstr ""
msgid "DeleteProject|Failed to remove project repository. Please try again or contact administrator."
msgstr ""
......
......@@ -260,7 +260,7 @@ RSpec.describe 'Project' do
end
it 'removes a project', :sidekiq_might_not_need_inline do
expect { remove_with_confirm('Remove project', project.path, 'Yes, delete project') }.to change { Project.count }.by(-1)
expect { remove_with_confirm('Remove project', "Delete #{project.full_name}", 'Yes, delete project') }.to change { Project.count }.by(-1)
expect(page).to have_content "Project '#{project.full_name}' is in the process of being deleted."
expect(Project.all.count).to be_zero
expect(project.issues).to be_empty
......
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