Skip to content

Add pages in variable list and preserve sorting order

What does this MR do and why?

In the CI/CD settings / variables, we currently batch load every single variable up to 2k variables and then proceed to display all of them in one long list. This pushes down the action buttons way down in the page and is a overall poor experience. This MR introduces a change to this behaviour behind a feature flag : ci_variables_pages which will only load 20 variables in one go and then display pages control at the bottom of it. This will ensure that the actual page of variables does not take too much vertical space. It will also removes the need to bach load the variables and we will be able to rely more on the natural data flow of apollo.

IMPORTANT: The diff looks big, but it's quite smaller. There is a lot of moving lines around and nesting some tests, so I believe it is small enough to be one MR.

Screenshots or screen recordings

Landing screenshot

Before After
Screenshot_2023-02-17_at_10.10.16_AM Screenshot_2023-02-17_at_11.10.00_AM

General navigation

Before After
variable_list_before_pages variable_list_after_pages

Sorting

Before After
variable_list_before_sort variable_list_after_sort

How to set up and validate locally

  1. Enable feature flag: ci_variables_pages
  2. Go to Settings => Ci/CD => Variables
  3. Add at least 21 variables
  4. Refresh
  5. Notice only 20 are loaded and pages appear for the following ones
  6. Sort by ASC alphabetical order
  7. Notice that you are taken back to the first page in alphabetical order
  8. Go to page 2
  9. Notice the order continues
  10. Click on sort by DESC
  11. Notice you are taken back to page 1
  12. Notice the variables are sorted in alphabetical DESC order

MR acceptance checklist

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

Related to #388827 (closed)

Edited by Frédéric Caplette

Merge request reports