Add a place to recover deleted projects in the Admin project list page

Problem

Following discussion on https://gitlab.com/gitlab-org/gitlab/-/issues/381261, while you can restore a project from the project list page, that functionality isn't currently available in the Admin section of the product. This issue is to add the ability to restore projects to the Admin Area project list page, so the behaviors across group and project list pages is consistent.

Design proposal

Following the existing pattern on the projects list page, add an Inactive tab to the Admin Area project list page.

Admin___Project

  • A new Inactive tab is introduced that collects items that are pending deletion or archived
  • Ensure that the Delete action in any of the other tabs (All, Public, Internal, Private) marks the item as pending deletion, and moves it to the Inactive tab, instead of permanently deleting the item
  • Deleting an item from the Inactive tab leads to a permanent deletion
  • Ensure that projects deleted by a project Owner or Maintainer instead of an Admin also appear in the Inactive tab of the Admin Area

Empty state

Empty state for the tabs call follow the existing empty state pattern on the project list page:

Screenshot_2023-03-10_at_11.52.59_AM

More details in the "final designs" tab of the Figma file

Implementation plan

Backend

Add support to app/controllers/admin/projects_controller.rb#L45 for a :permanently_delete parameter, similar logic to app/controllers/projects_controller.rb#L43.

Frontend

  1. Add tab to app/views/admin/projects/index.html.haml#L13
  2. Add check in app/views/admin/projects/_projects.html.haml#L25 and render Restore button if it is a project pending deletion.
Edited by Rémy Coutable