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

runner_detail.vue « components « runner « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 496985ff7ac17d7dbaeb92c4650374a1300b33ba (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
<script>
import { __ } from '~/locale';

/**
 * Usage:
 *
 * With a `value` prop:
 *
 * <runner-detail label="Field Name" :value="value" />
 *
 * Or a `value` slot:
 *
 * <runner-detail label="Field Name">
 *   <template #value>
 *     <strong>{{ value }}</strong>
 *   </template>
 * </runner-detail>
 *
 */
export default {
  props: {
    label: {
      type: String,
      default: null,
      required: false,
    },
    value: {
      type: String,
      default: null,
      required: false,
    },
    emptyValue: {
      type: String,
      default: __('None'),
      required: false,
    },
  },
};
</script>

<template>
  <div class="gl-display-contents">
    <dt class="gl-mb-5 gl-mr-6 gl-max-w-26" data-testid="label-slot">
      <template v-if="label || $scopedSlots.label">
        <slot name="label">{{ label }}</slot>
      </template>
    </dt>
    <dd class="gl-mb-5" data-testid="value-slot">
      <template v-if="value || $scopedSlots.value">
        <slot name="value">{{ value }}</slot>
      </template>
      <span v-else class="gl-text-secondary">{{ emptyValue }}</span>
    </dd>
  </div>
</template>