Improve rule editing for package protection settings
What does this MR do and why?
Updates package protection rule feature in project Packages and registries settings to allow rule editing.
Why - #502893 (closed)
Update the protected packages feature to allow in-place rule editing, similar to the functionality planned (https://gitlab.com/gitlab-org/gitlab/-/issues/499871/designs/applied.png) for protected container tags. This enhancement will streamline the user experience and bring consistency across GitLab's protection features.
What
- Adding the ability to created & edit package protection rules through a drawer.
- Refactors the access level display text by moving the formatting logic to a shared utility function (
getAccessLevelLabel). - Updating the form component to handle both creation and updates of protection rules by detecting whether it's being used for a new rule or an existing one.
- Added toast messages when rules are created addresses Add toast message when a protection rule is add... (#509170 - closed)
- Update the table display to show formatted values and adding edit buttons alongside the existing delete functionality.
Changelog: changed
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
![]() |
|
![]() |
How to set up and validate locally
- Visit
Project > Settings > Packages and registries - Interact with Protected packages feature, should be able to create, edit & delete rules.
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.
Related to #502893 (closed)
Edited by Rahul Chanila



