Skip to content

Group and Projects - Move perm deletion method

What does this MR do and why?

Broken off from: !148562 (comment 1844460571)
Required for: #442810 (closed)

This change moves the permanent_deletion_date method from the Group and Project helpers to the models. Then it allows for the view helper and GraphQL types to format the date as they see fit. The major change is this requires us to pass in the group/project into the helper.

The win however, is this allows us to use the model as a SSoT for both the HAML views and GraphQL API without duplicating logic or exposing the helper to the model.

Screenshots or screen recordings

Project (Functionality Preserved) Group (Functionality Preserved)
Project Group

How to set up and validate locally

Important: No functionality should have changed in this MR
Important: Repeat this testing for both Project and Group

  1. Create Project or Group
  2. Go to Settings => General
  3. Scroll down to Advanced and expand it
  4. Scroll to bottom and click Remove Project/Group
  5. Ensure pop up shows the permanent deletion date (usually 7days ahead)
  6. Schedule removal by filling out modal
  7. Page should refresh, ensure all alerts showcase that same permanent deletion date
  8. Go to Settings => General
  9. Scroll down to Advanced and expand it
  10. Locate the Restore section
  11. Ensure it also reflects the permanent deletion date
Edited by Zack Cuddy

Merge request reports