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 { ...@@ -21,11 +21,14 @@ export default {
'allowLabelRemove', 'allowLabelRemove',
'allowScopedLabels', 'allowScopedLabels',
'labelsFilterBasePath', 'labelsFilterBasePath',
'labelsFilterParam',
]), ]),
}, },
methods: { methods: {
labelFilterUrl(label) { labelFilterUrl(label) {
return `${this.labelsFilterBasePath}?label_name[]=${encodeURIComponent(label.title)}`; return `${this.labelsFilterBasePath}?${this.labelsFilterParam}[]=${encodeURIComponent(
label.title,
)}`;
}, },
scopedLabel(label) { scopedLabel(label) {
return this.allowScopedLabels && isScopedLabel(label); return this.allowScopedLabels && isScopedLabel(label);
......
...@@ -81,6 +81,11 @@ export default { ...@@ -81,6 +81,11 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
labelsFilterParam: {
type: String,
required: false,
default: 'label_name',
},
dropdownButtonText: { dropdownButtonText: {
type: String, type: String,
required: false, required: false,
...@@ -156,6 +161,7 @@ export default { ...@@ -156,6 +161,7 @@ export default {
labelsFetchPath: this.labelsFetchPath, labelsFetchPath: this.labelsFetchPath,
labelsManagePath: this.labelsManagePath, labelsManagePath: this.labelsManagePath,
labelsFilterBasePath: this.labelsFilterBasePath, labelsFilterBasePath: this.labelsFilterBasePath,
labelsFilterParam: this.labelsFilterParam,
labelsListTitle: this.labelsListTitle, labelsListTitle: this.labelsListTitle,
labelsCreateTitle: this.labelsCreateTitle, labelsCreateTitle: this.labelsCreateTitle,
footerCreateLabelTitle: this.footerCreateLabelTitle, footerCreateLabelTitle: this.footerCreateLabelTitle,
......
<script> <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 LabelsSelect from '~/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue';
import Assignee from './assignee.vue'; import Assignee from './assignee.vue';
...@@ -29,6 +31,7 @@ export default { ...@@ -29,6 +31,7 @@ export default {
return (this.issue?.assignees || [])[0]; return (this.issue?.assignees || [])[0];
}, },
}, },
labelsFilterParam,
}; };
</script> </script>
...@@ -39,6 +42,7 @@ export default { ...@@ -39,6 +42,7 @@ export default {
<labels-select <labels-select
:selected-labels="issue.labels" :selected-labels="issue.labels"
:labels-filter-base-path="issuesListPath" :labels-filter-base-path="issuesListPath"
:labels-filter-param="$options.labelsFilterParam"
variant="sidebar" variant="sidebar"
class="block labels js-labels-block" class="block labels js-labels-block"
> >
......
...@@ -9,3 +9,5 @@ export const issueStateLabels = { ...@@ -9,3 +9,5 @@ export const issueStateLabels = {
[issueStates.OPENED]: __('Open'), [issueStates.OPENED]: __('Open'),
[issueStates.CLOSED]: __('Closed'), [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