Protected packages: Delete protection rule in project settings ui
requested to merge gitlab-community/gitlab:413641-gerardo-navarro-protected-packages-add-project-settings-ui-delete into master
What does this MR do and why?
- Adding button "Delete" for each row containing a protection rule
- Sending a graphql mutation "deletePackagesProtectionRule" when the button "Delete" is clicked
- Showing an alert when the graphql mutation fails
- Adding tests for button 'Delete'
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
MR Checklist (@gerardo-navarro)
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides
Screenshots or screen recordings
I integrated the button "Delete" for each row, similar to the button in the table of protected branches
Screencast: https://www.loom.com/share/de51d65f9e9f437dbd43de5ccdd8a8af
This is the alert message that is shown when the graphql mutation returns an error, e.g. internal server error, network error, etc.
How to set up and validate locally
- In rails console enable the experiment fully
Feature.enable(:packages_protected_packages)
- Add some package protection rules
15.times { |i| Packages::Protection::Rule.create(project: Project.find_by_full_path('flightjs/Flight'), package_name_pattern: "@flightjs/flight-package-#{i}", package_type: :npm, push_protected_up_to_access_level: :maintainer) }
- Go to http://gdk.test:3000/flightjs/Flight/-/settings/packages_and_registries
- Start deleting protection rules by clicking the button "Delete"
Related to #413641
Edited by Gerardo Navarro