debian-mirror-gitlab/app/assets/javascripts/related_issues/index.js

31 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-11-24 15:15:51 +05:30
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import RelatedIssuesRoot from './components/related_issues_root.vue';
2022-07-23 23:45:48 +05:30
export default function initRelatedIssues(issueType = 'issue') {
2020-11-24 15:15:51 +05:30
const relatedIssuesRootElement = document.querySelector('.js-related-issues-root');
if (relatedIssuesRootElement) {
// eslint-disable-next-line no-new
new Vue({
el: relatedIssuesRootElement,
2022-04-04 11:22:00 +05:30
name: 'RelatedIssuesRoot',
2020-11-24 15:15:51 +05:30
components: {
relatedIssuesRoot: RelatedIssuesRoot,
},
2021-03-08 18:12:59 +05:30
render: (createElement) =>
2020-11-24 15:15:51 +05:30
createElement('related-issues-root', {
props: {
endpoint: relatedIssuesRootElement.dataset.endpoint,
canAdmin: parseBoolean(relatedIssuesRootElement.dataset.canAddRelatedIssues),
helpPath: relatedIssuesRootElement.dataset.helpPath,
showCategorizedIssues: parseBoolean(
relatedIssuesRootElement.dataset.showCategorizedIssues,
),
2022-07-23 23:45:48 +05:30
issuableType: issueType,
2022-05-07 20:08:51 +05:30
autoCompleteEpics: false,
2020-11-24 15:15:51 +05:30
},
}),
});
}
}