2020-08-18 18:10:10 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import Dag from './components/dag/dag.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2021-03-16 09:11:17 +00:00
|
|
|
const createDagApp = (apolloProvider) => {
|
2020-11-12 18:09:26 +00:00
|
|
|
const el = document.querySelector('#js-pipeline-dag-vue');
|
|
|
|
|
2021-01-22 21:09:10 +00:00
|
|
|
if (!el) {
|
2020-08-18 18:10:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-11-16 18:09:15 +00:00
|
|
|
const {
|
|
|
|
aboutDagDocPath,
|
|
|
|
dagDocPath,
|
|
|
|
emptySvgPath,
|
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
|
|
|
} = el?.dataset;
|
2020-08-18 18:10:10 +00:00
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
|
|
|
Dag,
|
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
2020-11-16 18:09:15 +00:00
|
|
|
aboutDagDocPath,
|
|
|
|
dagDocPath,
|
|
|
|
emptySvgPath,
|
2020-08-18 18:10:10 +00:00
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('dag', {});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export default createDagApp;
|