Hide archived labels from auto completion

What does this MR do and why?

This MR hides archived labels from auto completion. It's a follow-up to !196443 (merged) that added the ability to archive labels.

It's behind a feature flag called labels_archive.

🛠️ with ❤️ at Siemens

References

Screenshots or screen recordings

After enabling the feature flag and archiving the label named Brische:

Before After
before after

How to set up and validate locally

  1. Enable feature flag with rails c:
     Feature.enable(:labels_archive)
  2. Archive a label: Go to Any project > Manage > Labels and edit a label in the three dot dropdown. Check the Archived checkbox and save the label.
  3. Now go to any issue in this project. In a comment, type /label ~ and wait for the auto-completion to show up. The archived label should now be hidden.
  4. Auto-completions are cached for three minutes - you can reduce the cache to a second by editing app/controllers/concerns/autocomplete_sources/expires_in.rb and setting AUTOCOMPLETE_EXPIRES_IN = 1.second

MR acceptance checklist

MR Checklist ( @nwittstruck)

Related to #554226 (closed)

Edited by Nicholas Wittstruck

Merge request reports

Loading