2020-09-18 00:09:39 +00:00
|
|
|
import Vue from 'vue';
|
2020-10-06 06:08:38 +00:00
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2020-11-27 12:09:14 +00:00
|
|
|
import { resolvers } from '~/pipeline_editor/graphql/resolvers';
|
|
|
|
|
2020-10-06 06:08:38 +00:00
|
|
|
import CiLint from './components/ci_lint.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
2021-11-01 12:11:46 +00:00
|
|
|
defaultClient: createDefaultClient(resolvers),
|
2020-10-06 06:08:38 +00:00
|
|
|
});
|
2020-09-18 00:09:39 +00:00
|
|
|
|
|
|
|
export default (containerId = '#js-ci-lint') => {
|
|
|
|
const containerEl = document.querySelector(containerId);
|
2020-11-13 15:09:24 +00:00
|
|
|
const { endpoint, lintHelpPagePath, pipelineSimulationHelpPagePath } = containerEl.dataset;
|
2020-09-18 00:09:39 +00:00
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el: containerEl,
|
2020-10-06 06:08:38 +00:00
|
|
|
apolloProvider,
|
2020-09-18 00:09:39 +00:00
|
|
|
render(createElement) {
|
2020-10-06 06:08:38 +00:00
|
|
|
return createElement(CiLint, {
|
2020-09-18 00:09:39 +00:00
|
|
|
props: {
|
|
|
|
endpoint,
|
2020-11-13 15:09:24 +00:00
|
|
|
lintHelpPagePath,
|
|
|
|
pipelineSimulationHelpPagePath,
|
2020-09-18 00:09:39 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|