diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /app/assets/javascripts/related_issues/index.js | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'app/assets/javascripts/related_issues/index.js')
-rw-r--r-- | app/assets/javascripts/related_issues/index.js | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/app/assets/javascripts/related_issues/index.js b/app/assets/javascripts/related_issues/index.js index 655ec57bc3d..eb2f5d119b8 100644 --- a/app/assets/javascripts/related_issues/index.js +++ b/app/assets/javascripts/related_issues/index.js @@ -1,30 +1,33 @@ import Vue from 'vue'; +import apolloProvider from '~/issues/show/graphql'; import { parseBoolean } from '~/lib/utils/common_utils'; import RelatedIssuesRoot from './components/related_issues_root.vue'; -export default function initRelatedIssues(issueType = 'issue') { - const relatedIssuesRootElement = document.querySelector('.js-related-issues-root'); - if (relatedIssuesRootElement) { - // eslint-disable-next-line no-new - new Vue({ - el: relatedIssuesRootElement, - name: 'RelatedIssuesRoot', - components: { - relatedIssuesRoot: RelatedIssuesRoot, - }, - render: (createElement) => - createElement('related-issues-root', { - props: { - endpoint: relatedIssuesRootElement.dataset.endpoint, - canAdmin: parseBoolean(relatedIssuesRootElement.dataset.canAddRelatedIssues), - helpPath: relatedIssuesRootElement.dataset.helpPath, - showCategorizedIssues: parseBoolean( - relatedIssuesRootElement.dataset.showCategorizedIssues, - ), - issuableType: issueType, - autoCompleteEpics: false, - }, - }), - }); +export function initRelatedIssues(issueType = 'issue') { + const el = document.querySelector('.js-related-issues-root'); + + if (!el) { + return null; } + + return new Vue({ + el, + name: 'RelatedIssuesRoot', + apolloProvider, + provide: { + fullPath: el.dataset.fullPath, + hasIssueWeightsFeature: parseBoolean(el.dataset.hasIssueWeightsFeature), + }, + render: (createElement) => + createElement(RelatedIssuesRoot, { + props: { + endpoint: el.dataset.endpoint, + canAdmin: parseBoolean(el.dataset.canAddRelatedIssues), + helpPath: el.dataset.helpPath, + showCategorizedIssues: parseBoolean(el.dataset.showCategorizedIssues), + issuableType: issueType, + autoCompleteEpics: false, + }, + }), + }); } |