Fixes deleting last page of package assets deleting entire package
What does this MR do and why?
Fixes deleting last page of package assets deleting entire package.
This happens only when there is more than one page of assets.
Update last page check to use both hasNextPage
& hasPreviousPage
.
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.
Screenshots or screen recordings
Before | After |
---|---|
Screen_Recording_2024-04-18_at_8.49.46_AM | Screen_Recording_2024-04-18_at_8.46.59_AM |
How to set up and validate locally
- Use the following command
for i in {1..25}; do curl --header "PRIVATE-TOKEN: <TOKEN>" --upload-file $PWD/<filename> "http://172.16.123.1:3000/api/v4/projects/<project-id>/packages/generic/<package-name>/<version>/<filename>$i"; done
to upload 25 package files.- Replace token, project-id, package-name, version, filename
- Visit package registry detail page via
Project > Deploy > Package Registry
- Navigate to the last page of the
Assets
table (via Next >), and select all assets on the page - Click 'Delete Selected'
- Confirm that just those assets are deleted & not the entire package.
Alternatively, you can follow steps to reproduce in the related issue.
Fixes #435738 (closed)