Bug 19786

Summary: Move template JavaScript to the footer: Authorities, part 2
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, katrin.fischer, nick, testopia
Version: MainKeywords: Academy
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:
Bug Depends on: 19785    
Bug Blocks: 17858, 19949, 19983    
Attachments: Bug 19786: Move template JavaScript to the footer: Authorities, part 2
Bug 19786: Move template JavaScript to the footer: Authorities, part 2
Screenshot of too small pop-up window for 'create authority'
Bug 19786: (follow-up) Correct js include path, popup window size
Bug 19786: (follow-up) Correct js include path, popup window size
Bug 19786: Move template JavaScript to the footer: Authorities, part 2
Bug 19786: (follow-up) Correct js include path, popup window size

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