Prevent sending a labels update mutation if labels list is not changed
requested to merge 340813-prevent-sending-a-labels-update-mutation-if-labels-list-is-not-changed into master
What does this MR do and why?
This MR serves as a follow-up for a few issues reported for labels dropdown refactoring:
- we introduce
isDirty
state for labels, so we don't send a mutation to server when user hasn't interacted with labels; - this MR fixes a dropdown opening on embedded view (previously we called
$refs.dropdown.show
on component mount; now we are watching the visibility state of sidebar editable widget) - we prevent fetching labels until the dropdown is visible
Screenshots or screen recordings
No visual changes
How to setup and validate locally
- Enable the Labels widget FF
Feature.enable(:labels_widget)
- Open Group -> Epics list
- Click on `New Epic button
- Make sure labels dropdown does not appear on page render
- Open the Issue view
- Open labels dropdown on the sidebar and close it without changing labels
- Make sure there is no GraphQL call
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #340813 (closed)
Edited by Natalia Tepluhina