Bug 26958

Summary: Move Elasticsearch mapping template JS to the footer
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrewfh, fridolin.somers, testopia, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.03,20.05.09,19.11.15
Bug Depends on:    
Bug Blocks: 17858, 26970    
Attachments: Bug 26958: Move Elasticsearch mapping template JS to the footer
Bug 26958: Move Elasticsearch mapping template JS to the footer
Bug 26970: Add row highlight on drag in Elasticsearch mapping template
Bug 26958: Move Elasticsearch mapping template JS to the footer

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