Koha/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt
Jonathan Druart 5d8c6a36b8
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-02 14:46:09 -03:00

50 lines
1.7 KiB
Text

[% USE raw %]
[% USE To %]
[% USE Asset %]
[% USE KohaDates %]
[% USE TablesSettings %]
[% SET footerjs = 1 %]
[% PROCESS 'i18n.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
E-resource management &rsaquo; Koha
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="erm_agreements" class="erm">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'erm-search.inc' %]
[% END %]
<div id="erm"> <!-- this is closed in intranet-bottom.inc -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% INCLUDE 'js-patron-format.inc' %]
[% INCLUDE 'js-date-format.inc' %]
<script>
const agreement_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'agreements', 'agreements', 'json' ) | $raw %];
const license_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'licenses', 'licenses', 'json' ) | $raw %];
const eholdings_packages_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'eholdings', 'packages', 'json' ) | $raw %];
const eholdings_titles_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'eholdings', 'titles', 'json' ) | $raw %];
const ERMProviders = "[% Koha.Preference('ERMProviders') | html %]";
const erm_providers = ERMProviders.split(',');
const max_allowed_packet = [% To.json(max_allowed_packet) | $raw %];
const ERMModule = [% IF Koha.Preference('ERMModule') %]true[% ELSE %]false[% END %];
const logged_in_user_lists = [% To.json(logged_in_user.virtualshelves.unblessed) | $raw %];
</script>
[% Asset.js("js/vue/dist/erm.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]