De-prioritizing issue labels results in them going to the wrong place on the issue list page
Summary
When un-prioritizing labels in the label list view, if there is more than one page of labels, the now un-prioritized labels will appear below the pagination controls and also out of order. A page refresh fixes this.
Steps to reproduce
- Ensure there are more than 25 labels so that the label list view has multiple pages.
- Prioritize some number of labels.
- Remove the prioritization of any of those labels.
- Observe that the labels that were removed from being prioritized are now below the pagination controls.
Example Project
https://gitlab.com/JoelFeiner/BugTest/labels
What is the current bug behavior?
Labels that have been un-prioritized go below the pagination controls and are not in the same order that they were in originally.
What is the expected correct behavior?
Labels should be among the other labels in the main list in the original ordering (before prioritization).
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
The pagination controls are in a div with class gl-pagination
, which is a child of the ul
that contains the labels (classes are: content-list manage-labels-list js-other-labels
). When the labels remove their prioritized status, they are added to the end of the ul
, which make sense. The problem is that the pagination controls are also a child of the ul
. I suspect that the controls are supposed to be outside of the ul
, which would fix this problem. Indeed, moving the pagination div
one level higher in the Firefox inspector seems to fix that issue.
As for the ordering issue, that would require that the JS finds the correct spot in the list and puts them in there, which is more complicated (especially with pagination).