Clean up preview formatting and resolved checkbox labels
Both features are part of GrComment hence are already present
in the patchset level comment.
Release-Notes: skip
Google-bug-id: b/242982372
Change-Id: I056e459db3dcd27dffb34736531f14d2166b55e4
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 bf6ab48..13de1cd 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
@@ -347,9 +347,6 @@
reviewerPendingConfirmation: SuggestedReviewerGroupInfo | null = null;
@state()
- previewFormatting = false;
-
- @state()
sendButtonLabel?: string;
@state()
@@ -521,13 +518,6 @@
#textarea {
flex: 1;
}
- .previewContainer {
- border-top: none;
- }
- .previewContainer gr-formatted-text {
- background: var(--table-header-background-color);
- padding: var(--spacing-l);
- }
#checkingStatusLabel,
#notLatestLabel {
margin-left: var(--spacing-l);
@@ -554,9 +544,6 @@
#pluginMessage:empty {
display: none;
}
- .preview-formatting {
- margin-left: var(--spacing-m);
- }
.attention .edit-attention-button {
vertical-align: top;
--gr-button-padding: 0px 4px;
@@ -641,10 +628,6 @@
.patchsetLevelContainer.unresolved {
background-color: var(--unresolved-comment-background-color);
}
- .labelContainer {
- padding-left: var(--spacing-m);
- padding-bottom: var(--spacing-m);
- }
`,
];
@@ -836,17 +819,6 @@
<section class="newReplyDialog textareaContainer">
${this.renderReplyText()}
</section>
- ${when(
- this.previewFormatting,
- () => html`
- <section class="previewContainer">
- <gr-formatted-text
- .content=${this.patchsetLevelDraftMessage}
- .config=${this.projectConfig?.commentlinks}
- ></gr-formatted-text>
- </section>
- `
- )}
${this.renderDraftsSection()}
<div class="stickyBottom newReplyDialog">
<gr-endpoint-decorator name="reply-bottom">
@@ -1045,39 +1017,10 @@
<gr-endpoint-param name="change" .value=${this.change}>
</gr-endpoint-param>
</gr-endpoint-decorator>
- ${this.renderLabelContainer()}
</div>
`;
}
- private renderLabelContainer() {
- if (
- this.flagsService.isEnabled(
- KnownExperimentId.PATCHSET_LEVEL_COMMENT_USES_GRCOMMENT
- )
- )
- return nothing;
- return html`<div class="labelContainer">
- <label>
- <input
- id="resolvedPatchsetLevelCommentCheckbox"
- type="checkbox"
- ?checked=${this.patchsetLevelDraftIsResolved}
- @change=${this.handleResolvedPatchsetLevelCommentCheckboxChanged}
- />
- Resolved
- </label>
- <label class="preview-formatting">
- <input
- type="checkbox"
- ?checked=${this.previewFormatting}
- @change=${this.handlePreviewFormattingChanged}
- />
- Preview formatting
- </label>
- </div>`;
- }
-
private renderDraftsSection() {
if (this.computeHideDraftList(this.draftCommentThreads)) return;
return html`
@@ -1410,16 +1353,6 @@
};
}
- private handleResolvedPatchsetLevelCommentCheckboxChanged(e: Event) {
- if (!(e.target instanceof HTMLInputElement)) return;
- this.patchsetLevelDraftIsResolved = e.target.checked;
- }
-
- private handlePreviewFormattingChanged(e: Event) {
- if (!(e.target instanceof HTMLInputElement)) return;
- this.previewFormatting = e.target.checked;
- }
-
private handleIncludeCommentsChanged(e: Event) {
if (!(e.target instanceof HTMLInputElement)) return;
this.includeComments = e.target.checked;
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.ts b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.ts
index 01c5038..cfa4145 100644
--- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.ts
+++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.ts
@@ -245,20 +245,6 @@
</gr-textarea>
<gr-endpoint-param name="change"> </gr-endpoint-param>
</gr-endpoint-decorator>
- <div class="labelContainer">
- <label>
- <input
- checked=""
- id="resolvedPatchsetLevelCommentCheckbox"
- type="checkbox"
- />
- Resolved
- </label>
- <label class="preview-formatting">
- <input type="checkbox" />
- Preview formatting
- </label>
- </div>
</div>
</section>
<div class="newReplyDialog stickyBottom">
@@ -1075,50 +1061,6 @@
assert.sameMembers(actualAccounts, [1, 2, 4]);
});
- test('toggle resolved checkbox', async () => {
- const checkboxEl = queryAndAssert<HTMLInputElement>(
- element,
- '#resolvedPatchsetLevelCommentCheckbox'
- );
- checkboxEl.click();
-
- // Async tick is needed because iron-selector content is distributed and
- // distributed content requires an observer to be set up.
- await element.updateComplete;
- element.patchsetLevelDraftMessage = 'I wholeheartedly disapprove';
- element.draftCommentThreads = [createCommentThread([createComment()])];
-
- const saveReviewPromise = interceptSaveReview();
-
- // This is needed on non-Blink engines most likely due to the ways in
- // which the dom-repeat elements are stamped.
- await element.updateComplete;
- queryAndAssert<GrButton>(element, '.send').click();
-
- const review = await saveReviewPromise;
- assert.deepEqual(review, {
- drafts: 'PUBLISH_ALL_REVISIONS',
- labels: {
- 'Code-Review': 0,
- Verified: 0,
- },
- comments: {
- [SpecialFilePath.PATCHSET_LEVEL_COMMENTS]: [
- {
- message: 'I wholeheartedly disapprove',
- unresolved: true,
- },
- ],
- },
- reviewers: [],
- add_to_attention_set: [
- {reason: '<GERRIT_ACCOUNT_1> replied on the change', user: 999},
- ],
- remove_from_attention_set: [],
- ignore_automatic_attention_set_rules: true,
- });
- });
-
test('label picker', async () => {
element.patchsetLevelDraftMessage = 'I wholeheartedly disapprove';
element.draftCommentThreads = [createCommentThread([createComment()])];