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(
|
|
|
|
{},
|
|
|
|
{
|
2021-04-17 20:07:23 +05:30
|
|
|
useGet: true,
|
2021-02-22 17:27:13 +05:30
|
|
|
},
|
|
|
|
),
|
|
|
|
});
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
const createPipelinesDetailApp = (
|
|
|
|
selector,
|
|
|
|
{ pipelineProjectPath, pipelineIid, metricsPath, graphqlResourceEtag } = {},
|
|
|
|
) => {
|
2021-02-22 17:27:13 +05:30
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el: selector,
|
|
|
|
components: {
|
|
|
|
PipelineGraphWrapper,
|
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
2021-04-17 20:07:23 +05:30
|
|
|
metricsPath,
|
2021-02-22 17:27:13 +05:30
|
|
|
pipelineProjectPath,
|
|
|
|
pipelineIid,
|
2021-04-17 20:07:23 +05:30
|
|
|
graphqlResourceEtag,
|
2021-02-22 17:27:13 +05:30
|
|
|
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 };
|