[Bug 27725] New: Use JavaScript to set history state during patron search
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Bug ID: 27725 Summary: Use JavaScript to set history state during patron search Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Patrons Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com The patron search page can be annoying because it never remembers where you left off. If I click a letter to browse by last name, follow a link, and then back up, the page doesn't remember that I was in the middle of a search. There are a lot of aspects which can be improved, but I have a patch which will address the specific case of the first letter search ("Browse by last name"). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 117009 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117009&action=edit Bug 27725: Use JavaScript to set history state during patron search This patch modifies the patron search page so that clicks on the "Browse by last name" letters add an entry to the browser history, allowing the user to click back and forth from results while preserving their search. To test, apply the patch and go to Patrons in the staff interface. - Click one of the "Browse by last name" letters. - The table of search results should load the correct data. - In the browser's location bar you should see a query string added to the URL, e.g. /cgi-bin/koha/members/members-home.pl?firstletter=Q - Click another letter. - Click the back button. You should be returned to the search results for your first letter choice. - Clicking the forward button should work correctly as well. - Other patron searches (header search, sidebar search) should continue to work as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #2 from David Nind <david@davidnind.com> --- I like this! The only place it doesn't work is when a letter only has one patron. For example in koha-testing-docker with the letter O. In that case the first time you click on the letter it doesn't give a list of results, it goes straight to the patron. When you press the back button it quickly goes back to the list and then the patron page is loaded again. Not sure whether this can be fixed, or the likelihood of a normal library only having one patron for a letter. I think it would be better to list patrons even if there is only one result, rather than the back button not working as expected - not sure what others think though! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117009|0 |1 is obsolete| | --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 117123 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117123&action=edit Bug 27725: Use JavaScript to set history state during patron search This patch modifies the patron search page so that clicks on the "Browse by last name" letters add an entry to the browser history, allowing the user to click back and forth from results while preserving their search. To test, apply the patch and go to Patrons in the staff interface. - Click one of the "Browse by last name" letters. - The table of search results should load the correct data. - In the browser's location bar you should see a query string added to the URL, e.g. /cgi-bin/koha/members/members-home.pl?firstletter=Q - Click another letter. - Click the back button. You should be returned to the search results for your first letter choice. - Clicking the forward button should work correctly as well. - Other patron searches (header search, sidebar search) should continue to work as expected. EDIT: Clear single-letter querystring history item if only one result was returned. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #4 from David Nind <david@davidnind.com> --- This now works if there is only one result. Thanks for updating to address that behaviour! However, pressing the back button after multiple results for a letter now results in: - the URL changing to members-home.pl - the page remaining with "Patrons found for: begins with 'D'" - the current list of results remaining (D used in this example) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- (In reply to David Nind from comment #4)
- the page remaining with "Patrons found for: begins with 'D'"
This is a bug in master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch modifies the release notes| |process of searching | |patrons by the first letter | |of their surname so that | |the search is added to the | |browser's history. This | |allows the user to use the | |back button to return to | |the search after clicking | |one of the results. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #6 from David Nind <david@davidnind.com> --- Hi Owen. I've finally had another go at this one. For some reason the forward button no longer works (after using the back button). I tested this in Firefox and Google Chrome (latest versions on Ubuntu 18.04). David -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |lucas@bywatersolutions.com --- Comment #7 from Lucas Gass <lucas@bywatersolutions.com> --- I also cannot get the forward button to work after using the back button. Also, if I click "A", then "B" then "C", then "D" it takes me to each of those pages correctly. But if I start pressing the back button I can go back to "C" but no further. If I try to go back any further I see the 'Processing...' box for a split second but noting happens. I am testing in Chrome and FF on MacOS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117123|0 |1 is obsolete| | --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 123881 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123881&action=edit Bug 27725: Use JavaScript to set history state during patron search This patch modifies the patron search page so that clicks on the "Browse by last name" letters add an entry to the browser history, allowing the user to click back and forth from results while preserving their search. To test, apply the patch and go to Patrons in the staff interface. - Click one of the "Browse by last name" letters. - The table of search results should load the correct data. - In the browser's location bar you should see a query string added to the URL, e.g. /cgi-bin/koha/members/members-home.pl?firstletter=Q - Click another letter. - Click the back button. You should be returned to the search results for your first letter choice. - Clicking the forward button should work correctly as well. - Other patron searches (header search, sidebar search) should continue to work as expected. EDIT: Clear single-letter querystring history item if only one result was returned. EDIT 2: Fixed handling of history state changes so that forward and back buttons work correctly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123881|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 123913 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123913&action=edit Bug 27725: Use JavaScript to set history state during patron search This patch modifies the patron search page so that clicks on the "Browse by last name" letters add an entry to the browser history, allowing the user to click back and forth from results while preserving their search. To test, apply the patch and go to Patrons in the staff interface. - Click one of the "Browse by last name" letters. - The table of search results should load the correct data. - In the browser's location bar you should see a query string added to the URL, e.g. /cgi-bin/koha/members/members-home.pl?firstletter=Q - Click another letter. - Click the back button. You should be returned to the search results for your first letter choice. - Clicking the forward button should work correctly as well. - Other patron searches (header search, sidebar search) should continue to work as expected. EDIT: Clear single-letter querystring history item if only one result was returned. EDIT 2: Fixed handling of history state changes so that forward and back buttons work correctly. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #10 from David Nind <david@davidnind.com> --- Testing notes: - Tested using Firefox 91 and Google Chrome 91.0.4472.114 on Ubuntu 18.04 (64 bit) - Back and forward buttons work and display previous results - everything else seems to work as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28867 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28867 [Bug 28867] Use Bootstrap button menu and modal for adding patrons to lists -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123913|0 |1 is obsolete| | --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 125683 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125683&action=edit Bug 27725: Use JavaScript to set history state during patron search This patch modifies the patron search page so that clicks on the "Browse by last name" letters add an entry to the browser history, allowing the user to click back and forth from results while preserving their search. To test, apply the patch and go to Patrons in the staff interface. - Click one of the "Browse by last name" letters. - The table of search results should load the correct data. - In the browser's location bar you should see a query string added to the URL, e.g. /cgi-bin/koha/members/members-home.pl?firstletter=Q - Click another letter. - Click the back button. You should be returned to the search results for your first letter choice. - Clicking the forward button should work correctly as well. - Other patron searches (header search, sidebar search) should continue to work as expected. EDIT: Clear single-letter querystring history item if only one result was returned. EDIT 2: Fixed handling of history state changes so that forward and back buttons work correctly. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Nice improvement! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |jonathan.druart+koha@gmail. | |com --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Regression found: if you are using the patron search in the header, the search is not triggered. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #14 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 125821 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125821&action=edit Bug 27725: (follow-up) Remove code for clearing search results This patch removes code which cleared search results if there was no first-letter search. It was unnecessary for the letter search functionality and made all other searches fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #15 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Patches will be squashed when pushed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27725 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to master |RESOLVED CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org