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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/issuable/components/locked_badge.vue')
-rw-r--r--app/assets/javascripts/issuable/components/locked_badge.vue36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/assets/javascripts/issuable/components/locked_badge.vue b/app/assets/javascripts/issuable/components/locked_badge.vue
new file mode 100644
index 00000000000..f97ac888417
--- /dev/null
+++ b/app/assets/javascripts/issuable/components/locked_badge.vue
@@ -0,0 +1,36 @@
+<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(__('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>