From bfc92303840677a8ff92632b58a37206626f6737 Mon Sep 17 00:00:00 2001 From: "D. Ror." Date: Mon, 26 Aug 2024 14:35:26 -0400 Subject: [PATCH] Add cookie consent dialog and user setting (#3301) "C is for cookie, that's good enough for me" - Cookie Monster --- docs/user_guide/docs/account.md | 3 +- package-lock.json | 8 ++- package.json | 3 +- public/index.html | 5 +- public/locales/en/translation.json | 12 ++++ src/components/App/index.tsx | 2 + src/components/Login/Redux/LoginActions.ts | 12 ++-- src/components/UserSettings/UserSettings.tsx | 35 +++++++++++- .../UserSettings/tests/UserSettings.test.tsx | 1 + src/cookies/CookieConsent.tsx | 10 ++++ src/cookies/cc.css | 12 ++++ src/cookies/useCookieConsent.tsx | 55 +++++++++++++++++++ src/types/Redux/analytics.ts | 12 +++- src/types/Redux/analyticsReduxTypes.ts | 2 + 14 files changed, 159 insertions(+), 13 deletions(-) create mode 100644 src/cookies/CookieConsent.tsx create mode 100644 src/cookies/cc.css create mode 100644 src/cookies/useCookieConsent.tsx diff --git a/docs/user_guide/docs/account.md b/docs/user_guide/docs/account.md index ec257c1210..4302cec44d 100644 --- a/docs/user_guide/docs/account.md +++ b/docs/user_guide/docs/account.md @@ -36,7 +36,8 @@ You can add or update your: - name; - phone number; - email address; -- user-interface language. +- user-interface language; +- analytics consent. !!! note "Note" diff --git a/package-lock.json b/package-lock.json index ba646cd875..e12e7e32be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,8 @@ "redux-thunk": "^2.4.0", "ts-key-enum": "^2.0.12", "uuid": "^9.0.1", - "validator": "^13.11.0" + "validator": "^13.11.0", + "vanilla-cookieconsent": "^3.0.1" }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", @@ -25145,6 +25146,11 @@ "node": ">= 0.10" } }, + "node_modules/vanilla-cookieconsent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vanilla-cookieconsent/-/vanilla-cookieconsent-3.0.1.tgz", + "integrity": "sha512-gqc4x7O9t1I4xWr7x6/jtQWPr4PZK26SmeA0iyTv1WyoECfAGnu5JEOExmMEP+5Fz66AT9OiCBO3GII4wDQHLw==" + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/package.json b/package.json index 8182b7227e..9f9117af55 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,8 @@ "redux-thunk": "^2.4.0", "ts-key-enum": "^2.0.12", "uuid": "^9.0.1", - "validator": "^13.11.0" + "validator": "^13.11.0", + "vanilla-cookieconsent": "^3.0.1" }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", diff --git a/public/index.html b/public/index.html index 6df0b190be..677b14bbd3 100644 --- a/public/index.html +++ b/public/index.html @@ -7,9 +7,10 @@ - -