summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_scoped_label.vue
blob: 94587e1cbab754ff62c54bdc329dc67878487d4a (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
<script>
import { GlLink, GlTooltip } from '@gitlab/ui';

export default {
  components: {
    GlTooltip,
    GlLink,
  },
  props: {
    label: {
      type: Object,
      required: true,
    },
    labelStyle: {
      type: Object,
      required: true,
    },
    scopedLabelsDocumentationLink: {
      type: String,
      required: true,
    },
    labelFilterUrl: {
      type: String,
      required: true,
    },
  },
};
</script>

<template>
  <span class="d-inline-block position-relative scoped-label-wrapper">
    <a :href="labelFilterUrl">
      <span :ref="`labelTitleRef`" :style="labelStyle" class="badge color-label label">
        {{ label.title }}
      </span>
      <gl-tooltip
        v-if="label.description"
        :target="() => $refs.labelTitleRef"
        placement="top"
        boundary="viewport"
      >
        <span class="font-weight-bold scoped-label-tooltip-title">{{ __('Scoped label') }}</span
        ><br />
        {{ label.description }}
      </gl-tooltip>
    </a>

    <gl-link :href="scopedLabelsDocumentationLink" target="_blank" class="label scoped-label"
      ><i class="fa fa-question-circle" :style="labelStyle"></i
    ></gl-link>
  </span>
</template>