Skip to content

Add page count to the CI catalog pagination

What does this MR do and why?

In the catalog page, we use keyset pagination to allow user to browser paginated catalog resources. However, because of that, we do not have a count of the total number of pages or where you currently are in the pageCount. This MR implements such a system under the prev and next buttons.

Screenshots or screen recordings

Recording

Screen_Recording_2023-04-18_at_1.58.25_PM

Screenshots

Before After
Screenshot_2023-04-18_at_12.53.53_PM Screenshot_2023-04-18_at_1.58.20_PM

How to set up and validate locally

  1. Make sure you have an ultimate license for your GDK
  2. Enable the feature flag: ci_private_catalog_beta
  3. Login as a user
  4. Create a few projects that you will be able to convert to Ci resources (ideally 20+).
  5. Once you have done so, get the ID of the first new project you wanted to convert. Then in Rails console, run:
projects = Project.where("id > ?", your_first_project_id)
projects.each do |project|
  project.update!(description: 'description')  
  ::Ci::Catalog::Resource.new(project_id: project.id).save   
end  
  1. Navigate to /$namespace/$project/-/ci/catalog/resources
  2. Notice that you get text saying "Page X of Y"
  3. Click next
  4. Notice that you are now seeing "Page X+1 of Y"
  5. Click next until you reach the last page
  6. Notice that you now see "Page Y of Y" and the next button is disabled

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

Edited by Frédéric Caplette

Merge request reports

Loading