Bug 24510 - When placing a hold, cursor doesn't focus on patron name
Summary: When placing a hold, cursor doesn't focus on patron name
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-24 14:30 UTC by Kelly McElligott
Modified: 2020-04-03 20:38 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.05


Attachments
Bug 24510: Add focus to Patron/club input (1.08 KB, patch)
2020-01-24 15:35 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 24510: Add focus to Patron/club input (1.14 KB, patch)
2020-01-24 20:25 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24510: [Alternate] When Placing a Hold, cursor doesn't focus on Patron Name (3.09 KB, patch)
2020-02-26 16:05 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 24510: [Alternate] When Placing a Hold, cursor doesn't focus on Patron Name (2.69 KB, patch)
2020-02-26 16:29 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 24510: [Alternate] When Placing a Hold, cursor doesn't focus on Patron Name (2.69 KB, patch)
2020-02-26 16:31 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 24510: Add focus to Patron/club input (1.22 KB, patch)
2020-02-26 16:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24510: When Placing a Hold, cursor doesn't focus on Patron Name (3.15 KB, patch)
2020-02-26 16:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24510: Code cleaning (2.37 KB, patch)
2020-02-26 16:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24510: When Placing a Hold, cursor doesn't focus on Patron Name (3.21 KB, patch)
2020-02-26 16:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24510: Code cleaning (2.37 KB, patch)
2020-02-26 16:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24510: Add missing filter (1001 bytes, patch)
2020-03-16 11:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24510: Add focus to Patron/club input (1.27 KB, patch)
2020-03-16 21:34 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24510: When Placing a Hold, cursor doesn't focus on Patron Name (3.26 KB, patch)
2020-03-16 21:34 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24510: Code cleaning (2.43 KB, patch)
2020-03-16 21:34 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24510: Add missing filter (1.03 KB, patch)
2020-03-16 21:34 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 Kelly McElligott 2020-01-24 14:30:19 UTC
To reproduce: 

1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold on the left, it does the same thing. 
3. Note that the cursor does not go to Patron Name (for whom to place the hold for), it goes to the Top Search bar under Checkout.  

In 19.05, the cursor does go to the Patron Name during this process and that makes sense from a workflow standpoint.
Comment 1 Lucas Gass 2020-01-24 15:35:23 UTC
Created attachment 97887 [details] [review]
Bug 24510: Add focus to Patron/club input

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold on the left, it does the same thing. 
3. Note that the cursor does not go to Patron Name (for whom to place the hold for), it goes to the Top Search bar under Checkout.  
4. Apply patch and reload the page. 
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.
Comment 2 ByWater Sandboxes 2020-01-24 20:25:09 UTC
Created attachment 97922 [details] [review]
Bug 24510: Add focus to Patron/club input

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 3 Jonathan Druart 2020-02-05 13:58:04 UTC
What is the purpose of the test?
  if ( $(".focus").is(":visible") )

I do not understand your patch, neither why it works. I have the feeling that it is not the correct way to do what you want.

We already have .focus in this DOM (the header search), and the same .focus() applied on them (in staff-global.js).
Comment 4 Jonathan Druart 2020-02-05 13:58:35 UTC
CCing Owen, maybe he will know what's going on here.
Comment 5 Owen Leonard 2020-02-26 16:05:08 UTC
Created attachment 99658 [details] [review]
Bug 24510: [Alternate] When Placing a Hold, cursor doesn't focus on Patron Name

This alternate patch tries to implement a fix in a more "correct" way by
tying the cursor focus to the initialization of the jQueryUI tabs. By
configuring both the "create" and "activate" events we can make sure the
correct input field is focused.

I think the only advantage of this patch over the other one is that
tying the focus to the tabs activation makes it a little more obvious
where in the DOM loading sequence the focus is being set.

To test, follow the original patch's test plan:

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold
   on the left, it does the same thing.
3. Note that the cursor does not go to Patron Name (for whom to place
   the hold for), it goes to the Top Search bar under Checkout.
4. Apply patch and reload the page.
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.
Comment 6 Lucas Gass 2020-02-26 16:29:41 UTC
Created attachment 99659 [details] [review]
Bug 24510: [Alternate] When Placing a Hold, cursor doesn't focus on Patron Name

This alternate patch tries to implement a fix in a more "correct" way by
tying the cursor focus to the initialization of the jQueryUI tabs. By
configuring both the "create" and "activate" events we can make sure the
correct input field is focused.

I think the only advantage of this patch over the other one is that
tying the focus to the tabs activation makes it a little more obvious
where in the DOM loading sequence the focus is being set.

To test, follow the original patch's test plan:

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold
   on the left, it does the same thing.
3. Note that the cursor does not go to Patron Name (for whom to place
   the hold for), it goes to the Top Search bar under Checkout.
4. Apply patch and reload the page.
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Lucas Gass 2020-02-26 16:31:52 UTC
Created attachment 99660 [details] [review]
Bug 24510: [Alternate] When Placing a Hold, cursor doesn't focus on Patron Name

