Skip to content

Remove label close button when lock on merge

Brett Walker requested to merge 408676-adjust-label-close into master

What does this MR do and why?

When the :enforce_locked_labels_on_merge feature flag is turned on for a group/project, then when we show a label that is locked (remember only for merged MRs), then do not show the close button (x) on the label. This gives an initial visual indication that the label can not be removed.

Another iteration could show an actual lock icon instead.

Screenshots or screen recordings

Note that the two locked labels, workflow::production and Jetta are locked, and do not show the close button in the second image

Before After
Screenshot_2023-08-31_at_2.53.44_PM Screenshot_2023-08-31_at_2.52.56_PM

How to set up and validate locally

  1. Enable the feature flag: Feature.enable(:enforce_locked_labels_on_merge)
  2. Enable the feature flag: Feature.enable(:visible_label_selection_on_metadata). This is for labels to appear when you edit an MR.
  3. Visit a group or project label list and create two or three labels, such as workflow::ready, workflow::dev, and workflow::production.
  4. Edit each label and click the checkbox to lock it.
  5. Choose a merged MR, and add one of the locked labels and a regular label. The close button should not be visible for the locked label.
  6. Edit the merged MR, under the labels section you should see the label without the close button.

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 #408676

Edited by Brett Walker

Merge request reports

Loading