Skip to content

Adds keyset pagination to package assets table

Rahul Chanila requested to merge 353820-package-files-pagination into master

What does this MR do and why?

  • Uses GlKeysetPagination, that means page numbers cannot be displayed.
  • Disables pagination while loading
  • Page size is set to 20.
  • provides prevText and nextText props with translatable strings.

Screenshots or screen recordings

Before After (< 20 assets) After (first page) After (middle page) After (last page)
172.16.123.1_3000_gitlab-org_subgroup_CNG-mirror_-packages_239__1 Screenshot_2023-06-07_at_12.31.55_am Screenshot_2023-06-07_at_12.32.26_am Screenshot_2023-06-07_at_12.32.45_am Screenshot_2023-06-07_at_12.33.11_am

How to set up and validate locally

  1. Use the following command for i in {1..125}; do curl --header "PRIVATE-TOKEN: <TOKEN>" --upload-file $PWD/<filename> "http://172.16.123.1:3000/api/v4/projects/<project-id>/packages/generic/<package-name>/<version>/<filename>$i"; done to upload 125 package files.
    1. Replace token, project-id, package-name, version, filename
  2. Visit package registry detail page via groups & projects package list page.
  3. Confirm the package assets with pagination is visible.
  4. Confirm page size is 20 & pagination works as expected.
  5. Confirm features delete assets, bulk deletion of assets work as expected.
  6. Confirm that if there are less than 20 package files, pagination is not displayed.

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

Edited by Rahul Chanila

Merge request reports

Loading