Work items labels widget with edit button
What does this MR do and why?
This MR changes the labels widget behaviour as per Edit pattern if work_items_mvc_2
is turned on.
Similar MRs:
Add edit button to work item weight widget (!136789 - merged)
Add edit to work item assignees (!140846 - merged)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Apart from above, the component in the MR should cover:
- In read state, list current labels as labels with clear button.
- Clicking a label opens the issue or epic list (depending on work item type) filtered by the label.
- Clicking the clear button removes the label immediately and does not initiate edit mode.
- When "Edit" is pressed, the list of labels is replaced by the label input.
- Clicking outside of the input, pressing Escape, or clicking "Apply", returns to read state with selected labels shown.
- A loading spinner is shown with the label during transition from Edit to Read states.
Screenshots or screen recordings
Screen Recording 2024-02-13 at 6.36.02 PM.mov
How to set up and validate locally
Prerequisites:
- Enable the OKRs feature as mentioned in the OKRs docs (e.g.
::Feature.enabled?(:okrs_mvc, Project.find(<PROJECT_ID>))
and the namespace must have Ultimate plan). - Enable
::Feature.enabled?(:work_items_mvc_2, Project.find(<PROJECT_ID>))
Steps to verify:
- Login with any user
- Go to any Project > Issues > List
- Create an new Objective under New issue split button
- Go to Objective detail page
- Interact with the
Label
widget.
In addition to above flow, it also affects the Key results and Tasks feature.
For Key results/Tasks:
- Add a Key result/Task as mention Add a key result docs/Add a Task docs under an Objective/Issue
- Open the Key result/Task
- Interact with the
Label
widget to check if the sidebar is not shifted.
Related to #429134 (closed)
Edited by Rajan Mistry