2021-09-08 02:10:46 -04:00
|
|
|
import Vue from 'vue';
|
2022-06-02 08:09:21 -04:00
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2022-08-18 11:12:17 -04:00
|
|
|
import { apolloProvider } from '~/graphql_shared/issuable_client';
|
2021-09-08 02:10:46 -04:00
|
|
|
import App from './components/app.vue';
|
2021-10-19 08:12:07 -04:00
|
|
|
import { createRouter } from './router';
|
2021-09-08 02:10:46 -04:00
|
|
|
|
|
|
|
export const initWorkItemsRoot = () => {
|
|
|
|
const el = document.querySelector('#js-work-items');
|
2022-06-02 08:09:21 -04:00
|
|
|
const { fullPath, hasIssueWeightsFeature, issuesListPath } = el.dataset;
|
2021-09-08 02:10:46 -04:00
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
2022-06-30 08:09:03 -04:00
|
|
|
name: 'WorkItemsRoot',
|
2021-10-19 08:12:07 -04:00
|
|
|
router: createRouter(el.dataset.fullPath),
|
2022-08-18 11:12:17 -04:00
|
|
|
apolloProvider,
|
2022-02-09 13:16:19 -05:00
|
|
|
provide: {
|
|
|
|
fullPath,
|
2022-06-02 08:09:21 -04:00
|
|
|
hasIssueWeightsFeature: parseBoolean(hasIssueWeightsFeature),
|
2022-05-11 11:07:26 -04:00
|
|
|
issuesListPath,
|
2022-02-09 13:16:19 -05:00
|
|
|
},
|
2021-09-08 02:10:46 -04:00
|
|
|
render(createElement) {
|
|
|
|
return createElement(App);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|