Adds delete action on package other versions tab
What does this MR do and why?
This MR adds the package version delete functionality on the other versions screen.
It re-uses the shared delete-package-modal component to render the modal.
Why
On the package list page, it's possible to delete a single package via the ellipsis button.
However, on the "other versions" screen (Package Registry > Click on Package > Other version tab), it's not possible to delete a package in this way
Screenshots or screen recordings
state | screenshot |
---|---|
vertical ellipsis visible | |
vertical ellipsis expanded | |
shared modal | |
without permission |
How to set up and validate locally
- Publish more than 20 packages with same name & different versions, as mentioned in https://gitlab.com/gitlab-org/ci-cd/package-stage/package/-/wikis/Packages-Tips-&-Tricks#how-to-create-a-list-of-packages-artificially
-
rails c
- Open the rails console -
p = Project.find(1)
- Find one of your GDK projects. Project id can be found on the project home page -
FactoryBot.create_list(:npm_package, 25, project: p, name: p.name)
- Creates 25 npm packages -
Add this line if above fails during the creation of files
def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end
-
- Visit package registry detail page via groups & projects package list page.
- Switch to the
Other versions
tab. - Should be able delete single package by clicking on the ellipsis
- Using the bulk delete UI selecting a single package & trying to delete should show the same modal content as deleting a single package
- Visit the same URL as user who does not have permission to delete package, should not be able to see ellipsis to delete package.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #382453 (closed)