Groups and Projects - Add Delete immediately list action
What / Why
Follow up from @mnichols1 comment here: !148701 (comment 1863256138)
In EE groups and projects can be scheduled for deletion, and then a follow up action can be fired to delete it fully. Currently in both scenarios the action is labeled Delete
.
As a UX improvement, it would be nice to update the label of the action to say Delete immediately
rather than simply Delete
for groups and projects that are already Pending deletion
and would be permanently deleted if the user clicked the button again.
Proposal
Add ability to configure the label of the delete action for Groups and Projects in Organizations
note: The screenshot uses the text Permanently Delete
but after engaging Technical Writing it was deemed Delete immediately
would be more ideal
Implementation Plan
note: In CE, groups are always deleted immediately. In EE, groups are marked for deletion and then can be immediately deleted in a subsequent action.
tip: This pattern is very similar to the overridden methods used in ee/organizations/shared/utils
- Add new CE method to
groups_projects/shared/utils
calleddeleteActionLabel
.
// ce
deleteActionLabel = () => {
// Overridden in EE
return __('Delete immediately')
}
- Add new EE method to
ee/group_projects/shared/utils
calleddeleteActionLabel
that overrides the CE version.
// ee
import { deleteActionLabel as deleteActionLabelCE } from '~/group_projects/shared/utils';
deleteActionLabel = (item) => {
// If delayed deletion is disabled or the project/group is already marked for deletion, use the CE label
if (!item.isAdjournedDeletionEnabled || item.markedForDeletionOn) {
return deleteParamsCE();
}
return __('Delete')
}
- Add ce/ee method call to
actions()
computed invue_shared/components/groups_list/groups_list_item.vue
import { deleteActionLabel } from 'ee_else_ce/groups_projects/shared/utils'
actions() {
return {
[ACTION_EDIT]: {
href: this.group.editPath,
},
[ACTION_DELETE]: {
text: deleteActionLabel(this.group)
action: this.onActionDelete,
},
};
},
- Add ce/ee method call to
actions()
computed invue_shared/components/projects_list/projects_list_item.vue
import { deleteActionLabel } from 'ee_else_ce/groups_projects/shared/utils'
actions() {
return {
[ACTION_EDIT]: {
href: this.project.editPath,
},
[ACTION_DELETE]: {
text: deleteActionLabel(this.project)
action: this.onActionDelete,
},
};
},