Skip to content

Adds count badge for package other versions tab

What does this MR do and why?

Adds count badge for package details other versions tab so that it is easy for users to know how many versions exist.

Screenshots or screen recordings

With 0 other versions

Screen_Shot_2022-11-14_at_3.38.47_pm

With other versions

Screen_Shot_2022-11-14_at_3.35.17_pm

How to set up and validate locally

  1. Follow instructions to publish new packages
  2. 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
    1. rails c - Open the rails console
    2. p = Project.find(1) - Find one of your GDK projects. Project id can be found on the project home page
    3. FactoryBot.create_list(:npm_package, 25, project: p, name: p.name) - Creates 25 npm packages
    4. Add this line if above fails during the creation of the files
       def fixture_file_upload(*args, **kwargs)
         Rack::Test::UploadedFile.new(*args, **kwargs)
       end
  3. Visit package registry list page for groups & projects.
  4. Visit the package detail page
  5. Confirm the badge is visible on Other versions tab
  6. When there are no other versions confirm the badge displays 0

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #374295 (closed)

Edited by Rahul Chanila

Merge request reports