diff options
author | Milutin Kristofic <milutin@google.com> | 2023-04-28 21:59:11 +0200 |
---|---|---|
committer | Paladox none <thomasmulhall410@yahoo.com> | 2023-04-30 14:57:44 +0000 |
commit | eadf4b14d9345a396e55f02962b9cf5c2814ed52 (patch) | |
tree | 290bdf4458ba063cf929502a5bcce3c82112f537 | |
parent | 7cfd89e260b5eea0d3b504b40863b0b6724b13d0 (diff) |
Add loading spin for comments
Release-Notes: skip
Change-Id: I208d62a2c234e0bb930ef593d90a76c8d702db62
(cherry picked from commit 2d11d3de3ed2724c8eb79536b36547b2930ce5fa)
-rw-r--r-- | polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary.ts | 12 | ||||
-rw-r--r-- | polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary_test.ts | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary.ts b/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary.ts index 531994c905..f6a40a2575 100644 --- a/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary.ts +++ b/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary.ts @@ -63,6 +63,9 @@ DETAILS_QUOTA.set(RunStatus.RUNNING, 2); @customElement('gr-change-summary') export class GrChangeSummary extends LitElement { @state() + commentsLoading = true; + + @state() commentThreads?: CommentThread[]; @state() @@ -161,6 +164,11 @@ export class GrChangeSummary extends LitElement { ); subscribe( this, + () => this.getCommentsModel().commentsLoading$, + x => (this.commentsLoading = x) + ); + subscribe( + this, () => combineLatest([ this.getUserModel().account$, @@ -530,6 +538,10 @@ export class GrChangeSummary extends LitElement { <tr> <td class="key">Comments</td> <td class="value"> + ${when( + this.commentsLoading, + () => html`<span class="loadingSpin"></span>` + )} <gr-comments-summary .commentThreads=${this.commentThreads} .draftCount=${this.draftCount} diff --git a/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary_test.ts b/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary_test.ts index 3cb63f9a13..c3d9774a9d 100644 --- a/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary_test.ts +++ b/polygerrit-ui/app/elements/change/gr-change-summary/gr-change-summary_test.ts @@ -50,6 +50,7 @@ suite('gr-change-summary test', () => { }, discardedDrafts: [], }); + element.commentsLoading = false; element.commentThreads = [ createCommentThread([createComment()]), createCommentThread([{...createComment(), unresolved: true}]), |