blob: 9173f5c771f727cfe4a77589ad2eb95391b90b49 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import Vue from 'vue';
export const initCommitPipelineMiniGraph = async (selector = '.js-commit-pipeline-mini-graph') => {
const el = document.querySelector(selector);
if (!el) {
return;
}
// Some commits have no pipeline, code splitting to load the pipeline optionally
const { stages } = el.dataset;
const { default: PipelineMiniGraph } = await import(
/* webpackChunkName: 'pipelineMiniGraph' */ '~/pipelines/components/pipelines_list/pipeline_mini_graph.vue'
);
// eslint-disable-next-line no-new
new Vue({
el,
render(createElement) {
return createElement(PipelineMiniGraph, {
props: {
stages: JSON.parse(stages),
},
});
},
});
};
|