Skip to content

Commit

Permalink
Merge branch 'release' into 'master'
Browse files Browse the repository at this point in the history
Release 69.13

See merge request buckinghamshire-council/bc!678
  • Loading branch information
Victoria Chan committed Jan 8, 2024
2 parents 1399339 + eb4657f commit abc8e5e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

Compare: <https://git.torchbox.com/buckinghamshire-council/bc/compare/69.13...HEAD>

## 69.13 (2024-01-08)

Compare: <https://git.torchbox.com/buckinghamshire-council/bc/compare/69.12...69.13>

- Update cookie message to hide from devices which have previously declined cookies.

## 69.12 (2023-11-27)

Compare: <https://git.torchbox.com/buckinghamshire-council/bc/compare/69.11...69.12>
Expand Down
6 changes: 5 additions & 1 deletion bc/static_src/javascript/components/cookie-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ class CookieWarning {
return;
}

// If cookie has been declined, do not show the cookie message
if (Cookies.get(this.cookieName) === this.declineValue) {
this.messageContainer.classList.add(this.inactiveClass);
}
// If consent is required and not given, show the cookie message
if (!this.hasConsent()) {
else if (!this.hasConsent()) {
this.messageContainer.classList.add(this.activeClass);
}
}
Expand Down
9 changes: 9 additions & 0 deletions bc/static_src/javascript/components/cookie-message.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,13 @@ describe('CookieWarning', () => {
);
expect(Cookies.get('client-cookie')).toBe('decline cookies');
});

it('does not activate if cookie is rejected', () => {
Cookies.set('client-cookie', 'decline cookies');

new CookieWarning(document.querySelector(CookieWarning.selector()));
expect(document.querySelector('[data-cookie-message]').className).toBe(
'cookie inactive',
);
});
});

0 comments on commit abc8e5e

Please sign in to comment.