Bug 19786 - Move template JavaScript to the footer: Authorities, part 2
Summary: Move template JavaScript to the footer: Authorities, part 2
Status: CLOSED 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: Academy
Depends on: 19785
Blocks: 17858 19949 19983
  Show dependency treegraph
 
Reported: 2017-12-08 19:23 UTC by Owen Leonard
Modified: 2018-12-03 20:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 19786: Move template JavaScript to the footer: Authorities, part 2 (22.63 KB, patch)
2017-12-12 16:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 19786: Move template JavaScript to the footer: Authorities, part 2 (22.69 KB, patch)
2018-02-16 15:40 UTC, Claire Gravely
Details | Diff | Splinter Review
Screenshot of too small pop-up window for 'create authority' (82.92 KB, image/png)
2018-02-18 13:16 UTC, Katrin Fischer
Details
Bug 19786: (follow-up) Correct js include path, popup window size (4.28 KB, patch)
2018-02-20 14:34 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 19786: (follow-up) Correct js include path, popup window size (4.34 KB, patch)
2018-02-26 14:53 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 19786: Move template JavaScript to the footer: Authorities, part 2 (22.81 KB, patch)
2018-02-28 07:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 19786: (follow-up) Correct js include path, popup window size (4.45 KB, patch)
2018-02-28 07:13 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2017-12-08 19:23:20 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 more of the authorities templates.
Comment 1 Owen Leonard 2017-12-12 16:37:42 UTC Comment hidden (obsolete)
Comment 2 Claire Gravely 2018-02-16 15:40:56 UTC
Created attachment 71820 [details] [review]
Bug 19786: Move template JavaScript to the footer: Authorities, part 2

This patch modifies the staff client patron lists templates so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of
each modified template.

I've made one change to the JavaScript in addition to moving it: I've
made it so that the blank window which pops up briefly in this process
is 100px x 100px instead of full screen.

- Cataloging -> Add or edit bibliographic record in a framework which
  has authorities linked to a tag
  -> Click authorities plugin link
     -> Create new authority button
     -> Autocomplete on text inputs (except "Search all headings")
     -> Search
        -> Select authority record ("choose")
           -> Click authorities plugin link again
              -> Clear field

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 3 Katrin Fischer 2018-02-18 13:16:58 UTC
Created attachment 71903 [details]
Screenshot of too small pop-up window for 'create authority'

"create authority" opens in a really small window for me. Can you please check?

Tested with Firefox 58.0.2 (64-bit)
Comment 4 Katrin Fischer 2018-02-18 13:18:57 UTC
I think there are also some missing VERSION:

+    <script type="text/javascript" src="[% interface %]/[% theme %]/js/auth-finder-search.js"></script>

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/authorities/auth_finder.tt
   FAIL	  forbidden patterns
		forbidden pattern: Include [% KOHA_VERSION %] in js paths (bug 12904) - May be false positive (line 31)

  valid_template

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
   FAIL	  forbidden patterns
		forbidden pattern: Include [% KOHA_VERSION %] in js paths (bug 12904) - May be false positive (line 103)
Comment 5 Owen Leonard 2018-02-20 14:34:36 UTC
Created attachment 72002 [details] [review]
Bug 19786: (follow-up) Correct js include path, popup window size

This follow-up adds the required KOHA_VERSION variable to two templates
where it was missing.

This patch also adds a 'window_size' parameter to a popup window
function so that self-closing windows like blinddetail-biblio-search.pl
can appear small and others at a reasonable size.

To test, apply the patch and clear your browser cache if
necessary.

- Confirm that the QA tools do not complain about missing KOHA_VERSION
  in auth_finder.tt and searchresultlist_auth.tt.

- Open a bibliographic record for editing in the basic editor using a
  framework in which a field is linked to authorities.
- Trigger the authority selection window for that field.
- Click the "Clear field" button at the top of the authority search
  pop-up window. Another smaller popup window should briefly appear, and
  then both windows should close.
- Trigger the authority selection window again.
- Click the "Create new authority" button. A new window should appear
  with the MARC authority editor. The window should be a usable size.
Comment 6 Claire Gravely 2018-02-26 14:53:50 UTC
Created attachment 72212 [details] [review]
Bug 19786: (follow-up) Correct js include path, popup window size

This follow-up adds the required KOHA_VERSION variable to two templates
where it was missing.

This patch also adds a 'window_size' parameter to a popup window
function so that self-closing windows like blinddetail-biblio-search.pl
can appear small and others at a reasonable size.

To test, apply the patch and clear your browser cache if
necessary.

- Confirm that the QA tools do not complain about missing KOHA_VERSION
  in auth_finder.tt and searchresultlist_auth.tt.

- Open a bibliographic record for editing in the basic editor using a
  framework in which a field is linked to authorities.
- Trigger the authority selection window for that field.
- Click the "Clear field" button at the top of the authority search
  pop-up window. Another smaller popup window should briefly appear, and
  then both windows should close.
- Trigger the authority selection window again.
- Click the "Create new authority" button. A new window should appear
  with the MARC authority editor. The window should be a usable size.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Comment 7 Katrin Fischer 2018-02-28 07:12:58 UTC
Created attachment 72287 [details] [review]
Bug 19786: Move template JavaScript to the footer: Authorities, part 2

This patch modifies the staff client patron lists templates so that
JavaScript is included in the footer instead of the header.

To test, apply the patch and test the JavaScript-driven features of
each modified template.

I've made one change to the JavaScript in addition to moving it: I've
made it so that the blank window which pops up briefly in this process
is 100px x 100px instead of full screen.

- Cataloging -> Add or edit bibliographic record in a framework which
  has authorities linked to a tag
  -> Click authorities plugin link
     -> Create new authority button
     -> Autocomplete on text inputs (except "Search all headings")
     -> Search
        -> Select authority record ("choose")
           -> Click authorities plugin link again
              -> Clear field

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2018-02-28 07:13:01 UTC
Created attachment 72288 [details] [review]
Bug 19786: (follow-up) Correct js include path, popup window size

This follow-up adds the required KOHA_VERSION variable to two templates
where it was missing.

This patch also adds a 'window_size' parameter to a popup window
function so that self-closing windows like blinddetail-biblio-search.pl
can appear small and others at a reasonable size.

To test, apply the patch and clear your browser cache if
necessary.

- Confirm that the QA tools do not complain about missing KOHA_VERSION
  in auth_finder.tt and searchresultlist_auth.tt.

- Open a bibliographic record for editing in the basic editor using a
  framework in which a field is linked to authorities.
- Trigger the authority selection window for that field.
- Click the "Clear field" button at the top of the authority search
  pop-up window. Another smaller popup window should briefly appear, and
  then both windows should close.
- Trigger the authority selection window again.
- Click the "Create new authority" button. A new window should appear
  with the MARC authority editor. The window should be a usable size.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2018-03-26 20:35:46 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 10 Nick Clemens 2018-04-23 22:49:25 UTC
Awesome work all, enhancement, not backported for stable