2020-09-23 14:10:15 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
2022-08-25 08:12:20 -04:00
|
|
|
import PipelineHeader from './components/header_component.vue';
|
2020-09-23 14:10:15 -04:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2022-05-16 14:09:11 -04: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: {
|
2022-08-25 08:12:20 -04:00
|
|
|
PipelineHeader,
|
2020-09-23 14:10:15 -04:00
|
|
|
},
|
|
|
|
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', {});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|