Bugzilla – Attachment 149438 Details for
Bug 33408
Fetch sysprefs from svc/config/systempreferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33408: Store sysprefs in a new ERM store
Bug-33408-Store-sysprefs-in-a-new-ERM-store.patch (text/plain), 7.14 KB, created by
Jonathan Druart
on 2023-04-11 12:25:16 UTC
(
hide
)
Description:
Bug 33408: Store sysprefs in a new ERM store
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-04-11 12:25:16 UTC
Size:
7.14 KB
patch
obsolete
>From c9e74cdefd9e6693d419b5c93e83c5395307e018 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 >--- > .../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 @@ > <template> >- <div v-if="initialized && ERMModule == 1"> >+ <div v-if="initialized && sysprefs.ERMModule == 1"> > <div id="sub-header"> > <Breadcrumb /> > <Help /> >@@ -48,7 +48,7 @@ > <li> > <ul> > <li >- v-for="provider in erm_providers" >+ v-for="provider in providers" > :key="provider" > > > <router-link >@@ -136,9 +136,16 @@ export default { > > const { loading, loaded, setError } = mainStore > >+ const ERMStore = inject("ERMStore") >+ >+ const { sysprefs, providers } = ERMStore >+ > return { > vendorStore, > AVStore, >+ ERMStore, >+ sysprefs, >+ providers, > setError, > loading, > loaded, >@@ -148,8 +155,6 @@ export default { > return { > component: "agreement", > initialized: false, >- ERMModule: null, >- erm_providers: [], > } > }, > beforeCreate() { >@@ -209,7 +214,8 @@ export default { > promises.push( > sysprefs_client.sysprefs.get("ERMProviders").then( > providers => { >- this.erm_providers = providers.value.split(",") >+ this.ERMStore.providers = providers.value.split(",") >+ this.providers = this.ERMStore.providers > }, > error => {} > ) >@@ -221,8 +227,8 @@ export default { > sysprefs_client.sysprefs > .get("ERMModule") > .then(value => { >- this.ERMModule = value.value >- if (this.ERMModule != 1) { >+ this.ERMStore.sysprefs.ERMModule = value.value >+ if (this.sysprefs.ERMModule != 1) { > return this.setError( > this.$__( > 'The e-resource management module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ERMModule">ERMModule</a> to use it' >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >index 68f84ff9ce5..ee438d4d371 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >@@ -28,6 +28,7 @@ const router = createRouter({ > import { useMainStore } from "../stores/main"; > import { useVendorStore } from "../stores/vendors"; > import { useAVStore } from "../stores/authorised-values"; >+import { useERMStore } from "../stores/erm"; > > const pinia = createPinia(); > >@@ -54,6 +55,8 @@ const mainStore = useMainStore(pinia); > app.provide("mainStore", mainStore); > const AVStore = useAVStore(pinia); > app.provide("AVStore", AVStore); >+const ERMStore = useERMStore(pinia); >+app.provide("ERMStore", ERMStore); > > app.mount("#erm"); > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js >new file mode 100644 >index 00000000000..91a42d0c014 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js >@@ -0,0 +1,10 @@ >+import { defineStore } from "pinia"; >+ >+export const useERMStore = defineStore("erm", { >+ state: () => ({ >+ sysprefs: { >+ ERMModule: false, >+ }, >+ providers: [], >+ }), >+}); >-- >2.25.1
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 33408
:
149131
|
149132
|
149133
|
149134
|
149184
|
149185
|
149186
|
149196
|
149197
|
149198
|
149200
|
149204
|
149205
|
149206
|
149207
|
149208
|
149209
|
149254
|
149438
|
149516
|
149517
|
149518
|
149535
|
149536
|
149537
|
149538
|
149539
|
149540
|
149541
|
149542
|
149543
|
149570