Streamline Project#archived? to hide deletion-related logic
What does this MR do and why?
This merge request improves the project archiving functionality by adding a new helper method archiving_available? that checks if a project can be archived based on several conditions: the project must exist, be saved to the database, not marked for deletion, and the current user must have permission to archive it.
The code also refines how archived project banners are displayed by ensuring they only appear for persisted (saved) projects that are archived but not marked for deletion. Similarly, the inactive project deletion banner logic was simplified to only check necessary conditions.
The changes also modify the project model to ensure that a project marked for deletion is never considered archived, even if the archived flag is set. This prevents confusion in the UI by making the statuses mutually exclusive.
The templates for displaying archive options were updated to use the new helper method, and redundant EE-specific templates were removed to consolidate the code. Comprehensive tests were added to verify all these behaviors work correctly across different project states.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.