2020-10-24 23:57:45 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
|
|
|
import Dag from './components/dag/dag.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: createDefaultClient(),
|
|
|
|
});
|
|
|
|
|
|
|
|
const createDagApp = () => {
|
2021-01-29 00:20:46 +05:30
|
|
|
const el = document.querySelector('#js-pipeline-dag-vue');
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
if (!el) {
|
2020-10-24 23:57:45 +05:30
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
const {
|
|
|
|
aboutDagDocPath,
|
|
|
|
dagDocPath,
|
|
|
|
emptySvgPath,
|
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
|
|
|
} = el?.dataset;
|
2020-10-24 23:57:45 +05:30
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
|
|
|
Dag,
|
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
2021-01-29 00:20:46 +05:30
|
|
|
aboutDagDocPath,
|
|
|
|
dagDocPath,
|
|
|
|
emptySvgPath,
|
2020-10-24 23:57:45 +05:30
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('dag', {});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export default createDagApp;
|