Skip to content

Commit

Permalink
Fix/2631 cookie settings link override (#2632)
Browse files Browse the repository at this point in the history
* added default for setting link url macro option

* updated default for settingsLinkText in macro options docs

* fixed macro test for settings link url param override
  • Loading branch information
jrbarnes9 authored Mar 16, 2023
1 parent 8a9e53d commit 3d67244
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/cookies-banner/_macro-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| rejectButtonText | string | false | Text for the reject button (default is 'Reject additional preferences') |
| confirmationButtonText | string | false | Text for the confirmation banner button (default is 'Hide') |
| confirmationButtonTextAria | string | false | Additional descriptive text for the confirmation banner button to assist screen readers (default is 'the cookie message') |
| settingsLinkText | string | false | Text for link to cookie settings page (default is 'Cookie settings') |
| settingsLinkText | string | false | Text for link to cookie settings page (default is 'View cookies') |
| settingsLinkTextURL | string | false | URL for the cookies settings page (default is '/cookies') |
| wide | boolean | false | Set to “true” to increase the maximum width of the layout container to 1280px |
| fullWidth | boolean | false | Set to “true” to increase the maximum width of the layout container to the full width of the viewport |
4 changes: 2 additions & 2 deletions src/components/cookies-banner/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% set serviceName = 'ons.gov.uk' %}
{% set statementTitle = 'Cwcis ar' %}
{% set settingsLinkText = 'Gweld cwcis' %}
{% set settingsLinkURL = '/cwics' %}
{% set settingsLinkURL = params.settingsLinkTextURL | default('/cwics') %}
{% set statementText = '<p>Ffeiliau bach a gaiff eu storio ar eich dyfais pan fyddwch yn mynd ar wefan yw cwcis. Rydym ni’n defnyddio rhai cwcis hanfodol i wneud i’r wefan hon weithio.</p><p>Hoffem osod <a href="' + settingsLinkURL + '">cwcis ychwanegol</a> er mwyn cofio eich gosodiadau a deall sut rydych chi’n defnyddio’r wefan. Mae hyn yn ein helpu ni i wella ein gwasanaethau.</p>' %}
{% set acceptButtonText = 'Derbyn cwcis ychwanegol' %}
{% set rejectButtonText = 'Gwrthod cwcis ychwanegol' %}
Expand All @@ -18,7 +18,7 @@
{% set serviceName = 'ons.gov.uk' %}
{% set statementTitle = 'Cookies on' %}
{% set settingsLinkText = 'View cookies' %}
{% set settingsLinkURL = '/cookies' %}
{% set settingsLinkURL = params.settingsLinkTextURL | default('/cookies') %}
{% set statementText = '<p>Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.</p><p>We would like to set <a href="' + settingsLinkURL + '">additional cookies</a> to remember your settings and understand how you use the site. This helps us to improve our services. </p>' %}
{% set acceptButtonText = 'Accept additional cookies' %}
{% set rejectButtonText = 'Reject additional cookies' %}
Expand Down
2 changes: 1 addition & 1 deletion src/components/cookies-banner/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const EXAMPLE_COOKIES_BANNER_PARAMS = {
serviceName: 'ons.gov.uk override',
statementTitle: 'Cookies on override',
settingsLinkText: 'Cookie settings override',
settingsLinkURL: '/cookiesoverride',
settingsLinkTextURL: '/cookiesoverride',
statementText: 'Statement override',
acceptButtonText: 'Accept additional cookies override',
rejectButtonText: 'Reject additional cookies override',
Expand Down

0 comments on commit 3d67244

Please sign in to comment.