summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-31 06:08:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-31 06:08:34 +0000
commitb654eb44a85fa358ce466b8d6cf772a660478fa9 (patch)
tree62b05ce8278d5ed7f25431e7267e7ef7e6a34065 /app/assets/javascripts/notes
parent69d62eae981e12419891a050f5d6753941c9e42f (diff)
downloadgitlab-ce-b654eb44a85fa358ce466b8d6cf772a660478fa9.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/notes')
-rw-r--r--app/assets/javascripts/notes/components/note_header.vue20
-rw-r--r--app/assets/javascripts/notes/components/noteable_note.vue1
2 files changed, 19 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue
index 71d767c3b95..044b1103086 100644
--- a/app/assets/javascripts/notes/components/note_header.vue
+++ b/app/assets/javascripts/notes/components/note_header.vue
@@ -6,10 +6,12 @@ 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 { NOTEABLE_TYPE_MAPPING } from '../constants';
+
export default {
safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] },
components: {
@@ -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>
diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue
index a271ac91f6e..2290adfdce6 100644
--- a/app/assets/javascripts/notes/components/noteable_note.vue
+++ b/app/assets/javascripts/notes/components/noteable_note.vue
@@ -432,6 +432,7 @@ export default {
:created-at="note.created_at"
:note-id="note.id"
:is-confidential="note.confidential"
+ :noteable-type="noteableType"
>
<template #note-header-info>
<slot name="note-header-info"></slot>