Bug 32983 - Use REST API route to retrieve authorised values
Summary: Use REST API route to retrieve authorised values
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on: 32925 32997
Blocks: 32932 32991 34056
  Show dependency treegraph
 
Reported: 2023-02-16 13:45 UTC by Jonathan Druart
Modified: 2023-06-19 08:13 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04


Attachments
Bug 32983: ERM - Retrieve AVs from an endpoint (25.06 KB, patch)
2023-02-16 13:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32983: ERM - Retrieve AVs from an endpoint (27.93 KB, patch)
2023-02-16 14:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32983: ERM - Retrieve AVs from an endpoint (28.25 KB, patch)
2023-02-21 14:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32983: ERM - Retrieve AVs from an endpoint (28.33 KB, patch)
2023-02-21 17:20 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 32983: Use REST API route to retrieve authorised values (3.06 KB, patch)
2023-02-23 12:28 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 32983: Use REST API route to retrieve authorised values (3.14 KB, patch)
2023-02-24 07:43 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32983: ERM - Retrieve AVs from an endpoint (28.34 KB, patch)
2023-02-24 15:59 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32983: Use REST API route to retrieve authorised values (3.19 KB, patch)
2023-02-24 15:59 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32983: Use REST API route to retrieve authorised values (3.39 KB, patch)
2023-03-02 10:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32983: Fix dropdown list when search for EBSCO's packages (1.19 KB, patch)
2023-03-08 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2023-02-16 13:45:18 UTC
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!
Comment 1 Jonathan Druart 2023-02-16 13:52:22 UTC
Created attachment 146732 [details] [review]
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)
Comment 2 Jonathan Druart 2023-02-16 14:18:18 UTC
Created attachment 146733 [details] [review]
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)
Comment 3 Jonathan Druart 2023-02-21 14:16:17 UTC
Created attachment 147050 [details] [review]
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)
Comment 4 Matt Blenkinsop 2023-02-21 17:20:18 UTC
Created attachment 147081 [details] [review]
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 <matt.blenkinsop@ptfs-europe.com>
Comment 5 Pedro Amorim 2023-02-23 12:28:58 UTC
Created attachment 147228 [details] [review]
Bug 32983: Use REST API route to retrieve authorised values

Make one API call for all AV categories+values instead of one API call per AV category required
Comment 6 Jonathan Druart 2023-02-24 07:43:14 UTC
Created attachment 147283 [details] [review]
Bug 32983: Use REST API route to retrieve authorised values

Make one API call for all AV categories+values instead of one API call per AV category required

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Nick Clemens 2023-02-24 15:59:25 UTC
Created attachment 147348 [details] [review]
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 <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Nick Clemens 2023-02-24 15:59:27 UTC
Created attachment 147349 [details] [review]
Bug 32983: Use REST API route to retrieve authorised values

Make one API call for all AV categories+values instead of one API call per AV category required

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Jonathan Druart 2023-03-02 10:08:14 UTC
Created attachment 147585 [details] [review]
Bug 32983: Use REST API route to retrieve authorised values

Make one API call for all AV categories+values instead of one API call per AV category required

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Jonathan Druart 2023-03-02 10:08:37 UTC
Run prettier on Main.vue for the second patch.
Comment 11 Tomás Cohen Arazi 2023-03-02 17:46:03 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 12 Matt Blenkinsop 2023-03-03 12:23:41 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 13 Marcel de Rooy 2023-03-06 09:48:41 UTC
This breaks the complete API, as far as I can see:

[2023/03/06 09:13:28] [ERROR] Warning: Could not load REST API spec bundle: /parameters/authorised_value_id_pp/in: /oneOf/0 Not in enum list: body./parameters/authorised_value_id_pp/in: /oneOf/1/oneOf/0 Not in enum list: header./parameters/authorised_value_id_pp/in: /oneOf/1/oneOf/1 Not in enum list: formData./parameters/authorised_value_id_pp/in: /oneOf/1/oneOf/2 Not in enum list: query./parameters/authorised_value_id_pp/required: /oneOf/1/oneOf/3 Missing property./parameters/authorised_value_id_pp/schema: /oneOf/0 Missing property./parameters/authorised_value_id_pp/type: /oneOf/1 Missing property. at /usr/share/perl5/Mojolicious/Plugin/OpenAPI.pm line 27.
Comment 14 Marcel de Rooy 2023-03-06 10:47:07 UTC
Not sure what happens but 33145 seems to resolve issues
Comment 15 Jonathan Druart 2023-03-08 14:53:32 UTC
Created attachment 147959 [details] [review]
Bug 32983: Fix dropdown list when search for EBSCO's packages
Comment 16 Lucas Gass 2023-03-10 14:55:45 UTC
Enhancement will not be backported to 22.05.x
Comment 17 Tomás Cohen Arazi 2023-03-17 11:16:52 UTC
Follow-up pushed to master.
Comment 18 Matt Blenkinsop 2023-03-17 17:04:04 UTC
Follow-up pushed to stable