Skip to content

Reset the page to 1 when changing tabs

What does this MR do and why?

If a scope doesn't have the same number of pages, users can end up in a state where they see nothing and the page appears broken.

By moving to the first page, we ensure we load the first set of environments, which should pretty much always exist. If the count is 0, then the page will be empty as expected.

Screenshots or screen recordings

Screencast_2022-01-12_14_03_41

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! }
  3. Navigate to /h5bp/html5-boilerplate/-/environments to see the pagination
  4. Stop an environment

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Andrew Fontaine

Merge request reports

Loading