1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
import Vue from 'vue';
import { GlToast } from '@gitlab/ui';
import { apolloProvider } from '~/graphql_shared/issuable_client';
import WorkItemLinks from './work_item_links.vue';
Vue.use(GlToast);
export default function initWorkItemLinks() {
const workItemLinksRoot = document.querySelector('.js-work-item-links-root');
if (!workItemLinksRoot) {
return null;
}
const {
fullPath,
wiHasIssueWeightsFeature,
wiHasIterationsFeature,
wiHasIssuableHealthStatusFeature,
registerPath,
signInPath,
wiReportAbusePath,
} = workItemLinksRoot.dataset;
return new Vue({
el: workItemLinksRoot,
name: 'WorkItemLinksRoot',
apolloProvider,
components: {
WorkItemLinks,
},
provide: {
fullPath,
hasIssueWeightsFeature: wiHasIssueWeightsFeature,
hasIterationsFeature: wiHasIterationsFeature,
hasIssuableHealthStatusFeature: wiHasIssuableHealthStatusFeature,
registerPath,
signInPath,
reportAbusePath: wiReportAbusePath,
},
render: (createElement) =>
createElement('work-item-links', {
props: {
issuableId: parseInt(workItemLinksRoot.dataset.issuableId, 10),
},
}),
});
}
|