I would like to modify the add item template (additem.tt) to move JavaScript from the <head> to separate files: cataloging_additem.js and cataloging_additem.inc (for defining translatable strings used in the js).
Created attachment 77135 [details] [review] Bug 21091: Move add item template JavaScript to a separate file This patch moves the JavaScript in the add item template to separate files: 1 JS file and 1 include file containing translatable strings. While moving the JS to cataloging_additem.js I have made some changes to quiet ESLint warnings (spacing, variable definition). To test, apply the patch and open the add item page for an existing record. Test the various JS-driven functionalities: - Table sorting - Table column configuration - Table searching - Table inline edit/delete links (click anywhere in the table row) - Add multiple item form show/hide - Add multiple item warning when adding 100+ items
Created attachment 77876 [details] [review] Bug 21091: Move add item template JavaScript to a separate file This patch moves the JavaScript in the add item template to separate files: 1 JS file and 1 include file containing translatable strings. While moving the JS to cataloging_additem.js I have made some changes to quiet ESLint warnings (spacing, variable definition). To test, apply the patch and open the add item page for an existing record. Test the various JS-driven functionalities: - Table sorting - Table column configuration - Table searching - Table inline edit/delete links (click anywhere in the table row) - Add multiple item form show/hide - Add multiple item warning when adding 100+ items Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Please rebase on top of bug 13618. I do not think we should move the declaration of columns_settings in the .inc, it should be stay close to the datatables init.
Owen, can you please rebase and take a look at Jonathan's comment#3? Thx!
Created attachment 82707 [details] [review] Bug 21091: Move add item template JavaScript to a separate file This patch moves the JavaScript in the add item template to separate files: 1 JS file and 1 include file containing translatable strings. While moving the JS to cataloging_additem.js I have made some changes to quiet ESLint warnings (spacing, variable definition). To test, apply the patch and open the add item page for an existing record. Test the various JS-driven functionalities: - Table sorting - Table column configuration - Table searching - Table inline edit/delete links (click anywhere in the table row) - Add multiple item form show/hide - Add multiple item warning when adding 100+ items
Created attachment 82708 [details] [review] Bug 21091: Move add item template JavaScript to a separate file This patch moves the JavaScript in the add item template to separate files: 1 JS file and 1 include file containing translatable strings. While moving the JS to cataloging_additem.js I have made some changes to quiet ESLint warnings (spacing, variable definition). To test, apply the patch and open the add item page for an existing record. Test the various JS-driven functionalities: - Table sorting - Table column configuration - Table searching - Table inline edit/delete links (click anywhere in the table row) - Add multiple item form show/hide - Add multiple item warning when adding 100+ items
(In reply to Jonathan Druart from comment #3) > I do not think we should move the declaration of columns_settings in the > .inc, it should be stay close to the datatables init. I don't think it makes sense to create a whole new <script> block for columns_settings when it can be included in the include file.
Created attachment 85205 [details] [review] Bug 21091: Move add item template JavaScript to a separate file This patch moves the JavaScript in the add item template to separate files: 1 JS file and 1 include file containing translatable strings. While moving the JS to cataloging_additem.js I have made some changes to quiet ESLint warnings (spacing, variable definition). To test, apply the patch and open the add item page for an existing record. Test the various JS-driven functionalities: - Table sorting - Table column configuration - Table searching - Table inline edit/delete links (click anywhere in the table row) - Add multiple item form show/hide - Add multiple item warning when adding 100+ items Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>
Hi Owen, there are some 'red flags' in the QA script, can you please take a look and fix/comment? In testing it did work well so far: FAIL koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc OK filters OK forbidden patterns OK git manipulation FAIL js_in_body A <script> tag found inside head, must be moved to the body (see bug 17858) OK spelling OK tt_valid FAIL valid_template : filter not found
(In reply to Katrin Fischer from comment #9) > > FAIL js_in_body > A <script> tag found inside head, must be moved to the body (see bug 17858) This looks to me like it's a bug in the QA script? > OK spelling > OK tt_valid > FAIL valid_template > : filter not found I don't understand this error...
I am with you... I am not sure what to make of those 2 either. @Jonathan - Can you help?
(In reply to Katrin Fischer from comment #9) > FAIL koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc > FAIL js_in_body > A <script> tag found inside head, must be moved to the body (see bug 17858) This is a bug indeed, I will try to fix it. > OK spelling > OK tt_valid > FAIL valid_template > : filter not found This is not a bug, [% USE raw %] is missing.
Created attachment 85499 [details] [review] Bug 22015: Add missing USE raw statement
Created attachment 85500 [details] [review] Bug 21091: Add missing USE raw statement
(In reply to Jonathan Druart from comment #12) > (In reply to Katrin Fischer from comment #9) > > FAIL koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc > > FAIL js_in_body > > A <script> tag found inside head, must be moved to the body (see bug 17858) > > This is a bug indeed, I will try to fix it. See https://gitlab.com/koha-community/qa-test-tools/issues/12
Thx Jonathan!
Created attachment 85626 [details] [review] Bug 21091: Move add item template JavaScript to a separate file This patch moves the JavaScript in the add item template to separate files: 1 JS file and 1 include file containing translatable strings. While moving the JS to cataloging_additem.js I have made some changes to quiet ESLint warnings (spacing, variable definition). To test, apply the patch and open the add item page for an existing record. Test the various JS-driven functionalities: - Table sorting - Table column configuration - Table searching - Table inline edit/delete links (click anywhere in the table row) - Add multiple item form show/hide - Add multiple item warning when adding 100+ items Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 85627 [details] [review] Bug 21091: Add missing USE raw statement Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Awesome work all! Pushed to master for 19.05
Enhancement will not be backported to 18.11.x series.