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
|
<script>
import { GlLink, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import delayedJobMixin from '~/ci/mixins/delayed_job_mixin';
import { sprintf } from '~/locale';
import CiIcon from '~/vue_shared/components/ci_icon/ci_icon.vue';
export default {
components: {
CiIcon,
GlIcon,
GlLink,
},
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [delayedJobMixin],
props: {
job: {
type: Object,
required: true,
},
isActive: {
type: Boolean,
required: true,
},
},
computed: {
tooltipText() {
const { name, status } = this.job;
const text = `${name} - ${status.tooltip}`;
if (this.isDelayedJob) {
return sprintf(text, { remainingTime: this.remainingTime });
}
return text;
},
jobName() {
return this.job.name ? this.job.name : this.job.id;
},
classes() {
return {
'retried gl-text-secondary': this.job.retried,
'gl-font-weight-bold': this.isActive,
};
},
dataTestId() {
return this.isActive ? 'active-job' : null;
},
},
};
</script>
<template>
<div class="build-job gl-relative" :class="classes">
<gl-link
v-gl-tooltip.left.viewport
:href="job.status.details_path"
:title="tooltipText"
class="gl-display-flex gl-align-items-center gl-py-3 gl-pl-7"
:data-testid="dataTestId"
>
<gl-icon
v-if="isActive"
name="arrow-right"
:show-tooltip="false"
class="icon-arrow-right gl-absolute gl-display-block"
/>
<ci-icon :status="job.status" :show-tooltip="false" class="gl-mr-3" />
<span class="gl-text-truncate gl-w-full">{{ jobName }}</span>
<gl-icon v-if="job.retried" name="retry" class="gl-mr-4" />
</gl-link>
</div>
</template>
|