Commit 612a5504 authored by Dan Jensen's avatar Dan Jensen Committed by Peter Leitzen

Refer to project delete instead of remove

Previously, deleting a project was described as "removing" it in the
UI. However, the term "remove" is generally used for non-permanent
actions, whereas deleting a project is permanent. This replaces usage
of "remove" with "delete" when referring to project deletion.
parent 867e1ff1
......@@ -54,7 +54,7 @@ export default {
},
},
strings: {
deleteProject: __('Remove project'),
deleteProject: __('Delete project'),
title: __('Delete project. Are you ABSOLUTELY SURE?'),
confirmText: __('Please type the following to confirm:'),
},
......
......@@ -130,7 +130,7 @@ module GroupsHelper
end
def remove_group_message(group)
_("You are going to remove %{group_name}, this will also remove all of its subgroups and projects. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?") %
_("You are going to remove %{group_name}, this will also delete all of its subgroups and projects. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?") %
{ group_name: group.name }
end
......
......@@ -104,7 +104,7 @@ module ProjectsHelper
end
def remove_project_message(project)
_("You are going to remove %{project_full_name}. Removed project CANNOT be restored! Are you ABSOLUTELY sure?") %
_("You are going to delete %{project_full_name}. Deleted projects CANNOT be restored! Are you ABSOLUTELY sure?") %
{ project_full_name: project.full_name }
end
......
......@@ -31,7 +31,7 @@ module Projects
attempt_destroy_transaction(project)
system_hook_service.execute_hooks_for(project, :destroy)
log_info("Project \"#{project.full_path}\" was removed")
log_info("Project \"#{project.full_path}\" was deleted")
current_user.invalidate_personal_projects_count
......
......@@ -15,7 +15,7 @@
.controls
= link_to _('Members'), project_project_members_path(project), id: "edit_#{dom_id(project)}", class: "btn"
= link_to _('Edit'), edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn"
= link_to _('Remove'), project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-remove"
= link_to _('Delete'), project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-remove"
.stats
%span.badge.badge-pill
......
......@@ -2,9 +2,9 @@
- confirm_phrase = s_('DeleteProject|Delete %{name}') % { name: project.full_name }
.sub-section
%h4.danger-title= _('Remove project')
%h4.danger-title= _('Delete project')
%p
%strong= _('Removing the project will delete its repository and all related resources including issues, merge requests etc.')
%strong= _('Deleting the project will delete its repository and all related resources including issues, merge requests etc.')
%p
%strong= _('Removed projects cannot be restored!')
%strong= _('Deleted projects cannot be restored!')
#js-project-delete-button{ data: { form_path: project_path(project), confirm_phrase: confirm_phrase } }
......@@ -22,4 +22,4 @@
- if can? current_user, :remove_project, @project
.prepend-top-20
= link_to _('Remove project'), project_path(@project), data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-inverted btn-remove float-right"
= link_to _('Delete project'), project_path(@project), data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-inverted btn-remove float-right"
---
title: Re-name project remove as project delete
merge_request: 38489
author:
type: changed
......@@ -167,7 +167,7 @@ user = User.find_by_username('root')
# Find the project, update the xxx-changeme values from above
project = Project.find_by_full_path('group-changeme/project-changeme')
# Delete the project
# Immediately delete the project
::Projects::DestroyService.new(project, user, {}).execute
```
......
......@@ -1832,11 +1832,11 @@ Example response:
}
```
## Remove project
## Delete project
This endpoint:
- Removes a project including all associated resources (issues, merge requests etc).
- Deletes a project including all associated resources (issues, merge requests etc).
- From [GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/issues/220382) on [Premium or Silver](https://about.gitlab.com/pricing/) or higher tiers,
group admins can [configure](../user/group/index.md#enabling-delayed-project-removal-premium) projects within a group
to be deleted after a delayed period.
......
......@@ -221,7 +221,7 @@ are listed in the descriptions of the relevant settings.
| `default_project_visibility` | string | no | What visibility level new projects receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
| `default_projects_limit` | integer | no | Project limit per user. Default is `100000`. |
| `default_snippet_visibility` | string | no | What visibility level new snippets receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`. |
| `deletion_adjourned_period` | integer | no | **(PREMIUM ONLY)** The number of days to wait before removing a project or group that is marked for deletion. Value must be between 0 and 90.
| `deletion_adjourned_period` | integer | no | **(PREMIUM ONLY)** The number of days to wait before deleting a project or group that is marked for deletion. Value must be between 0 and 90.
| `diff_max_patch_bytes` | integer | no | Maximum diff patch size (Bytes). |
| `disabled_oauth_sign_in_sources` | array of strings | no | Disabled OAuth sign-in sources. |
| `dns_rebinding_protection_enabled` | boolean | no | Enforce DNS rebinding attack protection. |
......
......@@ -636,7 +636,7 @@ Errors in `locale/zh_HK/gitlab.po`:
Syntax error in msgstr
Syntax error in message_line
There should be only whitespace until the end of line after the double quote character of a message text.
Parsing result before error: '{:msgid=>["", "You are going to remove %{project_name_with_namespace}.\\n", "Removed project CANNOT be restored!\\n", "Are you ABSOLUTELY sure?"]}'
Parsing result before error: '{:msgid=>["", "You are going to delete %{project_name_with_namespace}.\\n", "Deleted projects CANNOT be restored!\\n", "Are you ABSOLUTELY sure?"]}'
SimplePoParser filtered backtrace: SimplePoParser::ParserError
Errors in `locale/zh_TW/gitlab.po`:
1 pipeline
......
......@@ -156,7 +156,7 @@ The following table depicts the various user permission levels in a project.
| Transfer project to another namespace | | | | | ✓ |
| Rename project | | | | | ✓ |
| Remove fork relationship | | | | | ✓ |
| Remove project | | | | | ✓ |
| Delete project | | | | | ✓ |
| Archive project | | | | | ✓ |
| Delete issues | | | | | ✓ |
| Delete pipelines | | | | | ✓ |
......@@ -416,7 +416,7 @@ instance and project. In addition, all admins can use the admin interface under
| See commits and jobs | ✓ | ✓ | ✓ | ✓ |
| Retry or cancel job | | ✓ | ✓ | ✓ |
| Erase job artifacts and trace | | ✓ (*1*) | ✓ | ✓ |
| Remove project | | | ✓ | ✓ |
| Delete project | | | ✓ | ✓ |
| Create project | | | ✓ | ✓ |
| Change project configuration | | | ✓ | ✓ |
| Add specific runners | | | ✓ | ✓ |
......
......@@ -180,22 +180,22 @@ Read through the documentation on [project settings](settings/index.md).
- [Export a project from GitLab](settings/import_export.md#exporting-a-project-and-its-data)
- [Importing and exporting projects between GitLab instances](settings/import_export.md)
## Remove a project
## Delete a project
To remove a project, first navigate to the home page for that project.
To delete a project, first navigate to the home page for that project.
1. Navigate to **Settings > General**.
1. Expand the **Advanced** section.
1. Scroll down to the **Remove project** section.
1. Click **Remove project**
1. Scroll down to the **Delete project** section.
1. Click **Delete project**
1. Confirm this action by typing in the expected text.
### Delayed removal **(PREMIUM)**
### Delayed deletion **(PREMIUM)**
By default, clicking to remove a project is followed by a seven day delay. Admins can restore the project during this period of time.
By default, clicking to delete a project is followed by a seven day delay. Admins can restore the project during this period of time.
This delay [may be changed by an admin](../admin_area/settings/visibility_and_access_controls.md#default-deletion-delay-premium-only).
Admins can view all projects pending deletion. If you're an administrator, go to the top navigation bar, click **Projects > Your projects**, and then select the **Removed projects** tab.
Admins can view all projects pending deletion. If you're an administrator, go to the top navigation bar, click **Projects > Your projects**, and then select the **Deleted projects** tab.
From this tab an admin can restore any project.
## CI/CD for external repositories **(PREMIUM)**
......
......@@ -219,20 +219,20 @@ NOTE: **Note:**
GitLab administrators can use the admin interface to move any project to any
namespace if needed.
#### Remove a project
#### Delete a project
NOTE: **Note:**
Only project owners and admins have [permissions](../../permissions.md#project-members-permissions) to remove a project.
Only project owners and admins have [permissions](../../permissions.md#project-members-permissions) to delete a project.
To remove a project:
To delete a project:
1. Navigate to your project, and select **Settings > General > Advanced**.
1. In the Remove project section, click the **Remove project** button.
1. In the "Delete project" section, click the **Delete project** button.
1. Confirm the action when asked to.
This action:
- Removes a project including all associated resources (issues, merge requests etc).
- Deletes a project including all associated resources (issues, merge requests etc).
- From [GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/issues/220382) on [Premium or Silver](https://about.gitlab.com/pricing/) or higher tiers,
group admins can [configure](../../group/index.md#enabling-delayed-project-removal-premium) projects within a group
to be deleted after a delayed period.
......
......@@ -126,7 +126,7 @@ export default {
.then(() => {
this.$emit('handleProjectManipulation', false);
})
.catch(() => createFlash(__('Something went wrong, unable to remove project')));
.catch(() => createFlash(__('Something went wrong, unable to delete project')));
},
searched(query) {
this.searchQuery = query;
......
......@@ -142,7 +142,7 @@ export const receiveRemoveProjectSuccess = ({ commit, dispatch }) => {
export const receiveRemoveProjectError = ({ commit }) => {
commit(types.RECEIVE_REMOVE_PROJECT_ERROR);
createFlash(__('Something went wrong, unable to remove project'));
createFlash(__('Something went wrong, unable to delete project'));
};
export const fetchSearchResults = ({ state, dispatch, commit }) => {
......
......@@ -145,7 +145,7 @@ export const removeProject = ({ dispatch }, removePath) => {
export const receiveRemoveProjectSuccess = ({ dispatch }) => dispatch('forceProjectsRequest');
export const receiveRemoveProjectError = () => {
createFlash(__('Something went wrong, unable to remove project'));
createFlash(__('Something went wrong, unable to delete project'));
};
export const setSearchQuery = ({ commit }, query) => commit(types.SET_SEARCH_QUERY, query);
......
......@@ -90,7 +90,7 @@ module EE
return super unless project.adjourned_deletion?
date = permanent_deletion_date(Time.now.utc)
_("Removing a project places it into a read-only state until %{date}, at which point the project will be permanently removed. Are you ABSOLUTELY sure?") %
_("Deleting a project places it into a read-only state until %{date}, at which point the project will be permanently deleted. Are you ABSOLUTELY sure?") %
{ date: date }
end
......
- if can?(current_user, :list_removable_projects)
= nav_link(page: removed_dashboard_projects_path) do
= link_to removed_dashboard_projects_path, data: {placement: 'right'} do
= _("Removed projects")
= _("Deleted projects")
%span.badge.badge-pill= limited_counter_with_delimiter(removed_projects_count)
= render partial: 'dashboard/projects/shared/common', locals: { page_title: _('Removed Projects'), empty_page: 'removed_empty_state' }
= render partial: 'dashboard/projects/shared/common', locals: { page_title: _('Deleted Projects'), empty_page: 'removed_empty_state' }
......@@ -2,12 +2,12 @@
- adjourned_deletion = project.adjourned_deletion?
- 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-delay-premium-only')
- recovery_help_path = help_page_path('user/project/settings/index', anchor: 'remove-a-project')
- recovery_help_path = help_page_path('user/project/settings/index', anchor: 'delete-a-project')
- confirm_phrase = s_('DeleteProject|Delete %{name}') % { name: project.full_name }
- unless project.marked_for_deletion?
.sub-section
%h4.danger-title= _('Remove project')
%h4.danger-title= _('Delete project')
%p
%strong= s_('Delayed Project Deletion (%{adjourned_deletion})') % { adjourned_deletion: adjourned_deletion ? 'Enabled' : 'Disabled' }
- if adjourned_deletion
......
......@@ -24,7 +24,7 @@ exports[`Project remove modal initialized matches the snapshot 1`] = `
tabindex="0"
variant="danger"
>
Remove project
Delete project
</gl-button-stub>
<gl-modal-stub
......
......@@ -430,7 +430,7 @@ describe('EE projectSelector actions', () => {
actions.receiveRemoveProjectError(mockDispatchContext);
expect(createFlash).toHaveBeenCalledTimes(1);
expect(createFlash).toHaveBeenCalledWith('Something went wrong, unable to remove project');
expect(createFlash).toHaveBeenCalledWith('Something went wrong, unable to delete project');
});
});
......
......@@ -4,7 +4,7 @@ const AVATAR_URL = `${TEST_HOST}/dummy.jpg`;
export const mockText = {
ADD_PROJECTS_ERROR: 'Something went wrong, unable to add projects to dashboard',
REMOVE_PROJECT_ERROR: 'Something went wrong, unable to remove project',
REMOVE_PROJECT_ERROR: 'Something went wrong, unable to delete project',
NO_SEARCH_RESULTS: 'Sorry, no projects matched your search',
RECEIVE_PROJECTS_ERROR: 'Something went wrong, unable to get projects',
};
......
......@@ -276,7 +276,7 @@ RSpec.describe ProjectsHelper do
it do
deletion_date = helper.permanent_deletion_date(Time.now.utc)
expect(subject).to eq "Removing a project places it into a read-only state until #{deletion_date}, at which point the project will be permanently removed. Are you ABSOLUTELY sure?"
expect(subject).to eq "Deleting a project places it into a read-only state until #{deletion_date}, at which point the project will be permanently deleted. Are you ABSOLUTELY sure?"
end
end
......@@ -284,7 +284,7 @@ RSpec.describe ProjectsHelper do
let(:enabled) { false }
it do
expect(subject).to eq "You are going to remove #{project.full_name}. Removed project CANNOT be restored! Are you ABSOLUTELY sure?"
expect(subject).to eq "You are going to delete #{project.full_name}. Deleted projects CANNOT be restored! Are you ABSOLUTELY sure?"
end
end
end
......
......@@ -448,7 +448,7 @@ module API
.execute.map { |lang| [lang.name, lang.share] }.to_h
end
desc 'Remove a project'
desc 'Delete a project'
delete ":id" do
authorize! :remove_project, user_project
......
......@@ -7884,15 +7884,27 @@ msgstr ""
msgid "Deleted"
msgstr ""
msgid "Deleted Projects"
msgstr ""
msgid "Deleted chat nickname: %{chat_name}!"
msgstr ""
msgid "Deleted in this version"
msgstr ""
msgid "Deleted projects"
msgstr ""
msgid "Deleted projects cannot be restored!"
msgstr ""
msgid "Deleting"
msgstr ""
msgid "Deleting a project places it into a read-only state until %{date}, at which point the project will be permanently deleted. Are you ABSOLUTELY sure?"
msgstr ""
msgid "Deleting the license failed."
msgstr ""
......@@ -7902,6 +7914,9 @@ msgstr ""
msgid "Deleting the license failed. You are not permitted to perform this action."
msgstr ""
msgid "Deleting the project will delete its repository and all related resources including issues, merge requests etc."
msgstr ""
msgid "Deletion pending. This project will be removed on %{date}. Repository and other project resources are read-only."
msgstr ""
......@@ -20240,9 +20255,6 @@ msgstr ""
msgid "Remove priority"
msgstr ""
msgid "Remove project"
msgstr ""
msgid "Remove secondary node"
msgstr ""
......@@ -20276,9 +20288,6 @@ msgstr ""
msgid "Removed %{type} with id %{id}"
msgstr ""
msgid "Removed Projects"
msgstr ""
msgid "Removed all labels."
msgstr ""
......@@ -20291,12 +20300,6 @@ msgstr ""
msgid "Removed parent epic %{epic_ref}."
msgstr ""
msgid "Removed projects"
msgstr ""
msgid "Removed projects cannot be restored!"
msgstr ""
msgid "Removed spent time."
msgstr ""
......@@ -20345,15 +20348,9 @@ msgstr ""
msgid "Removes time estimate."
msgstr ""
msgid "Removing a project places it into a read-only state until %{date}, at which point the project will be permanently removed. Are you ABSOLUTELY sure?"
msgstr ""
msgid "Removing license…"
msgstr ""
msgid "Removing the project will delete its repository and all related resources including issues, merge requests etc."
msgstr ""
msgid "Removing this group also removes all child projects, including archived projects, and their resources."
msgstr ""
......@@ -22744,10 +22741,10 @@ msgstr ""
msgid "Something went wrong, unable to add projects to dashboard"
msgstr ""
msgid "Something went wrong, unable to get projects"
msgid "Something went wrong, unable to delete project"
msgstr ""
msgid "Something went wrong, unable to remove project"
msgid "Something went wrong, unable to get projects"
msgstr ""
msgid "Something went wrong, unable to search projects"
......@@ -27657,10 +27654,10 @@ msgstr ""
msgid "You are connected to the Prometheus server, but there is currently no data to display."
msgstr ""
msgid "You are going to remove %{group_name}, this will also remove all of its subgroups and projects. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?"
msgid "You are going to delete %{project_full_name}. Deleted projects CANNOT be restored! Are you ABSOLUTELY sure?"
msgstr ""
msgid "You are going to remove %{project_full_name}. Removed project CANNOT be restored! Are you ABSOLUTELY sure?"
msgid "You are going to remove %{group_name}, this will also delete all of its subgroups and projects. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?"
msgstr ""
msgid "You are going to remove the fork relationship from %{project_full_name}. Are you ABSOLUTELY sure?"
......
......@@ -254,13 +254,13 @@ RSpec.describe 'Project' do
end
it 'focuses on the confirmation field' do
click_button 'Remove project'
click_button 'Delete project'
expect(page).to have_selector '#confirm_name_input:focus'
end
it 'removes a project', :sidekiq_might_not_need_inline do
expect { remove_with_confirm('Remove project', "Delete #{project.full_name}", 'Yes, delete project') }.to change { Project.count }.by(-1)
it 'deletes a project', :sidekiq_might_not_need_inline do
expect { remove_with_confirm('Delete 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
......
......@@ -24,7 +24,7 @@ exports[`Project remove modal initialized matches the snapshot 1`] = `
tabindex="0"
variant="danger"
>
Remove project
Delete project
</gl-button-stub>
<gl-modal-stub
......
......@@ -25,7 +25,7 @@ exports[`Project remove modal intialized matches the snapshot 1`] = `
tabindex="0"
variant="danger"
>
Remove project
Delete project
</gl-button-stub>
<b-modal-stub
......
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