2020-11-24 15:15:51 +05:30
|
|
|
import Vue from 'vue';
|
2023-04-23 21:23:45 +05:30
|
|
|
import { TYPE_ISSUE } from '~/issues/constants';
|
|
|
|
import { apolloProvider } from '~/graphql_shared/issuable_client';
|
2020-11-24 15:15:51 +05:30
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
|
|
|
import RelatedIssuesRoot from './components/related_issues_root.vue';
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
export function initRelatedIssues(issueType = TYPE_ISSUE) {
|
2022-08-27 11:52:29 +05:30
|
|
|
const el = document.querySelector('.js-related-issues-root');
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
2020-11-24 15:15:51 +05:30
|
|
|
}
|
2022-08-27 11:52:29 +05:30
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
name: 'RelatedIssuesRoot',
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
|
|
|
fullPath: el.dataset.fullPath,
|
|
|
|
hasIssueWeightsFeature: parseBoolean(el.dataset.hasIssueWeightsFeature),
|
2023-01-13 00:05:48 +05:30
|
|
|
hasIterationsFeature: parseBoolean(el.dataset.hasIterationsFeature),
|
2022-08-27 11:52:29 +05:30
|
|
|
},
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
});
|
2020-11-24 15:15:51 +05:30
|
|
|
}
|