canonical / cookie-policy

A script and stylesheet that displays the Canonical cookie policy
8 stars 13 forks source link

fix: Ensure 'essential' cookies are always checked and disable the toggle #178

Closed petesfrench closed 5 months ago

petesfrench commented 5 months ago

Done

This pull request adds a check to the render function to ensure that when the enableSwitcher (previously showSwitcher) variable is false, the input element is both checked and disabled.

QA

Run the project locally Don't accept any cookies Check '_cookies_accepted=essential' Can also check the other combinations (performance, functional. all)

Issue

Fixes: https://warthogs.atlassian.net/browse/WD-11997

akbarkz commented 5 months ago

When I tested it _cookies_accepted cookie always had a previous value after unsetting both types of cookies ("performance" and "functionality"). It only works when I leave one or more types of cookies set.

akbarkz commented 5 months ago

@petesfrench appears that I had to build the project first and then serve it. Now all works according to your changes.

anthonydillon commented 5 months ago

@petesfrench @akbarkz we will need to bump the version and release this change in NPM to get it rolled out.