Skip to content

Add pagination to new environments app

Andrew Fontaine requested to merge afontaine/new-environments-pagination into master

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

image

How to set up and validate locally

  1. Enable the new table: Feature.enable(:new_environments_table)
  2. Create many new environments:
project = Project.find(8)
1..50.each { |i| Environment.new(project: project, name: "foo-#{i}").save! }
  1. 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.

Merge request reports

Loading