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
- 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 - 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Andrew Fontaine