2020-08-18 14:10:10 -04:00
|
|
|
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 = () => {
|
2020-11-12 13:09:26 -05:00
|
|
|
const el = document.querySelector('#js-pipeline-dag-vue');
|
|
|
|
|
2021-01-22 16:09:10 -05:00
|
|
|
if (!el) {
|
2020-08-18 14:10:10 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-11-16 13:09:15 -05:00
|
|
|
const {
|
|
|
|
aboutDagDocPath,
|
|
|
|
dagDocPath,
|
|
|
|
emptySvgPath,
|
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
|
|
|
} = el?.dataset;
|
2020-08-18 14:10:10 -04:00
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
|
|
|
Dag,
|
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
2020-11-16 13:09:15 -05:00
|
|
|
aboutDagDocPath,
|
|
|
|
dagDocPath,
|
|
|
|
emptySvgPath,
|
2020-08-18 14:10:10 -04:00
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('dag', {});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export default createDagApp;
|