Skip to content

Show all selected labels at top of list

Simon Knox requested to merge psi-wi-labels-top into master

What does this MR do and why?

Fix work item Selected labels for big collections (when there is more than 100 labels).

Because the label dropdown only fetches the first 100 labels, the "Selected" section at the top was sometimes empty.

Screenshots or screen recordings

before after
Screen_Recording_2024-07-23_at_09.23.38 Screen_Recording_2024-07-23_at_09.20.39

How to set up and validate locally

  1. Create a new work item. Either a Task on an issue, or enable namespace_level_work_items and create an Epic for a group
  2. Create lots of labels. This makes 1000 for the gitlab-org group
    group = Group.first  # or Group.find(123)
    
    1000.times do |i|
      name = "Label #{i + 1}"
      label = group.labels.create!(
        name: name,
        color: "#%06x" % (rand * 0xffffff) # random hex color
      )
    end
  3. Load a work item in that group
  4. Add some labels
Edited by Simon Knox

Merge request reports

Loading