From cebed9c25580b3a3fdcaac38ce687b6d6a0c8993 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Wed, 1 Mar 2023 12:56:55 -0300 Subject: [PATCH] Bug 32991: Remove _is_loading warning, and improve 'ERMModule' disabled warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pedro Amorim Signed-off-by: Pedro Amorim Signed-off-by: Agustín Moyano --- .../prog/js/vue/components/ERM/Main.vue | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) 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 1f2ce3ecaf1..718339bb7fa 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,10 +1,7 @@ @@ -137,17 +130,16 @@ export default { const mainStore = inject("mainStore") - // Note that we cannot use loading and loaded from messages - // Pinia is not initiated yet there - const { _is_loading } = storeToRefs(mainStore) + const { loading, loaded, setError } = mainStore return { vendorStore, AVStore, - mainStore, + setError, erm_providers, ERMModule, - _is_loading, + loading, + loaded, } }, data() { @@ -156,7 +148,12 @@ export default { } }, beforeCreate() { - this.mainStore._is_loading = true + if(!this.ERMModule) { + return this.setError(this.$__( + 'The e-resource management module is disabled, turn on ERMModule to use it' + ), false); + } + this.loading() const acq_client = APIClient.acquisition acq_client.vendors.getAll().then( @@ -200,7 +197,7 @@ export default { } ) }) - .then(() => (this.mainStore._is_loading = false)) + }).then(() => (this.loaded())); }, components: { Breadcrumb, -- 2.25.1