This alternate patch tries to implement a fix in a more "correct" way by
tying the cursor focus to the initialization of the jQueryUI tabs. By
configuring both the "create" and "activate" events we can make sure the
correct input field is focused.

I think the only advantage of this patch over the other one is that
tying the focus to the tabs activation makes it a little more obvious
where in the DOM loading sequence the focus is being set.

To test, follow the original patch's test plan:

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold
   on the left, it does the same thing.
3. Note that the cursor does not go to Patron Name (for whom to place
   the hold for), it goes to the Top Search bar under Checkout.
4. Apply patch and reload the page.
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 8 Jonathan Druart 2020-02-26 16:40:54 UTC
Created attachment 99661 [details] [review]
Bug 24510: Add focus to Patron/club input

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2020-02-26 16:40:58 UTC
Created attachment 99662 [details] [review]
Bug 24510: When Placing a Hold, cursor doesn't focus on Patron Name

This alternate patch tries to implement a fix in a more "correct" way by
tying the cursor focus to the initialization of the jQueryUI tabs. By
configuring both the "create" and "activate" events we can make sure the
correct input field is focused.

I think the only advantage of this patch over the other one is that
tying the focus to the tabs activation makes it a little more obvious
where in the DOM loading sequence the focus is being set.

To test, follow the original patch's test plan:

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold
   on the left, it does the same thing.
3. Note that the cursor does not go to Patron Name (for whom to place
   the hold for), it goes to the Top Search bar under Checkout.
4. Apply patch and reload the page.
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2020-02-26 16:41:01 UTC
Created attachment 99663 [details] [review]
Bug 24510: Code cleaning

Additional test plan:
Create 3 clubs: abc adf axy
place a hold for on of those club, search for a club 'a'
you will get the focus on the "Clubs" tab

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2020-02-26 16:52:10 UTC
Created attachment 99665 [details] [review]
Bug 24510: When Placing a Hold, cursor doesn't focus on Patron Name

This alternate patch tries to implement a fix in a more "correct" way by
tying the cursor focus to the initialization of the jQueryUI tabs. By
configuring both the "create" and "activate" events we can make sure the
correct input field is focused.

I think the only advantage of this patch over the other one is that
tying the focus to the tabs activation makes it a little more obvious
where in the DOM loading sequence the focus is being set.

To test, follow the original patch's test plan:

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold
   on the left, it does the same thing.
3. Note that the cursor does not go to Patron Name (for whom to place
   the hold for), it goes to the Top Search bar under Checkout.
4. Apply patch and reload the page.
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2020-02-26 16:52:14 UTC
Created attachment 99666 [details] [review]
Bug 24510: Code cleaning

Additional test plan:
Create 3 clubs: abc adf axy
place a hold for on of those club, search for a club 'a'
you will get the focus on the "Clubs" tab

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2020-02-26 16:53:17 UTC
Lucas, I re-added your signoff to Owen's patch!
Comment 14 Katrin Fischer 2020-03-15 14:23:52 UTC
I am getting a QA test tool fail here, please check:
 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
   FAIL	  filters
		missing_filter at line 982 (                active: [% active %],)
Comment 15 Jonathan Druart 2020-03-16 11:16:48 UTC
Created attachment 100733 [details] [review]
Bug 24510: Add missing filter
Comment 16 Katrin Fischer 2020-03-16 21:34:16 UTC
Created attachment 100827 [details] [review]
Bug 24510: Add focus to Patron/club input

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2020-03-16 21:34:19 UTC
Created attachment 100828 [details] [review]
Bug 24510: When Placing a Hold, cursor doesn't focus on Patron Name

This alternate patch tries to implement a fix in a more "correct" way by
tying the cursor focus to the initialization of the jQueryUI tabs. By
configuring both the "create" and "activate" events we can make sure the
correct input field is focused.

I think the only advantage of this patch over the other one is that
tying the focus to the tabs activation makes it a little more obvious
where in the DOM loading sequence the focus is being set.

To test, follow the original patch's test plan:

TEST PLAN:
1. Go to Biblio Record
2. Place Hold (request.pl) - either the Hold above the Bib or the Hold
   on the left, it does the same thing.
3. Note that the cursor does not go to Patron Name (for whom to place
   the hold for), it goes to the Top Search bar under Checkout.
4. Apply patch and reload the page.
5. The focus should now be correctly set.
6. Toggle between 'Patrons' and 'Club' tabs.
7. Focus should stay set.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2020-03-16 21:34:23 UTC
Created attachment 100829 [details] [review]
Bug 24510: Code cleaning

Additional test plan:
Create 3 clubs: abc adf axy
place a hold for on of those club, search for a club 'a'
you will get the focus on the "Clubs" tab

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Katrin Fischer 2020-03-16 21:34:28 UTC
Created attachment 100830 [details] [review]
Bug 24510: Add missing filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Martin Renvoize 2020-03-19 09:39:38 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 21 Joy Nelson 2020-04-03 20:38:19 UTC
backported to 19.11.x branch for 19.11.05