Improves alert message when multiple error packages exist
What does this MR do and why?
Improves alert message when multiple error packages exist (disclaimer) in the same page
There is no way to identify the exact number of errored packages without making a separate GraphQL query for the list of error packages & get the count from that request. This could be part of a follow-up MR.
- Updates the button to filter by error status when multiple error packages exist
- Hides alert when filtered by error status
- Updates
packageStatus
filter values to lowercase so that page handles both lowercase & uppercase values forStatus
filter
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 |
---|---|
How to set up and validate locally
- On your rails console
bundle exec rails c
def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end
- Find the project where you want to work with the package registry
p = Project.find(<project_id>)
- Create 10 packages:
FactoryBot.create_list(:npm_package, 10, project: p)
- Go to the package registry using the sidebar or via the URL
<hostname>/<project>/-/packages
& visit the package detail page - Back in your rails console Update the status of one package to
ERROR
Packages::Package.find(<package-id-from-details-page-url>).update(status: :error)
- Re-visit the list page & you should be able to see the error alert with alert message for only one package.
- Clicking on the button should show the confirmation to delete the package.
- Back in your rails console Update the status of two packages to
ERROR
- Re-visit the list page & you should be able to see the error alert with alert message for only multiple packages.
- Clicking on the button redirect to the list page with
Status
filter set toError
- Clicking on the button redirect to the list page with
Other verifications
- Verify that list page with
Status
filter set toError
does not show the error alert message. - On the list page with
Status
filter set, change the query param value to uppercase & confirm the page filters by status correctly.
Closes #451054 (closed)
Edited by Rahul Chanila