From ae342d14875acc0d65cff0a50f8b2884e0f9eafb Mon Sep 17 00:00:00 2001
From: Tom Bishop
Date: Thu, 2 May 2024 15:23:20 +0000
Subject: [PATCH] CLDR-15649 Dashboard using filters, show spinner while
updating visibility
-The spinner replaces the Dashboard rows until Vue updates the DOM to reflect checkbox change
-Format cldrErrorSubtypes.mjs (from another ticket)
---
.../js/src/esm/cldrErrorSubtypes.mjs | 2 +-
.../js/src/views/DashboardWidget.vue | 182 ++++++++++--------
2 files changed, 100 insertions(+), 84 deletions(-)
diff --git a/tools/cldr-apps/js/src/esm/cldrErrorSubtypes.mjs b/tools/cldr-apps/js/src/esm/cldrErrorSubtypes.mjs
index 4e5f21d3a2e..4e4a88d281f 100644
--- a/tools/cldr-apps/js/src/esm/cldrErrorSubtypes.mjs
+++ b/tools/cldr-apps/js/src/esm/cldrErrorSubtypes.mjs
@@ -147,7 +147,7 @@ function reloadMapHandler(json) {
}
el.innerHTML = html;
if (json.err) {
- const b = cldrDom.createLinkToFn('special_error_subtypes', load, 'button');
+ const b = cldrDom.createLinkToFn("special_error_subtypes", load, "button");
el.appendChild(b);
}
}
diff --git a/tools/cldr-apps/js/src/views/DashboardWidget.vue b/tools/cldr-apps/js/src/views/DashboardWidget.vue
index 0c7231368b6..d72b7cd3a64 100644
--- a/tools/cldr-apps/js/src/views/DashboardWidget.vue
+++ b/tools/cldr-apps/js/src/views/DashboardWidget.vue
@@ -74,93 +74,99 @@
+
+ ...
- ...
@@ -190,6 +196,7 @@ export default {
level: null,
downloadMessage: null,
catIsHidden: {},
+ updatingVisibility: false,
};
},
@@ -366,7 +373,16 @@ export default {
// the user may click again thinking the first click wasn't recognized. Postponing
// the DOM update of thousands of rows ensures that the header checkbox updates
// without delay.
- setTimeout(() => (this.catIsHidden[category] = !event.target.checked), 0);
+ this.updatingVisibility = true;
+ setTimeout(
+ () => this.updateVisibility(event.target.checked, category),
+ 0
+ );
+ },
+
+ updateVisibility(checked, category) {
+ this.catIsHidden[category] = !checked;
+ this.updatingVisibility = false;
},
canBeHidden(cats) {