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

locked_badge.vue « components « issuable « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 652d02e8f9db10dfdc3de8c8323643f6de8b89f3 (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
<script>
import { GlBadge, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { issuableTypeText } from '~/issues/constants';
import { __, sprintf } from '~/locale';

export default {
  components: {
    GlBadge,
    GlIcon,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    issuableType: {
      type: String,
      required: false,
      default: '',
    },
  },
  computed: {
    title() {
      return sprintf(
        __('The discussion in this %{issuable} is locked. Only project members can comment.'),
        {
          issuable: issuableTypeText[this.issuableType],
        },
      );
    },
  },
};
</script>

<template>
  <gl-badge v-gl-tooltip :title="title" variant="warning">
    <gl-icon name="lock" />
    <span class="gl-sr-only">{{ __('Locked') }}</span>
  </gl-badge>
</template>