summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/cycle_analytics/components/stage_test_component.vue
blob: a8196dc879a33c791201ee347bca0072b558f202 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<script>
import iconBuildStatus from '../svg/icon_build_status.svg';
import iconBranch from '../svg/icon_branch.svg';
import limitWarning from './limit_warning_component.vue';
import totalTime from './total_time_component.vue';
import icon from '../../vue_shared/components/icon.vue';

export default {
  components: {
    totalTime,
    limitWarning,
    icon,
  },
  props: {
    items: {
      type: Array,
      default: () => [],
    },
    stage: {
      type: Object,
      default: () => ({}),
    },
  },
  computed: {
    iconBuildStatus() {
      return iconBuildStatus;
    },
    iconBranch() {
      return iconBranch;
    },
  },
};
</script>
<template>
  <div>
    <div class="events-description">
      {{ stage.description }}
      <limit-warning :count="items.length" />
    </div>
    <ul class="stage-event-list">
      <li
        v-for="(build, i) in items"
        :key="i"
        class="stage-event-item item-build-component"
      >
        <div class="item-details">
          <h5 class="item-title">
            <span
              class="icon-build-status"
              v-html="iconBuildStatus"
            >
            </span>
            <a
              :href="build.url"
              class="item-build-name"
            >
              {{ build.name }}
            </a>
            &middot;
            <a
              :href="build.url"
              class="pipeline-id"
            >
              #{{ build.id }}
            </a>
            <icon
              :size="16"
              name="fork"
            />
            <a
              :href="build.branch.url"
              class="ref-name"
            >
              {{ build.branch.name }}
            </a>
            <span
              class="icon-branch"
              v-html="iconBranch"
            >
            </span>
            <a
              :href="build.commitUrl"
              class="commit-sha">
              {{ build.shortSha }}
            </a>
          </h5>
          <span>
            <a
              :href="build.url"
              class="issue-date">
              {{ build.date }}
            </a>
          </span>
        </div>
        <div class="item-time">
          <total-time :time="build.totalTime" />
        </div>
      </li>
    </ul>
  </div>
</template>