Skip to content

Adds page URL params for packages list pagination

What does this MR do and why?

Adds page URL params for packages list pagination

  • Uses persisted_pagination component (added in !127750 (merged)) to render pagination instead of registry-list
  • Refactor package_search to use persisted_search
  • Emit sorting object from persisted_search
  • Hides pagination during delete mutation
  • Adds tests

Reference MR: Adds page URL params for container image tags l... (!127958 - merged)

Screenshots or screen recordings

Before After
Pagination is not persisted in the URL Screen_Recording_2023-08-30_at_5.23.55_pm

How to set up and validate locally

  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, 50, project: p, name: p.name) - Creates 50 npm packages
  4. Add this line if above fails during the creation
     def fixture_file_upload(*args, **kwargs)
       Rack::Test::UploadedFile.new(*args, **kwargs)
     end
  5. Visit package registry for project/group. Make sure, search, sorting, & pagination works

MR acceptance checklist

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

Closes #416929 (closed) Known issue #423516 (closed)

Edited by Rahul Chanila

Merge request reports