summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jobs/components/sidebar_detail_row.vue
blob: d143e9f586c19f4290721a30925fd4c1ae2bd422 (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
<script>
import { GlLink } from '@gitlab/ui';

export default {
  name: 'SidebarDetailRow',
  components: {
    GlLink,
  },
  props: {
    title: {
      type: String,
      required: false,
      default: '',
    },
    value: {
      type: String,
      required: true,
    },
    helpUrl: {
      type: String,
      required: false,
      default: '',
    },
  },
  computed: {
    hasTitle() {
      return this.title.length > 0;
    },
    hasHelpURL() {
      return this.helpUrl.length > 0;
    },
  },
};
</script>
<template>
  <p class="build-detail-row">
    <span
      v-if="hasTitle"
      class="build-light-text"
    >
      {{ title }}:
    </span>
    {{ value }}

    <span
      v-if="hasHelpURL"
      class="help-button float-right"
    >
      <gl-link
        :href="helpUrl"
        target="_blank"
        rel="noopener noreferrer nofollow"
      >
        <i
          class="fa fa-question-circle"
          aria-hidden="true"
        ></i>
      </gl-link>
    </span>
  </p>
</template>