2021-01-03 14:25:43 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import pipelineHeader from './components/header_component.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
export const createPipelineHeaderApp = (elSelector, apolloProvider, graphqlResourceEtag) => {
|
2021-01-03 14:25:43 +05:30
|
|
|
const el = document.querySelector(elSelector);
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
const { fullPath, pipelineId, pipelineIid, pipelinesPath } = el?.dataset;
|
2021-01-03 14:25:43 +05:30
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
|
|
|
pipelineHeader,
|
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
|
|
|
paths: {
|
|
|
|
fullProject: fullPath,
|
2021-04-29 21:17:54 +05:30
|
|
|
graphqlResourceEtag,
|
2021-01-29 00:20:46 +05:30
|
|
|
pipelinesPath,
|
2021-01-03 14:25:43 +05:30
|
|
|
},
|
|
|
|
pipelineId,
|
|
|
|
pipelineIid,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('pipeline-header', {});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|