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