From f522b970d4107c4099cec03ee0a126d70d3ffa23 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 7 Apr 2023 10:40:08 +0200 Subject: [PATCH] Bug 33408: Store sysprefs in a new ERM store We need the sysprefs' values to be shared between the components Signed-off-by: Pedro Amorim --- .../ERM/EHoldingsEBSCOPackagesList.vue | 7 +++++-- .../ERM/EHoldingsEBSCOTitlesList.vue | 7 +++++-- .../prog/js/vue/components/ERM/Main.vue | 20 ++++++++++++------- .../intranet-tmpl/prog/js/vue/modules/erm.ts | 3 +++ .../intranet-tmpl/prog/js/vue/stores/erm.js | 10 ++++++++++ 5 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue index 26c1f48c618..9cffce6f7eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue @@ -81,6 +81,9 @@ export default { storeToRefs(AVStore) const { get_lib_from_av, map_av_dt_filter } = AVStore + const ERMStore = inject("ERMStore") + const { providers } = ERMStore + const table = ref() const filters = reactive({ package_name: "", @@ -95,7 +98,7 @@ export default { get_lib_from_av, escape_str, map_av_dt_filter, - erm_providers, + providers, table, } }, @@ -165,7 +168,7 @@ export default { this.show_table = true this.local_count_packages = null - if (this.erm_providers.includes("local")) { + if (this.providers.includes("local")) { const client = APIClient.erm const query = this.filters ? { diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue index bbb550c83e3..be1333af6da 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue @@ -84,6 +84,9 @@ export default { const { av_title_publication_types } = storeToRefs(AVStore) const { get_lib_from_av } = AVStore + const ERMStore = inject("ERMStore") + const { providers } = ERMStore + const table = ref() const filters = reactive({ publication_title: "", @@ -96,7 +99,7 @@ export default { av_title_publication_types, get_lib_from_av, escape_str, - erm_providers, + providers, table, } }, @@ -175,7 +178,7 @@ export default { "/api/v1/erm/eholdings/ebsco/titles" ) } - if (this.erm_providers.includes("local")) { + if (this.providers.includes("local")) { const client = APIClient.erm const q = this.filters diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue index edfb3b959d6..af0587d3750 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue @@ -1,5 +1,5 @@