From 570dc10f2a3da0269c49de3a9ce42bbc323d2811 Mon Sep 17 00:00:00 2001 From: Emma Segal-Grossman Date: Tue, 20 Aug 2024 20:33:52 -0400 Subject: [PATCH] Properly pluralize "Pages" in QA, and display skeletons instead of incorrect fallback values (#2026) --- .../pages/org/archived-item-detail/ui/qa.ts | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/frontend/src/pages/org/archived-item-detail/ui/qa.ts b/frontend/src/pages/org/archived-item-detail/ui/qa.ts index b6990bae..741a56a8 100644 --- a/frontend/src/pages/org/archived-item-detail/ui/qa.ts +++ b/frontend/src/pages/org/archived-item-detail/ui/qa.ts @@ -249,33 +249,45 @@ export class ArchivedItemDetailQA extends BtrixElement { -
-

- ${htmlCount} ${msg( - "HTML Pages", - )} -

-

- ${fileCount} ${msg( - "Non-HTML Files Captured As Pages", - )} -

-

- ${errorCount} ${msg( - "Failed Pages", - )} -

-
+ ${this.crawl + ? html`
+

+ ${msg(html` + ${htmlCount} + HTML ${pluralOf("pages", htmlCount)} + `)} +

+

+ ${msg(html` + ${fileCount} + Non-HTML files captured as ${pluralOf("pages", fileCount)} + `)} +

+

+ ${msg(html` + ${errorCount} + Failed ${pluralOf("pages", errorCount)} + `)} +

+
` + : html` + + + + `} ${when(this.mostRecentNonFailedQARun && this.qaRuns, (qaRuns) => this.renderAnalysis(qaRuns), )}
-

- ${msg("Pages")} (${( - this.pages?.total ?? 0 - ).toLocaleString()}) +

+ ${msg("Pages")} + ${this.pages != null + ? `(${this.pages.total.toLocaleString()})` + : html``}

${this.renderPageListControls()} ${this.renderPageList()}