2020-09-23 14:10:15 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import pipelineHeader from './components/header_component.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2021-03-16 05:11:17 -04:00
|
|
|
export const createPipelineHeaderApp = (elSelector, apolloProvider, graphqlResourceEtag) => {
|
2020-09-23 14:10:15 -04:00
|
|
|
const el = document.querySelector(elSelector);
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-11-09 19:08:52 -05:00
|
|
|
const { fullPath, pipelineId, pipelineIid, pipelinesPath } = el?.dataset;
|
2020-09-23 14:10:15 -04:00
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
|
|
|
pipelineHeader,
|
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
|
|
|
paths: {
|
|
|
|
fullProject: fullPath,
|
2021-03-16 05:11:17 -04:00
|
|
|
graphqlResourceEtag,
|
2020-11-09 19:08:52 -05:00
|
|
|
pipelinesPath,
|
2020-09-23 14:10:15 -04:00
|
|
|
},
|
|
|
|
pipelineId,
|
|
|
|
pipelineIid,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('pipeline-header', {});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|