Groups Filter - Fix pagination tree view
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.
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
- Create a Top Level Group
- Create over 20 sub groups that share a common keyword (ie
Group
) - Create a handful of sub-sub groups. Some with and some without your keyword
- Create a handful of projects in your sub groups/sub-sub groups. Some with and some without your keyword
- 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)
- Create a Project in the new Sub-Sub Group that DOES have your keyword
- Structure should look like
TOP LEVEL > NO-KEYWORD SUB > NO-KEYWORD SUB-SUB > KEYWORD PROJECT
- Navigate to your Top Level group overview, this should be the Subgroups and projects search/list
- Search for your keyword
- Ensure there are more than one page of results and the NO-KEYWORD SUB is on the second page
- 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
- Compare this on
Related to #25929 (closed)
Edited by Zack Cuddy