Commit 1414d99d authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '338550-remove-notification-warning-for-private-comments' into 'master'

Hide notification warning for private comments

See merge request gitlab-org/gitlab!68252
parents 2027da5b 28d6e0b7
......@@ -14,6 +14,11 @@ export default {
type: Object,
required: true,
},
noteIsConfidential: {
type: Boolean,
required: false,
default: false,
},
noteableType: {
type: String,
required: false,
......@@ -38,6 +43,9 @@ export default {
emailParticipants() {
return this.noteableData.issue_email_participants?.map(({ email }) => email) || [];
},
showEmailParticipantsWarning() {
return this.emailParticipants.length && !this.noteIsConfidential;
},
},
};
</script>
......@@ -61,7 +69,7 @@ export default {
/>
<slot></slot>
<email-participants-warning
v-if="emailParticipants.length"
v-if="showEmailParticipantsWarning"
class="gl-border-t-1 gl-border-t-solid gl-border-t-gray-100 gl-rounded-base gl-rounded-top-left-none! gl-rounded-top-right-none!"
:emails="emailParticipants"
/>
......
......@@ -380,6 +380,7 @@ export default {
<comment-field-layout
:with-alert-container="true"
:noteable-data="getNoteableData"
:note-is-confidential="noteIsConfidential"
:noteable-type="noteableType"
>
<markdown-field
......
......@@ -326,7 +326,10 @@ export default {
></div>
<div class="flash-container timeline-content"></div>
<form :data-line-code="lineCode" class="edit-note common-note-form js-quick-submit gfm-form">
<comment-field-layout :noteable-data="getNoteableData">
<comment-field-layout
:noteable-data="getNoteableData"
:note-is-confidential="discussion.confidential"
>
<markdown-field
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath"
......
......@@ -134,4 +134,18 @@ describe('Comment Field Layout Component', () => {
]);
});
});
describe('issue has email participants, but note is confidential', () => {
it('does not show EmailParticipantsWarning', () => {
createWrapper({
noteableData: {
...noteableDataMock,
issue_email_participants: [{ email: 'someone@gitlab.com' }],
},
noteIsConfidential: true,
});
expect(findEmailParticipantsWarning().exists()).toBe(false);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment