Commit 805a2f03 authored by Denys Mishunov's avatar Denys Mishunov

Merge branch '341121-fix-sidebar-labels-bug' into 'master'

Fix sidebar labels scoped label selection bug

See merge request gitlab-org/gitlab!72111
parents f4c17faa 529c70f1
......@@ -69,7 +69,8 @@ export default {
if (isScopedLabel(candidateLabel)) {
const scopedKeyWithDelimiter = `${scopedLabelKey(candidateLabel)}${SCOPED_LABEL_DELIMITER}`;
const currentActiveScopedLabel = state.labels.find(
({ title }) => title.startsWith(scopedKeyWithDelimiter) && title !== candidateLabel.title,
({ set, title }) =>
set && title.startsWith(scopedKeyWithDelimiter) && title !== candidateLabel.title,
);
if (currentActiveScopedLabel) {
......
......@@ -159,8 +159,9 @@ describe('LabelsSelect Mutations', () => {
labels = [
{ id: 1, title: 'scoped' },
{ id: 2, title: 'scoped::one', set: false },
{ id: 3, title: 'scoped::test', set: true },
{ id: 4, title: '' },
{ id: 3, title: 'scoped::two', set: false },
{ id: 4, title: 'scoped::three', set: true },
{ id: 5, title: '' },
];
});
......@@ -191,8 +192,9 @@ describe('LabelsSelect Mutations', () => {
expect(state.labels).toEqual([
{ id: 1, title: 'scoped' },
{ id: 2, title: 'scoped::one', set: true, touched: true },
{ id: 3, title: 'scoped::test', set: false },
{ id: 4, title: '' },
{ id: 3, title: 'scoped::two', set: false },
{ id: 4, title: 'scoped::three', set: false },
{ id: 5, title: '' },
]);
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment