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 |
---|---|
How to set up and validate locally
- Make sure you have an ultimate license for your GDK
- Enable the feature flag:
ci_private_catalog_beta
- Login as a user
- Create a few projects that you will be able to convert to Ci resources (ideally 20+).
- 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
- Navigate to
/$namespace/$project/-/ci/catalog/resources
- Notice that you get text saying "Page X of Y"
- Click next
- Notice that you are now seeing "Page X+1 of Y"
- Click next until you reach the last page
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #406829 (closed)
Edited by Frédéric Caplette