Bug 24619 - Phase out jquery.cookie.js: MARC Frameworks
Summary: Phase out jquery.cookie.js: MARC Frameworks
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 23944
Blocks:
  Show dependency treegraph
 
Reported: 2020-02-10 17:57 UTC by Owen Leonard
Modified: 2020-02-17 13:48 UTC (History)
1 user (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


Attachments
Bug 23947: Phase out jquery.cookie.js: MARC Frameworks (2.34 KB, patch)
2020-02-10 18:18 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23947: Phase out jquery.cookie.js: MARC Frameworks (2.38 KB, patch)
2020-02-14 10:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 23947: Phase out jquery.cookie.js: MARC Frameworks (2.44 KB, patch)
2020-02-14 15:17 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 Owen Leonard 2020-02-10 17:57:09 UTC
The MARC Framework page uses a cookie to set a preference for whether to "display only used tags/subfields."

This process should use the newer cookie library, js-cookie.
Comment 1 Owen Leonard 2020-02-10 18:18:53 UTC
Created attachment 98677 [details] [review]
Bug 23947: Phase out jquery.cookie.js: MARC Frameworks

This patch removes the use of the jquery.cookie plugin on the MARC
Frameworks page and replaces it with a call to the new js-cookie
library.

To test, apply the patch and go to Administration -> MARC
bibliographic frameworks.

 - Choose the 'MARC structure' menu item for one of the frameworks
   listed.
 - On the page which lists the tags in the framework, check the box
   labeled "Display only used tags/subfields." The page should reload.
 - The checkbox should remain checked and the list of tags should now
   show only used tags.
 - Uncheck the checkbox and the page should reload again.

You can also follow the changes to the cookie using the browser's
developer console. Look for a cookie named
'marctagstructure_selectdisplay' and confirm that the value flips from 0
to 1 and back.

https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector
https://developers.google.com/web/tools/chrome-devtools/storage/cookies
Comment 2 David Nind 2020-02-14 10:00:32 UTC
Created attachment 98920 [details] [review]
Bug 23947: Phase out jquery.cookie.js: MARC Frameworks

This patch removes the use of the jquery.cookie plugin on the MARC
Frameworks page and replaces it with a call to the new js-cookie
library.

To test, apply the patch and go to Administration -> MARC
bibliographic frameworks.

 - Choose the 'MARC structure' menu item for one of the frameworks
   listed.
 - On the page which lists the tags in the framework, check the box
   labeled "Display only used tags/subfields." The page should reload.
 - The checkbox should remain checked and the list of tags should now
   show only used tags.
 - Uncheck the checkbox and the page should reload again.

You can also follow the changes to the cookie using the browser's
developer console. Look for a cookie named
'marctagstructure_selectdisplay' and confirm that the value flips from 0
to 1 and back.

https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector
https://developers.google.com/web/tools/chrome-devtools/storage/cookies

https://bugs.koha-community.org/show_bug.cgi?id=24619

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2020-02-14 15:17:22 UTC
Created attachment 98961 [details] [review]
Bug 23947: Phase out jquery.cookie.js: MARC Frameworks

This patch removes the use of the jquery.cookie plugin on the MARC
Frameworks page and replaces it with a call to the new js-cookie
library.

To test, apply the patch and go to Administration -> MARC
bibliographic frameworks.

 - Choose the 'MARC structure' menu item for one of the frameworks
   listed.
 - On the page which lists the tags in the framework, check the box
   labeled "Display only used tags/subfields." The page should reload.
 - The checkbox should remain checked and the list of tags should now
   show only used tags.
 - Uncheck the checkbox and the page should reload again.

You can also follow the changes to the cookie using the browser's
developer console. Look for a cookie named
'marctagstructure_selectdisplay' and confirm that the value flips from 0
to 1 and back.

https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector
https://developers.google.com/web/tools/chrome-devtools/storage/cookies

https://bugs.koha-community.org/show_bug.cgi?id=24619

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Martin Renvoize 2020-02-17 13:48:47 UTC
Nice work everyone!

Pushed to master for 20.05