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

confidentiality_badge.vue « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 025e38a55ad1756f6937e696dd187e7ec6ef76e8 (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
<script>
import { GlBadge, GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { confidentialityInfoText } from '../constants';

export default {
  components: {
    GlBadge,
    GlIcon,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    workspaceType: {
      type: String,
      required: true,
    },
    issuableType: {
      type: String,
      required: true,
    },
    hideTextInSmallScreens: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  computed: {
    confidentialTooltip() {
      return confidentialityInfoText(this.workspaceType, this.issuableType);
    },
    confidentialTextClass() {
      return {
        'gl-display-none gl-sm-display-block': this.hideTextInSmallScreens,
        'gl-ml-2': true,
      };
    },
  },
};
</script>

<template>
  <gl-badge v-gl-tooltip :title="confidentialTooltip" variant="warning">
    <gl-icon name="eye-slash" :size="16" />
    <span data-testid="confidential-badge-text" :class="confidentialTextClass">{{
      __('Confidential')
    }}</span>
  </gl-badge>
</template>