Skip to content

Fixes package registry list sorting UI inconsistency

What does this MR do and why?

  • Updates the apollo cache policy for packages list query
  • Removed explicit calls to fetchMore by updating pageParams instead
  • Removes deprecated updateQuery method

Screenshots or screen recordings

Before After
Screen_Recording_2023-07-13_at_12.04.45_pm Screen_Recording_2023-07-13_at_11.45.06_am

How to set up and validate locally

  1. Publish few 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, 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
  2. Switching the sort order on the UI should always reset pagination (i.e. send us back to the 1st page).
  3. Confirm pagination continue to work as expected.

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 #409771 (closed)

Edited by Rahul Chanila

Merge request reports