New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add single cookie consent API #3854
Merged
Merged
Commits on Mar 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 88c9f34 - Browse repository at this point
Copy the full SHA 88c9f34View commit details -
- adds code to include and manage our use of the single consent API code - init is called by the cookie banner code on every page, which determines which API endpoint to use (staging or prod) and creates the GovSingleConsent object - useConsentApi is called across the code to check whether or not to use the consent API, this will be set in static - the default callback for the consent object checks the returned response and if the user has consented, triggers the cookie-consent event, which will initialise analytics and hide the cookie banner - setPreferences allows user consent to be set through the API - use load analytics environment list for consent API URL
Configuration menu - View commit details
-
Copy full SHA for fe5418e - Browse repository at this point
Copy the full SHA fe5418eView commit details -
Cookie banner use single consent API
- update the cookie banner component JS to use the single consent API code - stores an internal variable to check whether or not to use the consent API - if false, behaviour should be as normal - if true, should yield setting of consent cookies entirely to the consent API code - update cookie banner tests accordingly
Configuration menu - View commit details
-
Copy full SHA for 661980b - Browse repository at this point
Copy the full SHA 661980bView commit details -
Cookie settings use single consent API
- updates the JavaScript for the cookie settings page to use the single consent API code - stores an internal variable to check whether or not to use the consent API - if false, behaviour should be as normal - if true, should yield setting of consent cookies entirely to the consent API code - note that this code sends its own callback function for the consent API, which sets the initial form values on page load, this means that any delay in the API call will result in these fields being unfilled until it responds
Configuration menu - View commit details
-
Copy full SHA for b34a892 - Browse repository at this point
Copy the full SHA b34a892View commit details -
- previously the consent cookie was always set (to reject all cookies) prior to user choice - now that we're not doing that, the code that turns links to Youtube videos in govspeak content into embedded videos was checking for the consent cookie, not finding it, and defaulting to... true. - this meant that videos were appearing on a page before users had consented to cookies - setting the default value to false seems to be the simplest way to fix this. Videos still initialise automatically as before once cookies are consented to
Configuration menu - View commit details
-
Copy full SHA for d21cc1e - Browse repository at this point
Copy the full SHA d21cc1eView commit details -
Refactor domain configuration for load-analytics
- now that the domain config contains information about more than just analytics, it feels like it should be separated out for clarity - updated docs and tests accordingly
Configuration menu - View commit details
-
Copy full SHA for 743b298 - Browse repository at this point
Copy the full SHA 743b298View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b5f751 - Browse repository at this point
Copy the full SHA 7b5f751View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.