|
Description
Kyle M Hall (khall)
2025-10-16 23:19:29 UTC
Created attachment 188062 [details] [review] Bug 41040: Empty patron search from the header should not trigger a patron search If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search. Test Plan: 1) Click the "Search patrons" link on the header, then the arrow button 2) Note an empty patron search is performed immediately 3) Apply this patch 4) Restart all the things! 5) Repeat step 1 6) Note a paton search is no longer triggered automatically The patch works. But... I often use this to get the list of patrons. Although my use case might not be what "normal" staff users do since I don't work in a library. (In reply to Caroline Cyr La Rose from comment #2) > The patch works. > > But... > > I often use this to get the list of patrons. Although my use case might not > be what "normal" staff users do since I don't work in a library. The letter searches should still work for your use case! (In reply to Caroline Cyr La Rose from comment #2) > The patch works. > > But... > > I often use this to get the list of patrons. Although my use case might not > be what "normal" staff users do since I don't work in a library. As a developer, I do this a lot too. But is this actually a work flow any real life librarian uses? Certainly not in a large system. (In reply to Lucas Gass (lukeg) from comment #4) > (In reply to Caroline Cyr La Rose from comment #2) > > The patch works. > > > > But... > > > > I often use this to get the list of patrons. Although my use case might not > > be what "normal" staff users do since I don't work in a library. > > As a developer, I do this a lot too. But is this actually a work flow any > real life librarian uses? Certainly not in a large system. Hence my sentence > > [...] Although my use case might not > > be what "normal" staff users do since I don't work in a library. (In reply to Lucas Gass (lukeg) from comment #4) > (In reply to Caroline Cyr La Rose from comment #2) > > The patch works. > > > > But... > > > > I often use this to get the list of patrons. Although my use case might not > > be what "normal" staff users do since I don't work in a library. > > As a developer, I do this a lot too. But is this actually a work flow any > real life librarian uses? Certainly not in a large system. Reading the comments and I was thinking how I will often do this in KTD but not my real world systems. If I recall correctly, Keycloak went through a change like this. Years ago, you used to be able to do an empty search to get all users, but these days you have to put in a * to get all users. So that's another option which would cover all use-cases. So long as there was a hint to say that * gets the full list... it could work. After trying this one out, I don't think this is ready. Why not just disable the submit button in the header after it's pressed? If you use the filters in the header search to create a search for something like Category: Patron with Library: Centerville and you click search, it won't do the search with this patch. But I think that would break backwards compatibility. Created attachment 189016 [details] [review] Bug 41040: Empty patron search from the header should not trigger a patron search If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search. Test Plan: 1) Click the "Search patrons" link on the header, then the arrow button 2) Note an empty patron search is performed immediately 3) Apply this patch 4) Restart all the things! 5) Repeat step 1 6) Note a paton search is no longer triggered automatically Created attachment 189017 [details] [review] Bug 41040: Prevent form submission if no filters have been selected Patch from commit 532327a Created attachment 189018 [details] [review] Bug 41040: Use tooltip for message instead of alert Patch from commit bb8268d If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search. Test Plan: 1) Click the "Search patrons" link on the header, then the arrow button 2) Note an empty patron search is performed immediately 3) Apply this patch 4) Restart all the things! 5) Repeat step 1 6) Note a paton search is no longer triggered automatically Created attachment 189197 [details] [review] Bug 41040: Prevent form submission if no filters have been selected Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 189198 [details] [review] Bug 41040: Use tooltip for message instead of alert Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 189199 [details] [review] Bug 41040: (follow-up) Tooltip text change and remove unnecessary class - I think "Please enter a card number or name" sounds friendlier - We don't add a "btn-primary" class to these buttons Getting a sha1/fake ancestor error when applying the patch: git bz apply 41040 Bug 41040 - Empty patron search from the header should not trigger a patron search 189197 - Bug 41040: Prevent form submission if no filters have been selected 189198 - Bug 41040: Use tooltip for message instead of alert 189199 - Bug 41040: (follow-up) Tooltip text change and remove unnecessary class Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 41040: Prevent form submission if no filters have been selected error: sha1 information is lacking or useless (members/member.pl). error: could not build fake ancestor Patch failed at 0001 Bug 41040: Prevent form submission if no filters have been selected Created attachment 189508 [details] [review] Bug 41040: Empty patron search from the header should not trigger a patron search If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search. Test Plan: 1) Click the "Search patrons" link on the header, then the arrow button 2) Note an empty patron search is performed immediately 3) Apply this patch 4) Restart all the things! 5) Repeat step 1 6) Note a paton search is no longer triggered automatically Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 189509 [details] [review] Bug 41040: Prevent form submission if no filters have been selected Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 189510 [details] [review] Bug 41040: Use tooltip for message instead of alert Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 189511 [details] [review] Bug 41040: (follow-up) Tooltip text change and remove unnecessary class - I think "Please enter a card number or name" sounds friendlier - We don't add a "btn-primary" class to these buttons Created attachment 189517 [details] [review] Bug 41040: Empty patron search from the header should not trigger a patron search If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search. Test Plan: 1) Click the "Search patrons" link on the header, then the arrow button 2) Note an empty patron search is performed immediately 3) Apply this patch 4) Restart all the things! 5) Repeat step 1 6) Note a paton search is no longer triggered automatically Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Created attachment 189518 [details] [review] Bug 41040: Prevent form submission if no filters have been selected Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Created attachment 189519 [details] [review] Bug 41040: Use tooltip for message instead of alert Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Created attachment 189520 [details] [review] Bug 41040: (follow-up) Tooltip text change and remove unnecessary class - I think "Please enter a card number or name" sounds friendlier - We don't add a "btn-primary" class to these buttons Signed-off-by: David Nind <david@davidnind.com> I think I personally would prefer it going to the patrons page and not automatically doing a search. But, I'm not sure how this is used in real life. (In reply to David Nind from comment #24) > I think I personally would prefer it going to the patrons page and not > automatically doing a search. > > But, I'm not sure how this is used in real life. However, you can get this behavour by clicking the "Patrons" link in the header. Why are the script tags being added inside the <form> element. WC3 HTML validator does consider this valid but it seems unusual to me. Is there a reason to do this? Created attachment 193117 [details] [review] Bug 41040: (follow-up) Move JS to global JS file (In reply to Owen Leonard from comment #27) > Created attachment 193117 [details] [review] [review] > Bug 41040: (follow-up) Move JS to global JS file Nice Owen, this is exactly what I thought was needed. Created attachment 193118 [details] [review] Bug 41040: Empty patron search from the header should not trigger a patron search If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search. Test Plan: 1) Click the "Search patrons" link on the header, then the arrow button 2) Note an empty patron search is performed immediately 3) Apply this patch 4) Restart all the things! 5) Repeat step 1 6) Note a paton search is no longer triggered automatically Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 193119 [details] [review] Bug 41040: Prevent form submission if no filters have been selected Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 193120 [details] [review] Bug 41040: Use tooltip for message instead of alert Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 193121 [details] [review] Bug 41040: (follow-up) Tooltip text change and remove unnecessary class - I think "Please enter a card number or name" sounds friendlier - We don't add a "btn-primary" class to these buttons Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 193122 [details] [review] Bug 41040: (follow-up) Move JS to global JS file Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Thank you Owen! Nice work everyone! Pushed to main for 26.05 |