2021-01-13 07:10:27 -05:00
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import KeepLatestArtifactCheckbox from '~/artifacts_settings/keep_latest_artifact_checkbox.vue';
|
2021-02-14 13:09:20 -05:00
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2021-01-13 07:10:27 -05:00
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
2021-11-01 08:11:46 -04:00
|
|
|
defaultClient: createDefaultClient(),
|
2021-01-13 07:10:27 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
export default (containerId = 'js-artifacts-settings-app') => {
|
|
|
|
const containerEl = document.getElementById(containerId);
|
|
|
|
|
|
|
|
if (!containerEl) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
const { fullPath, helpPagePath } = containerEl.dataset;
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el: containerEl,
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
|
|
|
fullPath,
|
|
|
|
helpPagePath,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(KeepLatestArtifactCheckbox);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|