Enable send button when patchset level comment is in editing mode Patchset level comment in reply dialog is always kept in editing mode. This would set "commentEditing" to true and disable the send button. Avoid setting commentEditing to true for patchset level comments. This still has the issue that text typed in GrComment is not reflected to GrReplyDialog but solves the issue where already present text correctly calculates the value of hasDrafts. Release-Notes: skip Google-bug-id: b/242982372 Change-Id: I877847d1b2a331e297cefb5e42e3ed47a58e4f67
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts index 77ff47e..86ba96a 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts +++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -78,7 +78,7 @@ declare global { interface HTMLElementEventMap { - 'comment-editing-changed': CustomEvent<boolean>; + 'comment-editing-changed': CustomEvent<CommentEditingChangedDetail>; 'comment-unresolved-changed': CustomEvent<boolean>; 'comment-anchor-tap': CustomEvent<CommentAnchorTapEventDetail>; } @@ -89,6 +89,11 @@ side?: CommentSide; } +export interface CommentEditingChangedDetail { + editing: boolean; + path: string; +} + @customElement('gr-comment') export class GrComment extends LitElement { /** @@ -1025,7 +1030,10 @@ // Parent components such as the reply dialog might be interested in whether // come of their child components are in editing mode. - fire(this, 'comment-editing-changed', this.editing); + fire(this, 'comment-editing-changed', { + editing: this.editing, + path: this.comment?.path ?? '', + }); } // private, but visible for testing