Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pipeline_editor_mini_graph.vue « header « components « pipeline_editor « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 75b1398a3c260c8247c18630ec421d64afd8c2a9 (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
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>