-
Notifications
You must be signed in to change notification settings - Fork 20
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 cookie banner component #795
Conversation
766d284
to
1d23ff9
Compare
1d23ff9
to
7fb1d99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor comments, also does this need more tests? I thinking of the JS in the first commit and a spec test for the component to check that clicking the link makes the banner disappear?
app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js
Show resolved
Hide resolved
app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss
Show resolved
Hide resolved
app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/_cookie_banner.html.erb
Outdated
Show resolved
Hide resolved
7fb1d99
to
7a7205e
Compare
7a7205e
to
0b8acfa
Compare
0b8acfa
to
96c3338
Compare
96c3338
to
1969474
Compare
1969474
to
264d0fd
Compare
264d0fd
to
9ab104c
Compare
9ab104c
to
920420d
Compare
5bfda86
to
9f5e768
Compare
9c5e838
to
2e44eec
Compare
2e44eec
to
01758f5
Compare
01758f5
to
1209d2f
Compare
9306059
to
ce70f45
Compare
ce70f45
to
6c96da0
Compare
Thanks for the review @andysellick! I addressed all the comments including tests for the cookie banner visibility and the cookie state. |
6c96da0
to
77e9351
Compare
Can I ask why a "hide this message" link has been added? Edit: Looks like the cookie bar is now persistent until it’s dismissed, which explains the new link. For services who will want to be consistent, what's the reasoning behind this? |
This update is part of a GOV.UK Cookie & Tracking Policy mission in an effort to align it with the spirit of the EU cookie and tracking policy legislation. To play back team's PMs reply to this question: "it’s a temporary change to increase visibility of the message while we consider other options in the next few months. that work will include looking at how this could be expanded across government." |
Need
We need to update the cookie banner which is currently part of govuk_template. There was an attempt to do this update in govuk_template, but since that's a deprecated repository we shouldn't do any new work or releases on it.
Instead, this PR moves the remaining
govuk-template.js
scripts intoapp/assets/javascripts/govuk_publishing_components/lib/
and extracts the cookie banner into its own component.Complementary work
A follow up PR will come after this, updating static to remove
govuk-template.js
and the associated markup for the cookie banner and replace it with this component.Update: PR in static alphagov/static#1662
Trello card