Bug 29932 - Phase out jquery.cookie.js: bibs_selected (Browse selected records)
Summary: Phase out jquery.cookie.js: bibs_selected (Browse selected records)
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 19290
Blocks: 27750
  Show dependency treegraph
 
Reported: 2022-01-24 17:54 UTC by Owen Leonard
Modified: 2022-02-24 23:37 UTC (History)
4 users (show)

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


Attachments
Bug 29932: Use localStorage instead of cookie for bibs_selected (2.39 KB, patch)
2022-01-24 18:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29932: Use localStorage instead of cookie for bibs_selected (2.44 KB, patch)
2022-01-25 17:18 UTC, David Nind
Details | Diff | Splinter Review
Bug 29932: Use localStorage instead of cookie for bibs_selected (2.51 KB, patch)
2022-01-27 10:17 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2022-01-24 17:54:10 UTC
The "Browse selected records" feature (enabled by the BrowseResultSelection system preference) sets a "bibs_selected" cookie when the user checks items in staff interface catalog search results. This cookie can be replaced with the use of localStorage.
Comment 1 Owen Leonard 2022-01-24 18:13:32 UTC
Created attachment 129734 [details] [review]
Bug 29932: Use localStorage instead of cookie for bibs_selected

This patch replaces the use of the jquery.cookie.js plugin in the
"Browse selected records" feature. The feature is modified to use
localStorage instead of cookies.

To test, apply the patch and go to Administration -> System preferences.

 - Enable the "BrowseResultSelection" system preference.
 - Perform a catalog search which will return multiple results.
 - On the search results page, check the checkbox for a number of
   titles.
 - Click the "Browse selected biblios" button in the toolbar.
 - You should be directed to the detail page for the first title you
   checked.
 - Clicking the right-arrow in the sidebar should take you
   through each one of your selected titles.
 - When you click the "Results" link in the sidebar you should be
   returned to the same search results set and the same titles should be
   checked.
 _ If you uncheck those titles and reload the page the checkboxes should
   remain unchecked.
 - If you log out of the staff interface the "bibs_selected" item in
   localStorage should be deleted. See, for example,
   https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for
   information about viewing local storage.
Comment 2 David Nind 2022-01-25 17:18:10 UTC
Created attachment 129809 [details] [review]
Bug 29932: Use localStorage instead of cookie for bibs_selected

This patch replaces the use of the jquery.cookie.js plugin in the
"Browse selected records" feature. The feature is modified to use
localStorage instead of cookies.

To test, apply the patch and go to Administration -> System preferences.

 - Enable the "BrowseResultSelection" system preference.
 - Perform a catalog search which will return multiple results.
 - On the search results page, check the checkbox for a number of
   titles.
 - Click the "Browse selected biblios" button in the toolbar.
 - You should be directed to the detail page for the first title you
   checked.
 - Clicking the right-arrow in the sidebar should take you
   through each one of your selected titles.
 - When you click the "Results" link in the sidebar you should be
   returned to the same search results set and the same titles should be
   checked.
 _ If you uncheck those titles and reload the page the checkboxes should
   remain unchecked.
 - If you log out of the staff interface the "bibs_selected" item in
   localStorage should be deleted. See, for example,
   https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for
   information about viewing local storage.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Jonathan Druart 2022-01-27 10:17:59 UTC
Created attachment 129858 [details] [review]
Bug 29932: Use localStorage instead of cookie for bibs_selected

This patch replaces the use of the jquery.cookie.js plugin in the
"Browse selected records" feature. The feature is modified to use
localStorage instead of cookies.

To test, apply the patch and go to Administration -> System preferences.

 - Enable the "BrowseResultSelection" system preference.
 - Perform a catalog search which will return multiple results.
 - On the search results page, check the checkbox for a number of
   titles.
 - Click the "Browse selected biblios" button in the toolbar.
 - You should be directed to the detail page for the first title you
   checked.
 - Clicking the right-arrow in the sidebar should take you
   through each one of your selected titles.
 - When you click the "Results" link in the sidebar you should be
   returned to the same search results set and the same titles should be
   checked.
 _ If you uncheck those titles and reload the page the checkboxes should
   remain unchecked.
 - If you log out of the staff interface the "bibs_selected" item in
   localStorage should be deleted. See, for example,
   https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for
   information about viewing local storage.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Fridolin Somers 2022-02-10 01:36:45 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 5 Andrew Fuerste-Henry 2022-02-21 16:29:15 UTC
I see this has been pushed to 21.11.
Pushed to 21.05.x for 21.05.11
Comment 6 Victor Grousset/tuxayo 2022-02-24 23:37:42 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.