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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<script>
import PipelineMiniGraph from '~/pipelines/components/pipelines_list/pipeline_mini_graph.vue';
export default {
components: {
PipelineMiniGraph,
},
props: {
pipeline: {
type: Object,
required: true,
},
},
computed: {
pipelinePath() {
return this.pipeline.detailedStatus?.detailsPath || '';
},
pipelineStages() {
const stages = this.pipeline.stages?.edges;
if (!stages) {
return [];
}
return stages.map(({ node }) => {
const { name, detailedStatus } = node;
return {
// TODO: fetch dropdown_path from graphql when available
// see https://gitlab.com/gitlab-org/gitlab/-/issues/342585
dropdown_path: `${this.pipelinePath}/stage.json?stage=${name}`,
name,
path: `${this.pipelinePath}#${name}`,
status: {
details_path: `${this.pipelinePath}#${name}`,
has_details: detailedStatus.hasDetails,
...detailedStatus,
},
title: `${name}: ${detailedStatus.text}`,
};
});
},
},
};
</script>
<template>
<div v-if="pipelineStages.length > 0" class="stage-cell gl-mr-5">
<pipeline-mini-graph class="gl-display-inline" :stages="pipelineStages" />
</div>
</template>
|