Commit f2062bc0 authored by Justin Ho's avatar Justin Ho

Change param name used for labels filtering

The default param of `label_name` can now be customized
and we now use just `labels` as this is what the backend
for Jira issues list expects.
parent 149caf6b
......@@ -21,11 +21,14 @@ export default {
'allowLabelRemove',
'allowScopedLabels',
'labelsFilterBasePath',
'labelsFilterParam',
]),
},
methods: {
labelFilterUrl(label) {
return `${this.labelsFilterBasePath}?label_name[]=${encodeURIComponent(label.title)}`;
return `${this.labelsFilterBasePath}?${this.labelsFilterParam}[]=${encodeURIComponent(
label.title,
)}`;
},
scopedLabel(label) {
return this.allowScopedLabels && isScopedLabel(label);
......
......@@ -81,6 +81,11 @@ export default {
required: false,
default: '',
},
labelsFilterParam: {
type: String,
required: false,
default: 'label_name',
},
dropdownButtonText: {
type: String,
required: false,
......@@ -156,6 +161,7 @@ export default {
labelsFetchPath: this.labelsFetchPath,
labelsManagePath: this.labelsManagePath,
labelsFilterBasePath: this.labelsFilterBasePath,
labelsFilterParam: this.labelsFilterParam,
labelsListTitle: this.labelsListTitle,
labelsCreateTitle: this.labelsCreateTitle,
footerCreateLabelTitle: this.footerCreateLabelTitle,
......
<script>
import { labelsFilterParam } from 'ee/integrations/jira/issues_show/constants';
import LabelsSelect from '~/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue';
import Assignee from './assignee.vue';
......@@ -29,6 +31,7 @@ export default {
return (this.issue?.assignees || [])[0];
},
},
labelsFilterParam,
};
</script>
......@@ -39,6 +42,7 @@ export default {
<labels-select
:selected-labels="issue.labels"
:labels-filter-base-path="issuesListPath"
:labels-filter-param="$options.labelsFilterParam"
variant="sidebar"
class="block labels js-labels-block"
>
......
......@@ -9,3 +9,5 @@ export const issueStateLabels = {
[issueStates.OPENED]: __('Open'),
[issueStates.CLOSED]: __('Closed'),
};
export const labelsFilterParam = 'labels';
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