debian-mirror-gitlab/app/assets/javascripts/ci_lint/index.js

32 lines
809 B
JavaScript
Raw Normal View History

2020-11-24 15:15:51 +05:30
import Vue from 'vue';
2021-01-03 14:25:43 +05:30
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2021-02-22 17:27:13 +05:30
import { resolvers } from '~/pipeline_editor/graphql/resolvers';
2021-01-03 14:25:43 +05:30
import CiLint from './components/ci_lint.vue';
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
2021-12-11 22:18:48 +05:30
defaultClient: createDefaultClient(resolvers),
2021-01-03 14:25:43 +05:30
});
2020-11-24 15:15:51 +05:30
export default (containerId = '#js-ci-lint') => {
const containerEl = document.querySelector(containerId);
2021-01-29 00:20:46 +05:30
const { endpoint, lintHelpPagePath, pipelineSimulationHelpPagePath } = containerEl.dataset;
2020-11-24 15:15:51 +05:30
return new Vue({
el: containerEl,
2021-01-03 14:25:43 +05:30
apolloProvider,
2020-11-24 15:15:51 +05:30
render(createElement) {
2021-01-03 14:25:43 +05:30
return createElement(CiLint, {
2020-11-24 15:15:51 +05:30
props: {
endpoint,
2021-01-29 00:20:46 +05:30
lintHelpPagePath,
pipelineSimulationHelpPagePath,
2020-11-24 15:15:51 +05:30
},
});
},
});
};