From 90231eacf02d72b0ade567722c2a7afafd91b4cc Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 30 Oct 2025 11:57:18 +0000 Subject: [PATCH] Bug 39320: (ERMCounts QA follow-up): Reimplement loading. Now present 'Loading' for each resource count that's waiting, rather than hang the whole widget waiting for all responses --- .../ModuleDashboard/Widgets/ERMCounts.vue | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ModuleDashboard/Widgets/ERMCounts.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ModuleDashboard/Widgets/ERMCounts.vue index eb3467b4a80..f5f4c568b30 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ModuleDashboard/Widgets/ERMCounts.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ModuleDashboard/Widgets/ERMCounts.vue @@ -4,12 +4,19 @@ @@ -46,20 +53,23 @@ export default { }, emit ); + baseWidget.loading.value = false; const countDefinitions = reactive([ { page: "AgreementsList", name: "agreements_count", i18nLabel: count => __n("%s agreement", "%s agreements", count).format(count), - count: 0, + count: "", + loading: true, }, { page: "LicensesList", name: "licenses_count", i18nLabel: count => __n("%s license", "%s licenses", count).format(count), - count: 0, + count: "", + loading: true, }, { page: "EHoldingsLocalPackagesList", @@ -68,7 +78,8 @@ export default { __n("%s local package", "%s local packages", count).format( count ), - count: 0, + count: "", + loading: true, }, { page: "EHoldingsLocalTitlesList", @@ -77,7 +88,8 @@ export default { __n("%s local title", "%s local titles", count).format( count ), - count: 0, + count: "", + loading: true, }, { page: "UsageStatisticsDataProvidersList", @@ -88,7 +100,8 @@ export default { "%s usage data providers", count ).format(count), - count: 0, + count: "", + loading: true, }, ]); @@ -124,17 +137,18 @@ export default { endpoints.forEach(({ name, endpoint }) => { endpoint .then(response => { - const definition = countDefinitions.find(i => i.name === name); + const definition = countDefinitions.find( + i => i.name === name + ); if (definition) { definition.count = response; + definition.loading = false; } }) .catch(error => { console.error(`Error fetching ${name}:`, error); }); }); - - baseWidget.loading.value = false; } catch (error) { console.error(error); } -- 2.39.5