2021-02-22 17:27:13 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
|
|
|
import { GRAPHQL } from './components/graph/constants';
|
2021-03-11 19:13:27 +05:30
|
|
|
import PipelineGraphWrapper from './components/graph/graph_component_wrapper.vue';
|
2021-03-08 18:12:59 +05:30
|
|
|
import { reportToSentry } from './components/graph/utils';
|
2021-02-22 17:27:13 +05:30
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: createDefaultClient(
|
|
|
|
{},
|
|
|
|
{
|
|
|
|
batchMax: 2,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
});
|
|
|
|
|
|
|
|
const createPipelinesDetailApp = (selector, pipelineProjectPath, pipelineIid) => {
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el: selector,
|
|
|
|
components: {
|
|
|
|
PipelineGraphWrapper,
|
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
|
|
|
dataMethod: GRAPHQL,
|
|
|
|
},
|
2021-03-08 18:12:59 +05:30
|
|
|
errorCaptured(err, _vm, info) {
|
|
|
|
reportToSentry('pipeline_details_graph', `error: ${err}, info: ${info}`);
|
|
|
|
},
|
2021-02-22 17:27:13 +05:30
|
|
|
render(createElement) {
|
|
|
|
return createElement(PipelineGraphWrapper);
|
|
|
|
},
|
|
|
|
});
|
2021-01-29 00:20:46 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
export { createPipelinesDetailApp };
|