Skip to content

Commit

Permalink
CLDR-17461 Forum posts in vetting view, boost performance, change icons
Browse files Browse the repository at this point in the history
-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
  • Loading branch information
btangmu committed May 7, 2024
1 parent 4660154 commit b492ddb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions tools/cldr-apps/js/src/esm/cldrForum.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion tools/cldr-apps/js/src/esm/cldrTable.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit b492ddb

Please sign in to comment.