diff --git a/CHANGELOG.md b/CHANGELOG.md index e24c99d9..bf948aff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/nationalarchives/tna-frontend/compare/v0.2.6...HEAD) ### Added + +- Content in the cookie banner component is now customisable + ### Changed ### Deprecated ### Removed diff --git a/src/nationalarchives/components/cookie-banner/fixtures.json b/src/nationalarchives/components/cookie-banner/fixtures.json index 460392e2..14f307f0 100644 --- a/src/nationalarchives/components/cookie-banner/fixtures.json +++ b/src/nationalarchives/components/cookie-banner/fixtures.json @@ -7,7 +7,7 @@ "serviceName": "My service", "cookiesUrl": "/cookies" }, - "html": "" + "html": "" }, { "name": "custom preferences set key", @@ -16,7 +16,7 @@ "cookiesUrl": "/cookies", "cookiesPreferencesSetKey": "custom" }, - "html": "" + "html": "" }, { "name": "custom policies", @@ -25,7 +25,7 @@ "cookiesUrl": "/cookies", "policies": "custom" }, - "html": "" + "html": "" }, { "name": "custom policies key", @@ -34,7 +34,7 @@ "cookiesUrl": "/cookies", "policiesKey": "custom_key" }, - "html": "" + "html": "" }, { "name": "with domain", @@ -43,7 +43,7 @@ "cookiesUrl": "/cookies", "cookiesDomain": "nationalarchives.gov.uk" }, - "html": "" + "html": "" }, { "name": "with path", @@ -52,7 +52,7 @@ "cookiesUrl": "/cookies", "cookiesPath": "/my-service" }, - "html": "" + "html": "" }, { "name": "with preferences set key", @@ -61,7 +61,7 @@ "cookiesUrl": "/cookies", "preferencesSetKey": "custom_preferences_set_key" }, - "html": "" + "html": "" }, { "name": "insecure", @@ -70,7 +70,19 @@ "cookiesUrl": "/cookies", "allowInsecure": true }, - "html": "" + "html": "" + }, + { + "name": "custom content", + "options": { + "serviceName": "My service", + "cookiesUrl": "/cookies", + "title": "Welcome", + "body": "

Lorem ipsum 1

", + "acceptedBody": "

Lorem ipsum 2

", + "rejectedBody": "

Lorem ipsum 3

" + }, + "html": "" }, { "name": "with classes", @@ -79,7 +91,7 @@ "cookiesUrl": "/cookies", "classes": "tna-cookie-banner--fixture" }, - "html": "" + "html": "" }, { "name": "with attributes", @@ -90,7 +102,7 @@ "data-fixturetest": "pass" } }, - "html": "" + "html": "" } ] } diff --git a/src/nationalarchives/components/cookie-banner/macro-options.json b/src/nationalarchives/components/cookie-banner/macro-options.json index 23562fe6..398ce70d 100644 --- a/src/nationalarchives/components/cookie-banner/macro-options.json +++ b/src/nationalarchives/components/cookie-banner/macro-options.json @@ -5,6 +5,30 @@ "required": true, "description": "" }, + { + "name": "title", + "type": "string", + "required": false, + "description": "" + }, + { + "name": "body", + "type": "string", + "required": false, + "description": "" + }, + { + "name": "acceptedBody", + "type": "string", + "required": false, + "description": "" + }, + { + "name": "rejectedBody", + "type": "string", + "required": false, + "description": "" + }, { "name": "cookiesUrl", "type": "string", diff --git a/src/nationalarchives/components/cookie-banner/template.njk b/src/nationalarchives/components/cookie-banner/template.njk index 464220d5..89486502 100644 --- a/src/nationalarchives/components/cookie-banner/template.njk +++ b/src/nationalarchives/components/cookie-banner/template.njk @@ -12,9 +12,13 @@