Skip to content

fix(tracker): template labels stay removable and cannot be added twice - #11073

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/template-labels
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/template-labels

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #7345
Refs #6916

Problem

In the issue template panel, removing the last label kept it displayed as selected: EditIssueTemplate stopped 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

  • Clear the cached labels when the template has none.
  • Add duplicate guards where a label is added without one: the template control panel $push, the create-template draft list and the generic Tags editor. 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).

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template labels bug

1 participant