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

40 lines
845 B
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import pipelineHeader from './components/header_component.vue';
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
export const createPipelineHeaderApp = elSelector => {
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-01-29 00:20:46 +05:30
pipelinesPath,
2021-01-03 14:25:43 +05:30
},
pipelineId,
pipelineIid,
},
render(createElement) {
return createElement('pipeline-header', {});
},
});
};