summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_pipelines_index/pipeline_url.js
blob: ae5649f0519d67e477c2e08633093bf200ddfb8b (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
/* global Vue, gl */
/* eslint-disable no-param-reassign */

((gl) => {
  gl.VuePipelineUrl = Vue.extend({
    props: [
      'pipeline',
    ],
    computed: {
      user() {
        return !!this.pipeline.user;
      },
    },
    template: `
      <td>
        <a :href='pipeline.path'>
          <span class="pipeline-id">#{{pipeline.id}}</span>
        </a>
        <span>by</span>
        <a
          v-if='user'
          :href='pipeline.user.web_url'
        >
          <img
            v-if='user'
            class="avatar has-tooltip s20 "
            :title='pipeline.user.name'
            data-container="body"
            :src='pipeline.user.avatar_url'
          >
        </a>
        <span
          v-if='!user'
          class="api monospace"
        >
          API
        </span>
        <span
          v-if='pipeline.flags.latest'
          class="label label-success has-tooltip"
          title="Latest pipeline for this branch"
          data-original-title="Latest pipeline for this branch"
        >
          latest
        </span>
        <span
          v-if='pipeline.flags.yaml_errors'
          class="label label-danger has-tooltip"
          :title='pipeline.yaml_errors'
          :data-original-title='pipeline.yaml_errors'
        >
          yaml invalid
        </span>
        <span
          v-if='pipeline.flags.stuck'
          class="label label-warning"
        >
          stuck
        </span>
      </td>
    `,
  });
})(window.gl || (window.gl = {}));