Show info when adding reviewers to private change
Show info that the private change will be visible to the user
added as reviewer/CC when they are added in the reply dialog.
Google-bug-id: b/259515557
Release-Notes: skip
Screenshot: https://imgur.com/a/qAi0yrW
Change-Id: I9c5e11194db57a4d7e080c33f14297611bbf1e55
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
index 29bd1d9..11406b4 100644
--- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
+++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
@@ -111,7 +111,7 @@
LabelNameToValuesMap,
PatchSetNumber,
} from '../../../api/rest-api';
-import {css, html, PropertyValues, LitElement} from 'lit';
+import {css, html, PropertyValues, LitElement, nothing} from 'lit';
import {sharedStyles} from '../../../styles/shared-styles';
import {when} from 'lit/directives/when.js';
import {classMap} from 'lit/directives/class-map.js';
@@ -606,6 +606,16 @@
.patchsetLevelContainer.unresolved {
background-color: var(--unresolved-comment-background-color);
}
+ .privateVisiblityInfo {
+ display: flex;
+ justify-content: center;
+ background-color: var(--info-background);
+ padding: var(--spacing-s) 0;
+ }
+ .privateVisiblityInfo gr-icon {
+ margin-right: var(--spacing-m);
+ color: var(--info-foreground);
+ }
`,
];
@@ -791,6 +801,7 @@
<gr-endpoint-slot name="below"></gr-endpoint-slot>
</gr-endpoint-decorator>
${this.renderCCList()} ${this.renderReviewConfirmation()}
+ ${this.renderPrivateVisiblityInfo()}
</section>
<section class="labelsContainer">${this.renderLabels()}</section>
<section class="newReplyDialog textareaContainer">
@@ -893,6 +904,22 @@
`;
}
+ private renderPrivateVisiblityInfo() {
+ const addedAccounts = [
+ ...(this.reviewersList?.additions() ?? []),
+ ...(this.ccsList?.additions() ?? []),
+ ];
+ if (!this.change?.is_private || !addedAccounts.length) return nothing;
+ return html`
+ <div class="privateVisiblityInfo">
+ <gr-icon icon="info"></gr-icon>
+ <div>
+ Adding a reviewer/CC will make this private change visible to them
+ </div>
+ </div>
+ `;
+ }
+
private renderLabels() {
if (!this.change || !this.account || !this.permittedLabels) return;
return html`