Bug 35346

Summary: 'Accept essential cookies' should always appear if CookieConsent is enabled
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: OPACAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aude.charillon, fridolin.somers, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:
Bug Depends on: 35347    
Bug Blocks: 35348    
Attachments: Bug 35346: Update template logic to display 'Essential'
Bug 35346: Update template logic to display 'Essential'
Bug 35346: Update template logic to display 'Essential'

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