BigW Consortium Gitlab

pipeline_url.vue 1.51 KB
Newer Older
1 2
<script>
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
3
import tooltip from '../../vue_shared/directives/tooltip';
4 5 6 7 8 9 10 11 12 13 14

export default {
  props: {
    pipeline: {
      type: Object,
      required: true,
    },
  },
  components: {
    userAvatarLink,
  },
15 16 17
  directives: {
    tooltip,
  },
18 19 20 21 22 23 24 25
  computed: {
    user() {
      return this.pipeline.user;
    },
  },
};
</script>
<template>
26
  <div class="table-section section-15 hidden-xs hidden-sm">
27 28 29 30 31 32 33 34 35
    <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"
36
      :link-href="pipeline.user.path"
37 38 39 40 41 42 43 44
      :img-src="pipeline.user.avatar_url"
      :tooltip-text="pipeline.user.name"
    />
    <span
      v-if="!user"
      class="js-pipeline-url-api api">
      API
    </span>
45 46 47
    <div class="label-container">
      <span
        v-if="pipeline.flags.latest"
48
        v-tooltip
49
        class="js-pipeline-url-latest label label-success"
50
        title="Latest pipeline for this branch">
51 52 53 54
        latest
      </span>
      <span
        v-if="pipeline.flags.yaml_errors"
55
        v-tooltip
56
        class="js-pipeline-url-yaml label label-danger"
57
        :title="pipeline.yaml_errors">
58 59 60 61 62 63 64 65 66
        yaml invalid
      </span>
      <span
        v-if="pipeline.flags.stuck"
        class="js-pipeline-url-stuck label label-warning">
        stuck
      </span>
    </div>
  </div>
67
</template>