From 5d593513a5389e7a9c63ae85ac73dce29a7d0d71 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Fri, 28 Jun 2019 10:24:32 +0100 Subject: [PATCH] Bug 23229: Only load ILL table JS when needed This patch prevents the JS associated with the ILL table from loading unless we're actually displaying the table. This has the knock on effect of not causing the "get all ILL requests" API request to fire when loading any ILL page. Test plan: - Go to "ILL requests" page - TEST: Observe that the table loads all ILL requests - Go to the "New ILL request" page for any installed backend - TEST: Check the browser dev tools "Network" panel, observe that the /api/v1/illrequests?embed=metadata,patron,capabilities,library,status_alias,comments,requested_partners request is not made. Signed-off-by: Kyle M Hall --- koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 88ee777a09..2e6e4c2647 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -531,8 +531,10 @@ // Set column settings var columns_settings = [% ColumnsSettings.GetColumns( 'illrequests', 'ill-requests', 'ill-requests', 'json' ) %]; + [% IF query_type == 'illlist' %] [% INCLUDE 'ill-list-table-strings.inc' %] [% Asset.js("js/ill-list-table.js") | $raw %] + [% END %] [% END %] [% TRY %] -- 2.20.1 (Apple Git-117)