Repository navigation
fix(tracker): template labels stay removable and cannot be added twice - #11073
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
EditIssueTemplate only queried the label elements while the template had labels, and on removing the last one it unsubscribed without clearing the cached list. The panel kept showing the removed label as selected, so it could not be removed again and re-selecting it pushed it back. Clear the cached labels when the template has none. Add duplicate guards to the template control panel $push, the create-template draft list and the generic Tags editor. Issue label editing (TagsEditorPopup, ObjectsTagsEditorPopup) already skips tags that are attached, so for issues the scenario from hcengineering#6916 was already covered; this extends the guard to the remaining paths. Fixes hcengineering#7345 Refs hcengineering#6916 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7345
Refs #6916
Problem
In the issue template panel, removing the last label kept it displayed as selected:
EditIssueTemplatestopped the label query when the template had no labels but did not clear the cached list. The label could then not be removed again, and re-selecting it pushed it back.Changes
$push, the create-template draft list and the genericTagseditor. Issue label editing (TagsEditorPopup,ObjectsTagsEditorPopup) already had such a guard, so the issue case from Duplicate labels should be prevented #6916 was already covered.Tests
Svelte wiring only (4 lines). Manual: open a template, add one label, remove it, reopen the label popup (unselected, count gone), add it again (counted once).