diff options
Diffstat (limited to 'app/assets/javascripts/notes/components/note_header.vue')
-rw-r--r-- | app/assets/javascripts/notes/components/note_header.vue | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue index 71d767c3b95..11b427b9346 100644 --- a/app/assets/javascripts/notes/components/note_header.vue +++ b/app/assets/javascripts/notes/components/note_header.vue @@ -6,9 +6,11 @@ import { GlSafeHtmlDirective as SafeHtml, } from '@gitlab/ui'; import { mapActions } from 'vuex'; -import { __ } from '~/locale'; +import { __, s__ } from '~/locale'; import timeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; -import UserNameWithStatus from '../../sidebar/components/assignees/user_name_with_status.vue'; +import UserNameWithStatus from '~/sidebar/components/assignees/user_name_with_status.vue'; + +import { NOTEABLE_TYPE_MAPPING } from '../constants'; export default { safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] }, @@ -45,6 +47,11 @@ export default { required: false, default: null, }, + noteableType: { + type: String, + required: false, + default: '', + }, includeToggle: { type: Boolean, required: false, @@ -103,6 +110,15 @@ export default { authorName() { return this.author.name; }, + noteConfidentialityTooltip() { + if ( + this.noteableType === NOTEABLE_TYPE_MAPPING.Issue || + this.noteableType === NOTEABLE_TYPE_MAPPING.MergeRequest + ) { + return s__('Notes|This comment is confidential and only visible to project members'); + } + return s__('Notes|This comment is confidential and only visible to group members'); + }, }, mounted() { this.emojiTitle = this.emojiElement ? this.emojiElement.getAttribute('title') : ''; @@ -226,7 +242,7 @@ export default { data-testid="confidentialIndicator" name="eye-slash" :size="16" - :title="s__('Notes|This comment is confidential and only visible to project members')" + :title="noteConfidentialityTooltip" class="gl-ml-1 gl-text-orange-700 align-middle" /> <slot name="extra-controls"></slot> |