Commit 42649c60 authored by Mike Greiling's avatar Mike Greiling

Merge branch '228847-clicking-on-label-in-issues-list-does-not-filter-by-label' into 'master'

Change label link for Jira issues

Closes #228847

See merge request gitlab-org/gitlab!36818
parents a43dbc2f a4284e32
......@@ -187,6 +187,10 @@ export default {
return isScopedLabel({ title: name }) && this.scopedLabelsAvailable;
},
labelHref({ name }) {
if (this.isJiraIssue) {
return this.issuableLink({ 'labels[]': name });
}
return this.issuableLink({ 'label_name[]': name });
},
onSelect(ev) {
......
......@@ -333,6 +333,33 @@ describe('Issuable component', () => {
});
});
describe('with labels for Jira issuable', () => {
beforeEach(() => {
issuable.labels = [...testLabels];
issuable.external_tracker = 'jira';
factory({ issuable });
});
it('renders labels', () => {
factory({ issuable });
const labels = findLabels().wrappers.map(label => ({
href: label.props('target'),
text: label.text(),
tooltip: label.attributes('description'),
}));
const expected = testLabels.map(label => ({
href: mergeUrlParams({ 'labels[]': label.name }, TEST_BASE_URL),
text: label.name,
tooltip: label.description,
}));
expect(labels).toEqual(expected);
});
});
describe.each`
weight
${0}
......
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