Add pagination to new environments app
What does this MR do and why?
The old page paginates based on the headers returned by the API, and so we do the same here.
We put the page info header into the GraphQL cache, and fetch it out to pass it to the pagination component from GitLab UI.
Also the pagination must be wired up to the query parameters to support deep linking.
I wonder if GlPagination
should just have a prop for syncing the query
parameters, like GlTabs
does.
Screenshots or screen recordings
How to set up and validate locally
- Enable the new table:
Feature.enable(:new_environments_table)
- Create many new environments:
project = Project.find(8)
1..50.each { |i| Environment.new(project: project, name: "foo-#{i}").save! }
- Navigate to
/h5bp/html5-boilerplate/-/environments
to see the pagination
NOTE: no environments show up yet. This is coming in !74418 (merged)
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.