Bug 35346 - 'Accept essential cookies' should always appear if CookieConsent is enabled
Summary: 'Accept essential cookies' should always appear if CookieConsent is enabled
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 35347
Blocks: 35348
  Show dependency treegraph
 
Reported: 2023-11-16 11:12 UTC by Martin Renvoize (ashimema)
Modified: 2024-05-22 12:33 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:


Attachments
Bug 35346: Update template logic to display 'Essential' (3.32 KB, patch)
2023-11-16 13:24 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 35346: Update template logic to display 'Essential' (3.36 KB, patch)
2023-11-20 10:03 UTC, David Nind
Details | Diff | Splinter Review
Bug 35346: Update template logic to display 'Essential' (3.42 KB, patch)
2024-02-12 15:53 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2023-11-16 11:12:52 UTC
Right now, if you don't have any CookieConsentedJS cookies defined but do have CookieConsent set to 'require' then you are shown the footer bar with just an 'Accept all cookies' button.  This is misleading, the button should be 'Accept essential cookies' as only essential cookies are going to be accepted.. there are no further cookies in 'all'.
Comment 1 Martin Renvoize (ashimema) 2023-11-16 13:24:51 UTC
Created attachment 159050 [details] [review]
Bug 35346: Update template logic to display 'Essential'

This patch updates the cookie consent template logic to always display
the 'Accept essential cookies' button and only expose the 'Accept all
cookies' button when there are additional cookies to accept, i.e. when
JSConsents is populated.

Test plan
1) Enable CookieConsent
2) Note you see 'Accept essential cookies' in both OPAC and Staff client
   until you have accepted them
3) Add a cookie to ConsentJS
4) Note that you will now see 'Accept all cookies' as well as the 'Accept
   essential cookies' button.
Comment 2 David Nind 2023-11-20 10:03:08 UTC
Created attachment 159137 [details] [review]
Bug 35346: Update template logic to display 'Essential'

This patch updates the cookie consent template logic to always display
the 'Accept essential cookies' button and only expose the 'Accept all
cookies' button when there are additional cookies to accept, i.e. when
JSConsents is populated.

Test plan
1) Enable CookieConsent
2) Note you see 'Accept essential cookies' in both OPAC and Staff client
   until you have accepted them
3) Add a cookie to ConsentJS
4) Note that you will now see 'Accept all cookies' as well as the 'Accept
   essential cookies' button.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Victor Grousset/tuxayo 2024-02-11 18:02:53 UTC
All good for me. Waiting for transitive dependency bug 34793.
Comment 4 Victor Grousset/tuxayo 2024-02-12 15:53:44 UTC
Created attachment 162059 [details] [review]
Bug 35346: Update template logic to display 'Essential'

This patch updates the cookie consent template logic to always display
the 'Accept essential cookies' button and only expose the 'Accept all
cookies' button when there are additional cookies to accept, i.e. when
JSConsents is populated.

Test plan
1) Enable CookieConsent
2) Note you see 'Accept essential cookies' in both OPAC and Staff client
   until you have accepted them
3) Add a cookie to ConsentJS
4) Note that you will now see 'Accept all cookies' as well as the 'Accept
   essential cookies' button.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 5 Victor Grousset/tuxayo 2024-02-12 15:54:01 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 6 Katrin Fischer 2024-03-26 10:21:53 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-05-22 12:33:21 UTC
Depends on Bug 35347 not in 23.11.x