From b492ddbd745044c37b5a5064e3234345146b3a10 Mon Sep 17 00:00:00 2001 From: btangmu Date: Tue, 7 May 2024 12:09:46 -0400 Subject: [PATCH] CLDR-17461 Forum posts in vetting view, boost performance, change icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Add a cache localeForumStatusMap in SurveyForum.java -New class SurveyForum.LocaleForumStatus -Get all the status for a locale with a single sql call -Clear the cache for a locale when a post is added/closed -Revise icons in the Comparison (English) column: 👁️‍🗨️ and 💬 -👁️‍🗨️ means: This item has one or more forum posts, some of which are open -💬 means: This item has one or more forum posts, all of which are closed -Change let to const for two items in cldrSurvey.mjs; remove @property -Call expediteStatusUpdate in cldrForum to update the table when a post is added/closed -Call updateRowEnglishComparisonCell even if isSetup, and always removeAllChildNodes; old optimization assumed the cell contents never changed --- tools/cldr-apps/js/src/esm/cldrForum.mjs | 9 +-------- tools/cldr-apps/js/src/esm/cldrTable.mjs | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/cldr-apps/js/src/esm/cldrForum.mjs b/tools/cldr-apps/js/src/esm/cldrForum.mjs index a80f369d443..9ad0b77eeef 100644 --- a/tools/cldr-apps/js/src/esm/cldrForum.mjs +++ b/tools/cldr-apps/js/src/esm/cldrForum.mjs @@ -432,14 +432,7 @@ function loadHandlerForSubmit(data) { cldrLoad.reloadV(); // main Forum page } else { cldrForumPanel.updatePosts(null); // Info Panel - // TODO: refresh forum icons (👁️‍🗨️, 💬) in the main table - // Reference: https://unicode-org.atlassian.net/browse/CLDR-17461 - // Calling expediteStatusUpdate does not have the desired effect, since - // the status response json.localeStamp only changes due to recent votes, - // not due to recent posts. - // cldrSurvey.expediteStatusUpdate(); // refresh forum icons in the main table - // console.log("cldrForum.loadHandlerForSubmit called expediteStatusUpdate"); - // cldrTable.refreshSingleRow(...) + cldrSurvey.expediteStatusUpdate(); // update forum icons (👁️‍🗨️, 💬) in the main table } } else { const post = $(".post").first(); diff --git a/tools/cldr-apps/js/src/esm/cldrTable.mjs b/tools/cldr-apps/js/src/esm/cldrTable.mjs index f6fcd7a41ad..45616958bac 100644 --- a/tools/cldr-apps/js/src/esm/cldrTable.mjs +++ b/tools/cldr-apps/js/src/esm/cldrTable.mjs @@ -531,7 +531,7 @@ function reallyUpdateRow(tr, theRow) { /* * Set up the "comparison cell", a.k.a. the "English" column. */ - if (comparisonCell && !comparisonCell.isSetup) { + if (comparisonCell) { updateRowEnglishComparisonCell(tr, theRow, comparisonCell); } @@ -750,6 +750,7 @@ function updateRowCodeCell(tr, theRow, cell) { * Called by updateRow. */ function updateRowEnglishComparisonCell(tr, theRow, cell) { + cldrDom.removeAllChildNodes(cell); let trHint = theRow.translationHint; // sometimes null if (theRow.displayName) { cell.appendChild(