Bug 26958 - Move Elasticsearch mapping template JS to the footer
Summary: Move Elasticsearch mapping template JS to the footer
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 17858 26970
  Show dependency treegraph
 
Reported: 2020-11-06 16:16 UTC by Owen Leonard
Modified: 2021-05-24 12:55 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.03,20.05.09,19.11.15


Attachments
Bug 26958: Move Elasticsearch mapping template JS to the footer (7.01 KB, patch)
2020-11-06 16:31 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26958: Move Elasticsearch mapping template JS to the footer (7.06 KB, patch)
2020-11-09 07:55 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26970: Add row highlight on drag in Elasticsearch mapping template (1.79 KB, patch)
2020-11-09 08:43 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26958: Move Elasticsearch mapping template JS to the footer (7.13 KB, patch)
2021-02-11 15:09 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-11-06 16:16:37 UTC
In order to conform to best practices for performance, staff client template JavaScript should be in the footer instead of the header.

This patch will do so for the Elasticsearch mappings template.
Comment 1 Owen Leonard 2020-11-06 16:31:36 UTC Comment hidden (obsolete)
Comment 2 Fridolin Somers 2020-11-09 07:55:59 UTC
Created attachment 113299 [details] [review]
Bug 26958: Move Elasticsearch mapping template JS to the footer

This patch moves inclusion of JavaScript to the footer of the
Elasticsearch mapping template. It also moves the JS into a separate
file.

To test you should have SearchEngine system preference set to
"Elasticsearch."

 - Apply the patch and go to Administration -> Search engine
   configuration (Elasticsearch).
 - Confirm that JavaScript dependent interactions work correctly:
   - Tabs
   - Under the bibliographic records and authorities tabs, table row
     drag-and-drop
   - Under the bibliographic records and authorities tabs, test the
     "Add" line at the bottom of the table.
   - Under the bibliographic records and authorities tabs, test the
     "Delete" button.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 3 Fridolin Somers 2020-11-09 07:57:39 UTC
Everything looks good.

I've also checked : translated strings in elasticsearch-mappings.js are with __()
Comment 4 Fridolin Somers 2020-11-09 08:43:24 UTC Comment hidden (obsolete)
Comment 5 Fridolin Somers 2020-11-09 08:45:43 UTC Comment hidden (obsolete)
Comment 6 Nick Clemens 2021-02-11 15:09:34 UTC
Created attachment 116759 [details] [review]
Bug 26958: Move Elasticsearch mapping template JS to the footer

This patch moves inclusion of JavaScript to the footer of the
Elasticsearch mapping template. It also moves the JS into a separate
file.

To test you should have SearchEngine system preference set to
"Elasticsearch."

 - Apply the patch and go to Administration -> Search engine
   configuration (Elasticsearch).
 - Confirm that JavaScript dependent interactions work correctly:
   - Tabs
   - Under the bibliographic records and authorities tabs, table row
     drag-and-drop
   - Under the bibliographic records and authorities tabs, test the
     "Add" line at the bottom of the table.
   - Under the bibliographic records and authorities tabs, test the
     "Delete" button.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Jonathan Druart 2021-02-12 12:11:52 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-02-19 14:58:43 UTC
I choose to backport to be able to backport any change of JS in this page.

Pushed to 20.11.x for 20.11.03
Comment 9 Andrew Fuerste-Henry 2021-02-22 23:00:58 UTC
Pushed to 20.05.x for 20.05.09
Comment 10 Victor Grousset/tuxayo 2021-02-23 16:57:22 UTC
Backported: Pushed to 19.11.x branch for 19.11.15