From ac3ec38f5f05a745a6d7c3e307d0d45df619b3cc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 16 Feb 2023 14:38:46 +0100 Subject: [PATCH] Bug 32983: ERM - Retrieve AVs from an endpoint Bug 32981 let us retrieve the authorised values from a REST API route, instead of injecting them from the template. Let us that for the ERM module! Test plan: You will notice a "Loading" screen when refreshing the ERM module Then you should not notice any other UI changes. Dropdown list should be populated like before this patch. Some technical notes: I am expecting this to be slower than before, but it feels better to use a REST API route to retrieve the AV Future improvement will be to lazy load the AVs, to speed up the landing page. However it needs more changes, and this gets big enough. I would like to see a follow-up that move the code from ERM/Main.vue to the authorised value store (I've failed at that), but that should certainly be done after the lazy loading is implemented anyway) Signed-off-by: Matt Blenkinsop Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 5d8c6a36b8647aa33945e4e6e9b28e511cd433bb) Signed-off-by: Matt Blenkinsop --- .../intranet-tmpl/prog/en/modules/erm/erm.tt | 18 ------ .../prog/js/vue/components/Dialog.vue | 14 ++++- .../vue/components/ERM/AgreementLicenses.vue | 8 +-- .../components/ERM/AgreementRelationships.vue | 4 +- .../vue/components/ERM/AgreementsFormAdd.vue | 14 ++--- .../ERM/EHoldingsEBSCOPackageTitlesList.vue | 6 +- .../ERM/EHoldingsEBSCOTitlesList.vue | 10 ++-- .../ERM/EHoldingsLocalPackagesFormAdd.vue | 8 +-- .../ERM/EHoldingsLocalTitlesFormAdd.vue | 4 +- .../js/vue/components/ERM/LicensesFormAdd.vue | 8 +-- .../prog/js/vue/components/ERM/Main.vue | 58 ++++++++++++++----- .../prog/js/vue/components/ERM/UserRoles.vue | 4 +- .../prog/js/vue/fetch/api-client.js | 4 +- .../prog/js/vue/fetch/authorised-values.js | 20 +++++++ .../intranet-tmpl/prog/js/vue/messages.js | 10 ++++ .../intranet-tmpl/prog/js/vue/modules/erm.ts | 5 +- ...horised_values.js => authorised-values.js} | 34 +++++------ .../intranet-tmpl/prog/js/vue/stores/main.js | 7 +++ 18 files changed, 148 insertions(+), 88 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/fetch/authorised-values.js rename koha-tmpl/intranet-tmpl/prog/js/vue/stores/{authorised_values.js => authorised-values.js} (51%) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt index 783d3a0329..9bf3ee0080 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt @@ -3,7 +3,6 @@ [% USE Asset %] [% USE KohaDates %] [% USE TablesSettings %] -[% USE AuthorisedValues %] [% SET footerjs = 1 %] [% PROCESS 'i18n.inc' %] [% INCLUDE 'doc-head-open.inc' %] @@ -29,23 +28,6 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue index 7111a096ca..a05b2893c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue @@ -44,8 +44,8 @@