Commit d2819ea4 authored by Justin Ho's avatar Justin Ho

Pass labels path and feature flag to frontend

Allow labels to be edited when feature flag is enabled
parent 07c08220
...@@ -19,6 +19,9 @@ export default { ...@@ -19,6 +19,9 @@ export default {
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
inject: { inject: {
issueLabelsPath: {
default: null,
},
issuesListPath: { issuesListPath: {
default: null, default: null,
}, },
...@@ -56,6 +59,9 @@ export default { ...@@ -56,6 +59,9 @@ export default {
reference() { reference() {
return this.issue.references?.relative; return this.issue.references?.relative;
}, },
canUpdateLabels() {
return this.glFeatures.jiraIssueDetailsEditLabels;
},
canUpdateStatus() { canUpdateStatus() {
return this.glFeatures.jiraIssueDetailsEditStatus; return this.glFeatures.jiraIssueDetailsEditStatus;
}, },
...@@ -122,7 +128,10 @@ export default { ...@@ -122,7 +128,10 @@ export default {
@issue-field-updated="onIssueStatusUpdated" @issue-field-updated="onIssueStatusUpdated"
/> />
<labels-select <labels-select
:allow-label-edit="canUpdateLabels"
:allow-multiselect="true"
:selected-labels="issue.labels" :selected-labels="issue.labels"
:labels-fetch-path="issueLabelsPath"
:labels-filter-base-path="issuesListPath" :labels-filter-base-path="issuesListPath"
:labels-filter-param="$options.labelsFilterParam" :labels-filter-param="$options.labelsFilterParam"
variant="sidebar" variant="sidebar"
......
...@@ -9,11 +9,12 @@ export default function initJiraIssueShow({ mountPointSelector }) { ...@@ -9,11 +9,12 @@ export default function initJiraIssueShow({ mountPointSelector }) {
return null; return null;
} }
const { issuesShowPath, issuesListPath } = mountPointEl.dataset; const { issueLabelsPath, issuesShowPath, issuesListPath } = mountPointEl.dataset;
return new Vue({ return new Vue({
el: mountPointEl, el: mountPointEl,
provide: { provide: {
issueLabelsPath,
issuesShowPath, issuesShowPath,
issuesListPath, issuesListPath,
}, },
......
...@@ -53,6 +53,7 @@ module EE ...@@ -53,6 +53,7 @@ module EE
def jira_issues_show_data def jira_issues_show_data
{ {
issue_labels_path: labels_project_integrations_jira_issue_path(@project, params[:id]),
issues_show_path: project_integrations_jira_issue_path(@project, params[:id], format: :json), issues_show_path: project_integrations_jira_issue_path(@project, params[:id], format: :json),
issues_list_path: project_integrations_jira_issues_path(@project) issues_list_path: project_integrations_jira_issues_path(@project)
} }
......
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