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

pipeline_url.vue « pipelines_list « components « pipelines « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2905b2ca26fc358b4368f0b6a2559fd2c95e9d3e (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<script>
import { GlLink, GlTooltipDirective } from '@gitlab/ui';
import { escape } from 'lodash';
import { SCHEDULE_ORIGIN } from '../../constants';
import { __, sprintf } from '~/locale';
import popover from '~/vue_shared/directives/popover';

const popoverTitle = sprintf(
  escape(
    __(
      `This pipeline makes use of a predefined CI/CD configuration enabled by %{strongStart}Auto DevOps.%{strongEnd}`,
    ),
  ),
  { strongStart: '<b>', strongEnd: '</b>' },
  false,
);

export default {
  components: {
    GlLink,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
    popover,
  },
  props: {
    pipeline: {
      type: Object,
      required: true,
    },
    pipelineScheduleUrl: {
      type: String,
      required: true,
    },
    autoDevopsHelpPath: {
      type: String,
      required: true,
    },
  },
  computed: {
    user() {
      return this.pipeline.user;
    },
    isScheduled() {
      return this.pipeline.source === SCHEDULE_ORIGIN;
    },
    popoverOptions() {
      return {
        html: true,
        trigger: 'focus',
        placement: 'top',
        title: `<div class="autodevops-title">
            ${popoverTitle}
          </div>`,
        content: `<a
            class="autodevops-link"
            href="${this.autoDevopsHelpPath}"
            target="_blank"
            rel="noopener noreferrer nofollow">
            ${escape(__('Learn more about Auto DevOps'))}
          </a>`,
      };
    },
  },
};
</script>
<template>
  <div class="table-section section-10 d-none d-sm-none d-md-block pipeline-tags">
    <gl-link
      :href="pipeline.path"
      class="js-pipeline-url-link js-onboarding-pipeline-item"
      data-testid="pipeline-url-link"
      data-qa-selector="pipeline_url_link"
    >
      <span class="pipeline-id">#{{ pipeline.id }}</span>
    </gl-link>
    <div class="label-container">
      <gl-link v-if="isScheduled" :href="pipelineScheduleUrl" target="__blank">
        <span
          v-gl-tooltip
          :title="__('This pipeline was triggered by a schedule.')"
          class="badge badge-info"
          data-testid="pipeline-url-scheduled"
        >
          {{ __('Scheduled') }}
        </span>
      </gl-link>
      <span
        v-if="pipeline.flags.latest"
        v-gl-tooltip
        :title="__('Latest pipeline for the most recent commit on this branch')"
        class="js-pipeline-url-latest badge badge-success"
        data-testid="pipeline-url-latest"
      >
        {{ __('latest') }}
      </span>
      <span
        v-if="pipeline.flags.yaml_errors"
        v-gl-tooltip
        :title="pipeline.yaml_errors"
        class="js-pipeline-url-yaml badge badge-danger"
        data-testid="pipeline-url-yaml"
      >
        {{ __('yaml invalid') }}
      </span>
      <span
        v-if="pipeline.flags.failure_reason"
        v-gl-tooltip
        :title="pipeline.failure_reason"
        class="js-pipeline-url-failure badge badge-danger"
        data-testid="pipeline-url-failure"
      >
        {{ __('error') }}
      </span>
      <gl-link
        v-if="pipeline.flags.auto_devops"
        v-popover="popoverOptions"
        tabindex="0"
        class="js-pipeline-url-autodevops badge badge-info autodevops-badge"
        data-testid="pipeline-url-autodevops"
        role="button"
        >{{ __('Auto DevOps') }}</gl-link
      >
      <span
        v-if="pipeline.flags.stuck"
        class="js-pipeline-url-stuck badge badge-warning"
        data-testid="pipeline-url-stuck"
      >
        {{ __('stuck') }}
      </span>
      <span
        v-if="pipeline.flags.detached_merge_request_pipeline"
        v-gl-tooltip
        :title="
          __(
            'Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more in the documentation for Pipelines for Merged Results.',
          )
        "
        class="js-pipeline-url-detached badge badge-info"
        data-testid="pipeline-url-detached"
      >
        {{ __('detached') }}
      </span>
    </div>
  </div>
</template>