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 eb3467b4a8..f5f4c568b3 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 @@
-
-
+
{{ createCountText(def) }}
- {{
- createCountText(def)
- }}
+
+
+ {{ createCountText(def) }}
+
@@ -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);
}