summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components/pipeline_url.vue
blob: 8333ec0fbc3563bc12418d94d0ec0e30e29a9edb (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
<script>
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
import tooltipMixin from '../../vue_shared/mixins/tooltip';

export default {
  props: {
    pipeline: {
      type: Object,
      required: true,
    },
  },
  components: {
    userAvatarLink,
  },
  mixins: [
    tooltipMixin,
  ],
  computed: {
    user() {
      return this.pipeline.user;
    },
  },
};
</script>
<template>
  <div class="table-section section-15 hidden-xs hidden-sm">
    <a
      :href="pipeline.path"
      class="js-pipeline-url-link">
      <span class="pipeline-id">#{{pipeline.id}}</span>
    </a>
    <span>by</span>
    <user-avatar-link
      v-if="user"
      class="js-pipeline-url-user"
      :link-href="pipeline.user.path"
      :img-src="pipeline.user.avatar_url"
      :tooltip-text="pipeline.user.name"
    />
    <span
      v-if="!user"
      class="js-pipeline-url-api api">
      API
    </span>
    <div class="label-container">
      <span
        v-if="pipeline.flags.latest"
        class="js-pipeline-url-latest label label-success"
        title="Latest pipeline for this branch"
        ref="tooltip">
        latest
      </span>
      <span
        v-if="pipeline.flags.yaml_errors"
        class="js-pipeline-url-yaml label label-danger"
        :title="pipeline.yaml_errors"
        ref="tooltip">
        yaml invalid
      </span>
      <span
        v-if="pipeline.flags.stuck"
        class="js-pipeline-url-stuck label label-warning">
        stuck
      </span>
    </div>
  </div>
</template>