debian-mirror-gitlab/app/assets/javascripts/pipelines/pipeline_details_header.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
779 B
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
2022-10-11 01:57:18 +05:30
import PipelineHeader from './components/header_component.vue';
2021-01-03 14:25:43 +05:30
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;
}
2022-07-16 23:28:13 +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: {
2022-10-11 01:57:18 +05:30
PipelineHeader,
2021-01-03 14:25:43 +05:30
},
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', {});
},
});
};