Bugzilla – Attachment 188283 Details for
Bug 39320
Create a 'landing page' for ERM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39320: (QA follow-up): Fix ERMCounts translatability
Bug-39320-QA-follow-up-Fix-ERMCounts-translatabili.patch (text/plain), 5.90 KB, created by
Pedro Amorim
on 2025-10-22 10:03:10 UTC
(
hide
)
Description:
Bug 39320: (QA follow-up): Fix ERMCounts translatability
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-22 10:03:10 UTC
Size:
5.90 KB
patch
obsolete
>From 12bedd718a92cdc7345905f3984784bf6d7bace3 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 22 Oct 2025 09:36:31 +0000 >Subject: [PATCH] Bug 39320: (QA follow-up): Fix ERMCounts translatability > >--- > .../ModuleDashboard/Widgets/ERMCounts.vue | 57 ++++++++----------- > .../integration/ERM/ModuleDashboard_spec.ts | 9 ++- > 2 files changed, 31 insertions(+), 35 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 9f6350a18b3..cbbe94e4b57 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 >@@ -1,29 +1,18 @@ > <template> > <WidgetWrapper v-bind="widgetWrapperProps"> > <template #default> >- <p class="text-left"> >- {{ $__("There are") }} >- <template >- v-for="(definition, index) in countDefinitions" >- :key="index" >- > >+ <ul> >+ <li v-for="def in countDefinitions" :key="def.name"> > <strong> >- <router-link >- v-if="definition.page" >- :to="{ name: definition.page }" >- > >- {{ createCountText(definition) }} >+ <router-link v-if="def.page" :to="{ name: def.page }"> >+ {{ createCountText(def) }} > </router-link> >- <span v-else class="inactive-link"> >- {{ createCountText(definition) }} >- </span> >+ <span v-else class="inactive-link">{{ >+ createCountText(def) >+ }}</span> > </strong> >- <template v-if="index < countDefinitions.length - 1" >- >, </template >- > >- <template v-else>.</template> >- </template> >- </p> >+ </li> >+ </ul> > </template> > </WidgetWrapper> > </template> >@@ -61,51 +50,51 @@ export default { > { > page: "AgreementsList", > name: "agreements_count", >- labelSingular: __("agreement"), >- labelPlural: __("agreements"), >+ labelSingular: __("1 agreement"), >+ labelPlural: __("%s agreements"), > count: 0, > }, > { > page: "LicensesList", > name: "licenses_count", >- labelSingular: __("license"), >- labelPlural: __("licenses"), >+ labelSingular: __("1 license"), >+ labelPlural: __("%s licenses"), > count: 0, > }, > { > name: "documents_count", >- labelSingular: __("document"), >- labelPlural: __("documents"), >+ labelSingular: __("1 document"), >+ labelPlural: __("%s documents"), > count: 0, > }, > { > page: "EHoldingsLocalPackagesList", > name: "eholdings_packages_count", >- labelSingular: __("local package"), >- labelPlural: __("local packages"), >+ labelSingular: __("1 local package"), >+ labelPlural: __("%s local packages"), > count: 0, > }, > { > page: "EHoldingsLocalTitlesList", > name: "eholdings_titles_count", >- labelSingular: __("local title"), >- labelPlural: __("local titles"), >+ labelSingular: __("1 local title"), >+ labelPlural: __("%s local titles"), > count: 0, > }, > { > page: "UsageStatisticsDataProvidersList", > name: "usage_data_providers_count", >- labelSingular: __("usage data provider"), >- labelPlural: __("usage data providers"), >+ labelSingular: __("1 usage data provider"), >+ labelPlural: __("%s usage data providers"), > count: 0, > }, > ]); > > const createCountText = definition => { > if (definition.count === 1) { >- return `${definition.count} ${definition.labelSingular}`; >+ return definition.labelSingular; > } else { >- return `${definition.count} ${definition.labelPlural}`; >+ return definition.labelPlural.format(definition.count); > } > }; > >diff --git a/t/cypress/integration/ERM/ModuleDashboard_spec.ts b/t/cypress/integration/ERM/ModuleDashboard_spec.ts >index 4a9f4d5de6e..50aeb90adaf 100644 >--- a/t/cypress/integration/ERM/ModuleDashboard_spec.ts >+++ b/t/cypress/integration/ERM/ModuleDashboard_spec.ts >@@ -103,8 +103,15 @@ describe("ERM Module Dashboard", () => { > "Loading..." > ); > cy.wait("@getCounts"); >+ cy.get(".widget#ERMCounts .widget-content").contains("1 agreement"); >+ cy.get(".widget#ERMCounts .widget-content").contains("5 licenses"); >+ cy.get(".widget#ERMCounts .widget-content").contains("0 documents"); > cy.get(".widget#ERMCounts .widget-content").contains( >- "There are 1 agreement, 5 licenses, 0 documents, 0 local packages, 0 local titles, 1 usage data provider." >+ "0 local packages" >+ ); >+ cy.get(".widget#ERMCounts .widget-content").contains("0 local titles"); >+ cy.get(".widget#ERMCounts .widget-content").contains( >+ "1 usage data provider" > ); > > //Move to the right >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39320
:
187513
|
187514
|
187515
|
187516
|
187517
|
187518
|
187519
|
187520
|
187521
|
187522
|
187563
|
187568
|
187635
|
187636
|
187637
|
187638
|
187639
|
187640
|
187641
|
187642
|
187643
|
187644
|
187645
|
188094
|
188095
|
188096
|
188097
|
188098
|
188099
|
188100
|
188101
|
188102
|
188103
|
188104
|
188151
|
188279
|
188280
|
188281
|
188282
|
188283
|
188284
|
188285
|
188312
|
188315
|
188372
|
188375
|
188376
|
188637
|
188638
|
188639
|
188640
|
188641
|
188830
|
188831
|
188832
|
188833
|
188834
|
188835
|
188836
|
188837
|
188838
|
188839
|
188840
|
188841
|
188842
|
188843
|
188844
|
188845
|
188846
|
188847
|
188848
|
188849
|
188850
|
188851
|
188852
|
188853
|
188854
|
188855
|
188856
|
188857
|
188858
|
188859
|
188860
|
188861
|
188862
|
188863
|
188864