Skip to content

Groups Filter - Fix pagination tree view

Zack Cuddy requested to merge 25929-fix-pagination-tree-view into master

What does this MR do and why?

Closes #25929 (closed)

There are 3 places we call updateGroups, two of which also pass a Boolean parameter to declare if there is a filter in the query. While the third call (when pagination is clicked) never passes the Boolean and thus is always false. Note that the third call does use the filter data in the API request.

  1. fetchAllGroups
  2. fetchFilteredAndSortedGroups
  3. fetchPage (no Boolean)

By updating call 3 above to also utilize the Boolean, it properly expands the tree view as intended.

-this.updateGroups(res);
+this.updateGroups(res, Boolean(filterGroupsBy));

Screenshots or screen recordings

Before (bug) After (potential fix)
Bug Fix

How to set up and validate locally

note: Setup was a huge pain for this. If you have some scripting skills it will likely be faster than doing it manually like me 🙃

note: Watching the before and after video will hopefully make the bug more apparent as the test setup is a little wild

  1. Create a Top Level Group
  2. Create over 20 sub groups that share a common keyword (ie Group)
  3. Create a handful of sub-sub groups. Some with and some without your keyword
  4. Create a handful of projects in your sub groups/sub-sub groups. Some with and some without your keyword
  5. Create a new Sub Group and Sub-Sub Group that DOES NOT have your keyword and will alphabetically be last in the list (so its on the next page)
  6. Create a Project in the new Sub-Sub Group that DOES have your keyword
  7. Structure should look like TOP LEVEL > NO-KEYWORD SUB > NO-KEYWORD SUB-SUB > KEYWORD PROJECT
  8. Navigate to your Top Level group overview, this should be the Subgroups and projects search/list
  9. Search for your keyword
  10. Ensure there are more than one page of results and the NO-KEYWORD SUB is on the second page
  11. Go to the next page, ensure your NO-KEYWORD SUB group is in the list and fully expanded to the project that matched the keyword search
    • Compare this on master where if you follow the same steps the NO-KEYWORD SUB group will still be in the results but won't be properly expanded. Resulting in what appears like an incorrect search result

Related to #25929 (closed)

Edited by Zack Cuddy

Merge request reports

Loading