Skip to content

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 for Status 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
Screenshot_2024-04-23_at_12.43.10_AM Screenshot_2024-05-01_at_8.28.56_AM

How to set up and validate locally

  1. On your rails console bundle exec rails c
    1. def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end
    2. Find the project where you want to work with the package registry p = Project.find(<project_id>)
    3. Create 10 packages: FactoryBot.create_list(:npm_package, 10, project: p)
  2. Go to the package registry using the sidebar or via the URL <hostname>/<project>/-/packages & visit the package detail page
  3. 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)
  4. Re-visit the list page & you should be able to see the error alert with alert message for only one package.
    1. Clicking on the button should show the confirmation to delete the package.
  5. Back in your rails console Update the status of two packages to ERROR
  6. Re-visit the list page & you should be able to see the error alert with alert message for only multiple packages.
    1. Clicking on the button redirect to the list page with Status filter set to Error

Other verifications

  1. Verify that list page with Status filter set to Error does not show the error alert message.
  2. 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

Merge request reports