Merged PR 510: add cookie consent manger & updated cookie banner
add cookie consent manger & updated cookie banner Related work items: #6302
This commit is contained in:
@@ -88,15 +88,16 @@ const RegisterComplete = (props) => {
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
<a
|
<Link href="/">
|
||||||
href="/"
|
<a
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLogout(), window.localStorage.clear();
|
setLogout(), window.localStorage.clear();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Login to My Portal
|
Login to My Portal
|
||||||
</a>
|
</a>
|
||||||
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -533,6 +533,15 @@ const Breadcrumbs = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
|
{router.pathname == "/help/cookies" ? (
|
||||||
|
<>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
{t("cookies:cookie-breadcrumb")}
|
||||||
|
</li>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
{!_.isEmpty(slug) ? (
|
{!_.isEmpty(slug) ? (
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
|||||||
+112
-59
@@ -1,74 +1,127 @@
|
|||||||
import CookieConsent from "react-cookie-consent";
|
import CookieConsent from "react-cookie-consent";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import cookie from "cookie-cutter";
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
const CookieBanner = () => {
|
const CookieBanner = () => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
|
const [bannerVisible, setBannerVisible] = useState(true);
|
||||||
|
|
||||||
|
const accept = () => {
|
||||||
|
let now = new Date();
|
||||||
|
let expDate = new Date(now);
|
||||||
|
|
||||||
|
expDate.setDate(now.getDate() + 365);
|
||||||
|
|
||||||
|
console.log(expDate);
|
||||||
|
cookie.set("planning_casework", true, {
|
||||||
|
expires: expDate,
|
||||||
|
});
|
||||||
|
setBannerVisible(false);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CookieConsent
|
<>
|
||||||
style={{
|
{bannerVisible ? (
|
||||||
position: "inherit",
|
<CookieConsent
|
||||||
background: "#eeeeee",
|
style={{
|
||||||
display: "block",
|
position: "inherit",
|
||||||
}}
|
background: "#eeeeee",
|
||||||
containerClasses="app-cookie-banner"
|
display: "block",
|
||||||
buttonClasses="cookies-banner__button"
|
}}
|
||||||
buttonWrapperClasses="govuk-width-container consentBanner"
|
containerClasses="app-cookie-banner"
|
||||||
declineButtonClasses="cookies-banner__button"
|
buttonClasses="cookies-banner__button"
|
||||||
buttonText={t("common:cookie-banner-accept")}
|
buttonWrapperClasses="govuk-width-container consentBanner hidden"
|
||||||
declineButtonText={t("common:cookie-banner-decline")}
|
declineButtonClasses="cookies-banner__button"
|
||||||
disableStyles={true}
|
buttonText={t("common:cookie-banner-accept")}
|
||||||
enableDeclineButton={true}
|
declineButtonText={t("common:cookie-banner-decline")}
|
||||||
flipButtons={true}
|
disableStyles={true}
|
||||||
hideOnAccept={true}
|
enableDeclineButton={true}
|
||||||
cookieName="planning_casework"
|
flipButtons={true}
|
||||||
>
|
hideOnAccept={true}
|
||||||
<div className="app-cookie-banner">
|
cookieName="planning_casework"
|
||||||
<div
|
|
||||||
id="global-cookie-message"
|
|
||||||
className="govuk-clearfix"
|
|
||||||
data-module="cookie-banner"
|
|
||||||
role="region"
|
|
||||||
aria-label="cookie banner"
|
|
||||||
data-nosnippet=""
|
|
||||||
>
|
>
|
||||||
<div className="govuk-width-container">
|
<div className="app-cookie-banner">
|
||||||
<div className="govuk-grid-row">
|
<div
|
||||||
<div className="govuk-grid-column-two-thirds">
|
id="global-cookie-message"
|
||||||
<div className="">
|
className="govuk-clearfix"
|
||||||
<p className="cookies-banner__description">
|
data-module="cookie-banner"
|
||||||
{t("common:cookie-banner-line-1")}
|
role="region"
|
||||||
</p>
|
aria-label="cookie banner"
|
||||||
<ul className="cookies-banner__description">
|
data-nosnippet=""
|
||||||
<li>
|
>
|
||||||
{" "}
|
<div className="govuk-width-container">
|
||||||
{t(
|
<div className="govuk-grid-row">
|
||||||
"common:cookie-banner-list-item-1"
|
<div className="govuk-grid-column-two-thirds">
|
||||||
)}
|
<div className="">
|
||||||
</li>
|
<p className="cookies-banner__description">
|
||||||
</ul>
|
{t(
|
||||||
<p className="cookies-banner__description">
|
"common:cookie-banner-line-1"
|
||||||
{t("common:cookie-banner-line-2")}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<ul className="cookies-banner__description">
|
<ul className="cookies-banner__description">
|
||||||
<li>
|
<li>
|
||||||
{t(
|
{" "}
|
||||||
"common:cookie-banner-list-item-2"
|
{t(
|
||||||
)}
|
"common:cookie-banner-list-item-1"
|
||||||
</li>
|
)}
|
||||||
<li>
|
</li>
|
||||||
{t(
|
</ul>
|
||||||
"common:cookie-banner-list-item-3"
|
<p className="cookies-banner__description">
|
||||||
)}
|
{t(
|
||||||
</li>
|
"common:cookie-banner-line-2"
|
||||||
</ul>
|
)}
|
||||||
|
</p>
|
||||||
|
<ul className="cookies-banner__description">
|
||||||
|
<li>
|
||||||
|
{t(
|
||||||
|
"common:cookie-banner-list-item-2"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{t(
|
||||||
|
"common:cookie-banner-list-item-3"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="govuk-width-container consentBannerShow">
|
||||||
|
<button
|
||||||
|
className="cookies-banner__button"
|
||||||
|
id="rcc-confirm-button"
|
||||||
|
aria-label="Accept cookies"
|
||||||
|
onClick={() => {
|
||||||
|
accept();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:cookie-banner-accept")}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<Link href="/help/cookies">
|
||||||
|
<a
|
||||||
|
className="cookies-banner__button govuk-link--no-underline"
|
||||||
|
id="rcc-decline-button"
|
||||||
|
aria-label="Decline cookies"
|
||||||
|
>
|
||||||
|
{t("common:cookie-banner-change-settings")}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</CookieConsent>
|
||||||
</div>
|
) : (
|
||||||
</CookieConsent>
|
""
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,455 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { useContext, useEffect, useState } from "react";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { Field, reduxForm } from "redux-form";
|
||||||
|
import { parseCookies, setCookie, destroyCookie } from "nookies";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
|
||||||
|
import cookie from "cookie-cutter";
|
||||||
|
|
||||||
|
const CookieManagementMain = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
|
const { handleSubmit } = props;
|
||||||
|
|
||||||
|
const onHandleSubmit = (values) => {
|
||||||
|
Object.assign(values, {
|
||||||
|
"essential": "accepted",
|
||||||
|
"usage": usageState,
|
||||||
|
"communications": communicationsState,
|
||||||
|
"settings": settingsState,
|
||||||
|
});
|
||||||
|
|
||||||
|
let now = new Date();
|
||||||
|
let expDate = new Date(now);
|
||||||
|
expDate.setDate(now.getDate() + 365);
|
||||||
|
|
||||||
|
cookie.set("pinsCookiePolicy", JSON.stringify(values).toString(), {
|
||||||
|
expires: expDate,
|
||||||
|
});
|
||||||
|
cookie.set("planning_casework", true, {
|
||||||
|
expires: expDate,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
let cookieCheck = parseCookies();
|
||||||
|
|
||||||
|
let cookieObj =
|
||||||
|
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||||
|
? {}
|
||||||
|
: JSON.parse(cookieCheck.pinsCookiePolicy);
|
||||||
|
|
||||||
|
const [usageState, setUsageState] = useState(
|
||||||
|
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||||
|
? null
|
||||||
|
: cookieObj.usage
|
||||||
|
);
|
||||||
|
const [communicationsState, setCommunicationsState] = useState(
|
||||||
|
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||||
|
? null
|
||||||
|
: cookieObj.communications
|
||||||
|
);
|
||||||
|
const [settingsState, setSettingsState] = useState(
|
||||||
|
typeof cookieCheck.pinsCookiePolicy == "undefined"
|
||||||
|
? null
|
||||||
|
: cookieObj.settings
|
||||||
|
);
|
||||||
|
|
||||||
|
let updateObj = (key, value) => {
|
||||||
|
switch (key) {
|
||||||
|
case "usage":
|
||||||
|
setUsageState(value);
|
||||||
|
break;
|
||||||
|
case "communications":
|
||||||
|
setCommunicationsState(value);
|
||||||
|
break;
|
||||||
|
case "settings":
|
||||||
|
setSettingsState(value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// code block
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const CookieForm = () => {
|
||||||
|
return (
|
||||||
|
<main
|
||||||
|
className="govuk-main-wrapper govuk-!-padding-top-4 govuk-main-wrapper--auto-spacing"
|
||||||
|
id="main-content"
|
||||||
|
role="main"
|
||||||
|
>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<h1 className="govuk-heading-xl govuk-!-margin-bottom-5">
|
||||||
|
{t("cookies:cookie-title-heading")}
|
||||||
|
</h1>
|
||||||
|
<hr className="govuk-section-break govuk-section-break--visible" />
|
||||||
|
{typeof cookieCheck.pinsCookiePolicy == "undefined" ? (
|
||||||
|
<>
|
||||||
|
<div className="govuk-inset-text paragraph--type--call-out-message">
|
||||||
|
<h2 className="govuk-heading-l">
|
||||||
|
{t("cookies:cookie-not-saved-heading")}
|
||||||
|
</h2>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-not-saved-paragraph"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
typeof cookieCheck.pinsCookiePolicy !=
|
||||||
|
"undefined"
|
||||||
|
? "govuk-body govuk-!-margin-top-5"
|
||||||
|
: "govuk-body"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("cookies:cookie-intro-paragraph-1")}
|
||||||
|
</p>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("cookies:cookie-intro-paragraph-2")}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("cookies:cookie-intro-paragraph-3")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id="cookies-js">
|
||||||
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
|
<div>
|
||||||
|
<h3 className="govuk-heading-l">
|
||||||
|
{t("cookies:cookie-settings-heading")}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<fieldset className="govuk-fieldset">
|
||||||
|
<legend className="govuk-fieldset__legend">
|
||||||
|
<h4 className="govuk-!-font-size-27">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-heading"
|
||||||
|
)}
|
||||||
|
</h4>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-paragraph-1"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul className="govuk-list govuk-list--bullet">
|
||||||
|
<li>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-list-item-1"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-list-item-2"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-list-item-3"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-list-item-4"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<div className="govuk-radios govuk-radios--small">
|
||||||
|
<div className="govuk-radios__item">
|
||||||
|
<input
|
||||||
|
name="usage"
|
||||||
|
className="govuk-radios__input"
|
||||||
|
id="usage-1"
|
||||||
|
component="input"
|
||||||
|
type="radio"
|
||||||
|
value="revoked"
|
||||||
|
checked={
|
||||||
|
usageState === "revoked"
|
||||||
|
}
|
||||||
|
onChange={() => {
|
||||||
|
updateObj(
|
||||||
|
"usage",
|
||||||
|
"revoked"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor="usage-1"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-radio-1-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-radios__item">
|
||||||
|
<input
|
||||||
|
className="govuk-radios__input"
|
||||||
|
id="usage-2"
|
||||||
|
name="usage"
|
||||||
|
type="radio"
|
||||||
|
value="accepted"
|
||||||
|
component="input"
|
||||||
|
checked={
|
||||||
|
usageState ===
|
||||||
|
"accepted"
|
||||||
|
}
|
||||||
|
onChange={() => {
|
||||||
|
updateObj(
|
||||||
|
"usage",
|
||||||
|
"accepted"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor="usage-2"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-usage-radio-2-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</legend>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset className="govuk-fieldset">
|
||||||
|
<legend className="govuk-fieldset__legend">
|
||||||
|
<h4 className="govuk-!-font-size-27">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-communications-heading"
|
||||||
|
)}
|
||||||
|
</h4>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-communications-paragraph-1"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
</legend>
|
||||||
|
<div className="govuk-radios govuk-radios--small">
|
||||||
|
<div className="govuk-radios__item">
|
||||||
|
<input
|
||||||
|
className="govuk-radios__input"
|
||||||
|
id="communications-1"
|
||||||
|
name="communications"
|
||||||
|
type="radio"
|
||||||
|
value="revoked"
|
||||||
|
component="input"
|
||||||
|
checked={
|
||||||
|
communicationsState ===
|
||||||
|
"revoked"
|
||||||
|
}
|
||||||
|
onChange={() => {
|
||||||
|
updateObj(
|
||||||
|
"communications",
|
||||||
|
"revoked"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor="communications-1"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-communications-radio-1-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-radios__item">
|
||||||
|
<input
|
||||||
|
className="govuk-radios__input"
|
||||||
|
id="communications-2"
|
||||||
|
name="communications"
|
||||||
|
type="radio"
|
||||||
|
value="accepted"
|
||||||
|
component="input"
|
||||||
|
checked={
|
||||||
|
communicationsState ===
|
||||||
|
"accepted"
|
||||||
|
}
|
||||||
|
onChange={() => {
|
||||||
|
updateObj(
|
||||||
|
"communications",
|
||||||
|
"accepted"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor="communications-2"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-communications-radio-2-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset className="govuk-fieldset">
|
||||||
|
<legend className="govuk-fieldset__legend">
|
||||||
|
<h4 className="govuk-!-font-size-27">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-settings-heading"
|
||||||
|
)}
|
||||||
|
</h4>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-settings-paragraph-1"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
</legend>
|
||||||
|
<div className="govuk-radios govuk-radios--small">
|
||||||
|
<div className="govuk-radios__item">
|
||||||
|
<input
|
||||||
|
className="govuk-radios__input"
|
||||||
|
id="settings-1"
|
||||||
|
name="settings"
|
||||||
|
type="radio"
|
||||||
|
value="revoked"
|
||||||
|
component="input"
|
||||||
|
checked={
|
||||||
|
settingsState === "revoked"
|
||||||
|
}
|
||||||
|
onChange={() => {
|
||||||
|
updateObj(
|
||||||
|
"settings",
|
||||||
|
"revoked"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor="settings-1"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-settings-radio-1-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-radios__item">
|
||||||
|
<input
|
||||||
|
className="govuk-radios__input"
|
||||||
|
id="settings-2"
|
||||||
|
name="settings"
|
||||||
|
type="radio"
|
||||||
|
value="accepted"
|
||||||
|
component="input"
|
||||||
|
checked={
|
||||||
|
settingsState === "accepted"
|
||||||
|
}
|
||||||
|
onChange={() => {
|
||||||
|
updateObj(
|
||||||
|
"settings",
|
||||||
|
"accepted"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor="settings-2"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-settings-radio-2-label"
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset className="govuk-fieldset">
|
||||||
|
<legend className="govuk-fieldset__legend">
|
||||||
|
<h4 className="govuk-!-font-size-27">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-essential-heading"
|
||||||
|
)}
|
||||||
|
</h4>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-essential-paragraph-1"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<ul className="govuk-list govuk-list--bullet">
|
||||||
|
<li>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-essential-list-item-1"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-essential-list-item-2"
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-essential-paragraph-2"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<p className="govuk-body">
|
||||||
|
<a
|
||||||
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold"
|
||||||
|
href={t(
|
||||||
|
"cookies:cookie-settings-essential-link"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-essential-link-label"
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</legend>
|
||||||
|
</fieldset>
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button "
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"cookies:cookie-settings-save-button-label"
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<CookieForm />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapStateToProps = (state) => {
|
||||||
|
return {
|
||||||
|
initialValues: {
|
||||||
|
usage: state.accountDetails.cookieObj.usage,
|
||||||
|
communications: state.accountDetails.cookieObj.communications,
|
||||||
|
settings: state.accountDetails.cookieObj.settings,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps)(
|
||||||
|
reduxForm({
|
||||||
|
form: "CookieManagementForm",
|
||||||
|
enableReinitialize: true,
|
||||||
|
})(CookieManagementMain)
|
||||||
|
);
|
||||||
+10
-9
@@ -175,15 +175,16 @@ export default function Footer(props) {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-footer__inline-list-item">
|
<li className="govuk-footer__inline-list-item">
|
||||||
<a
|
<Link href="/help/cookies">
|
||||||
href="https://gov.wales/help/cookies"
|
<a
|
||||||
id="aCookies"
|
id="aCookies"
|
||||||
className="govuk-footer__link"
|
className="govuk-footer__link"
|
||||||
target="_blank"
|
>
|
||||||
rel="noreferrer"
|
{t(
|
||||||
>
|
"common:footer-cookies-link"
|
||||||
{t("common:footer-cookies-link")}
|
)}
|
||||||
</a>
|
</a>
|
||||||
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
<li className="govuk-footer__inline-list-item">
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { Field, reduxForm } from "redux-form";
|
|||||||
import LoadingOverlay from "react-loading-overlay";
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
import { getLogin } from "../../actions";
|
import { getLogin } from "../../actions";
|
||||||
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
||||||
import Cookies from "cookies";
|
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
|
|||||||
+2
-2
@@ -28,8 +28,8 @@ export default function Home({ children, pages }) {
|
|||||||
<CaseSearch />
|
<CaseSearch />
|
||||||
<CaseComment />
|
<CaseComment />
|
||||||
<Dns />
|
<Dns />
|
||||||
<Login />
|
{/* <Login />
|
||||||
{/* <Inspectorate /> */}
|
<Inspectorate /> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ const SearchResults = (props) => {
|
|||||||
return (
|
return (
|
||||||
<div className="govuk-summary-list__row" key={key}>
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
{router.pathname.indexOf("myportal")}
|
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
|
|||||||
@@ -86,6 +86,10 @@
|
|||||||
"search",
|
"search",
|
||||||
"dnsCommon",
|
"dnsCommon",
|
||||||
"dnsApplications"
|
"dnsApplications"
|
||||||
|
],
|
||||||
|
"/help/cookies": [
|
||||||
|
"common",
|
||||||
|
"cookies"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,5 +46,6 @@
|
|||||||
"cookie-banner-list-item-3": "i deilwra cyfathrebu",
|
"cookie-banner-list-item-3": "i deilwra cyfathrebu",
|
||||||
"cookie-banner-decline": "Rwy'n dirywio",
|
"cookie-banner-decline": "Rwy'n dirywio",
|
||||||
"cookie-banner-accept": "Derbyn cwcis",
|
"cookie-banner-accept": "Derbyn cwcis",
|
||||||
|
"cookie-banner-change-settings": "Newid gosodiadau cwcis",
|
||||||
"drop-down-select": "Dewiswch..."
|
"drop-down-select": "Dewiswch..."
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"cookie-breadcrumb": "Cwcis",
|
||||||
|
"cookie-title-heading": "Cwcis ar LLYW.CYMRU",
|
||||||
|
"cookie-not-saved-heading": "Nid yw eich dewisiadau cwcis wedi eu cadw eto",
|
||||||
|
"cookie-not-saved-paragraph": "Mae LLYW.CYMRU yn gosod cwcis pan fyddwch yn ymweld â'n gwefan. Gallwch newid y gosodiadau hyn i'ch dewis chi. Mae angen i chi gadw'r dudalen hon gyda'ch dewisiadau newydd.",
|
||||||
|
"cookie-intro-paragraph-1": "Ffeiliau sy'n cael eu cadw ar eich ffôn, tabled neu gyfrifiadur pan fyddwch yn ymweld â gwefan yw cwcis.",
|
||||||
|
"cookie-intro-paragraph-2": "Rydym yn defnyddio cwcis i storio gwybodaeth ynghylch sut yr ydych yn defnyddio gwefan LLYW.CYMRU, megis y tudalennau yr ydych yn ymweld â nhw. Nid yw'r cwcis hyn yn cael eu defnyddio i'ch adnabod chi'n bersonol.",
|
||||||
|
"cookie-intro-paragraph-3": "Rydym yn defnyddio 4 cwci gwahanol. Gallwch ddewis pa fath o gwcis rydych yn hapus i ni eu defnyddio.",
|
||||||
|
"cookie-settings-heading": "Gosodiadau cwcis",
|
||||||
|
"cookie-settings-usage-heading": "Cwcis sy'n mesur defnydd y wefan",
|
||||||
|
"cookie-settings-usage-paragraph-1": "Rydym yn defnyddio Google Analytics i fesur sut ydych yn defnyddio'r wefan er mwyn i ni ei wella yn seiliedig ar angen defnyddwyr. Mae Google Analytics yn gosod cwcis sy'n storio gwybodaeth wedi anonymeiddio ynghylch:",
|
||||||
|
"cookie-settings-usage-list-item-1": "sut ddaethoch chi i'r safle",
|
||||||
|
"cookie-settings-usage-list-item-2": "y tudalennau yr ydych yn ymweld â nhw ar LLYW.CYMRU a gwasanaethau digidol y llywodraeth, a pha mor hir yr ydych chi'n treulio ar bob tudalen",
|
||||||
|
"cookie-settings-usage-list-item-3": "beth ydych chi'n clicio arno wrth ymweld â'r safle",
|
||||||
|
"cookie-settings-usage-list-item-4": "Nid ydym yn caniatâu i Google ddefnyddio na rhannu'r data ynghylch sut yr ydych yn defnyddio'r safle.",
|
||||||
|
"cookie-settings-usage-radio-1-label": "Peidiwch â defnyddio cwcis sy'n mesur fy nefnydd o'r wefan",
|
||||||
|
"cookie-settings-usage-radio-2-label": "Defnyddiwch cwcis sy'n mesur fy nefnydd o'r wefan",
|
||||||
|
"cookie-settings-communications-heading": "Cwcis sy'n helpu gyda chyfathrebu a marchnata",
|
||||||
|
"cookie-settings-communications-paragraph-1": "Gall y cwcis hyn gael eu gosod gan wefannau trydydd parti a gwneud pethau fel mesur sut rydych yn gwylio fideos YouTube ar LLYW.CYMRU.",
|
||||||
|
"cookie-settings-communications-radio-1-label": "Peidiwch â defnyddio cwcis sy'n helpu gyda chyfathrebu a marchnata",
|
||||||
|
"cookie-settings-communications-radio-2-label": "Defnyddiwch cwcis sy'n cofio fy ngosodiadau ar y safle",
|
||||||
|
"cookie-settings-settings-heading": "Cwcis sy'n cofio'ch gosodiadau",
|
||||||
|
"cookie-settings-settings-paragraph-1": "Mae'r cwcis hyn yn gwneud pethau fel cofio eich dewisiadau, i bersonol eich profiad o ddefnyddio'r safle.",
|
||||||
|
"cookie-settings-settings-radio-1-label": "Peidiwch â defnyddio cwcis sy'n cofio fy ngosodiadau ar y safle",
|
||||||
|
"cookie-settings-settings-radio-2-label": "Defnyddiwch cwcis sy'n cofio fy ngosodiadau ar y safle",
|
||||||
|
"cookie-settings-essential-heading": "Cwcis sy'n angenrheidiol",
|
||||||
|
"cookie-settings-essential-paragraph-1": "Mae'r cwcis hyn yn hanfodol ar gyfer pethau fel:",
|
||||||
|
"cookie-settings-essential-list-item-1": "cofio'r hysbysiadau yr ydych wedi eu gweld fel ein bod ni ddim yn eu dangos i chi eto",
|
||||||
|
"cookie-settings-essential-list-item-2": "cofio eich lle mewn ffurflen (er enghraifft cais am drwydded)",
|
||||||
|
"cookie-settings-essential-paragraph-2": "Bydd angen i'r cwcis yma fod ymlaen drwy'r amser.",
|
||||||
|
"cookie-settings-essential-link": "https://llyw.cymru/manylion-am-gwcis-ar-llywcymru",
|
||||||
|
"cookie-settings-essential-link-label": "Mwy o wybodaeth am cwcis ar LLYW.CYMRU.",
|
||||||
|
"cookie-settings-save-button-label": "Cadw newidiadau"
|
||||||
|
}
|
||||||
@@ -46,5 +46,6 @@
|
|||||||
"cookie-banner-list-item-3": "tailor communications",
|
"cookie-banner-list-item-3": "tailor communications",
|
||||||
"cookie-banner-decline": "I decline",
|
"cookie-banner-decline": "I decline",
|
||||||
"cookie-banner-accept": "Accept cookies",
|
"cookie-banner-accept": "Accept cookies",
|
||||||
|
"cookie-banner-change-settings": "Change cookie settings",
|
||||||
"drop-down-select": "Select..."
|
"drop-down-select": "Select..."
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"cookie-breadcrumb": "Cookies",
|
||||||
|
"cookie-title-heading": "Cookies on GOV.WALES",
|
||||||
|
"cookie-not-saved-heading": "Your cookie settings have not yet been saved",
|
||||||
|
"cookie-not-saved-paragraph": "GOV.WALES sets cookies when you visit our website. You can choose to change these settings to your own preferences. You need to save this page with your new choices.",
|
||||||
|
"cookie-intro-paragraph-1": "Cookies are files saved on your phone, tablet or computer when you visit a website.",
|
||||||
|
"cookie-intro-paragraph-2": "We use cookies to store information about how you use the GOV.WALES website, such as the pages you visit. These cookies are not used to identify you personally.",
|
||||||
|
"cookie-intro-paragraph-3": "We use 4 types of cookie. You can choose which cookies you're happy for us to use.",
|
||||||
|
"cookie-settings-heading": "Cookie settings",
|
||||||
|
"cookie-settings-usage-heading": "Cookies that measure website use",
|
||||||
|
"cookie-settings-usage-paragraph-1": "We use Google Analytics to measure how you use the website so we can improve it based on user needs. Google Analytics sets cookies that store anonymised information about",
|
||||||
|
"cookie-settings-usage-list-item-1": "how you got to the site",
|
||||||
|
"cookie-settings-usage-list-item-2": "the pages you visit on GOV.WALES and government digital services, and how long you spend on each page",
|
||||||
|
"cookie-settings-usage-list-item-3": "what you click on while you're visiting the site",
|
||||||
|
"cookie-settings-usage-list-item-4": "We do not allow Google to use or share the data about how you use this site.",
|
||||||
|
"cookie-settings-usage-radio-1-label": "Do not use cookies that measure my website use",
|
||||||
|
"cookie-settings-usage-radio-2-label": "Use cookies that measure my website use",
|
||||||
|
"cookie-settings-communications-heading": "Cookies that help with communications and marketing",
|
||||||
|
"cookie-settings-communications-paragraph-1": "These cookies may be set by thirdparty websites and do things like measure how you view YouTube videos that are on GOV.WALES.",
|
||||||
|
"cookie-settings-communications-radio-1-label": "Do not use cookies that help with communications and marketing",
|
||||||
|
"cookie-settings-communications-radio-2-label": "Use cookies that help with communications and marketing",
|
||||||
|
"cookie-settings-settings-heading": "Cookies that remember your settings",
|
||||||
|
"cookie-settings-settings-paragraph-1": "These cookies do things like remember your preferences and the choices you make, to personalise your experience of using the site.",
|
||||||
|
"cookie-settings-settings-radio-1-label": "Do not use cookies that remember my settings on the site",
|
||||||
|
"cookie-settings-settings-radio-2-label": "Use cookies that remember my settings on the site",
|
||||||
|
"cookie-settings-essential-heading": "Strictly necessary cookies",
|
||||||
|
"cookie-settings-essential-paragraph-1": "These essential cookies do things like:",
|
||||||
|
"cookie-settings-essential-list-item-1": "remember the notifications you've seen so we do not show them to you again",
|
||||||
|
"cookie-settings-essential-list-item-2": "remember your progress through a form (for example a licence application)",
|
||||||
|
"cookie-settings-essential-paragraph-2": " These cookies always need to be on.",
|
||||||
|
"cookie-settings-essential-link": "https:gov.wales/details-about-cookies-govwales",
|
||||||
|
"cookie-settings-essential-link-label": "Find out more about cookies on GOV.WALES.",
|
||||||
|
"cookie-settings-save-button-label": "Save changes"
|
||||||
|
}
|
||||||
+2
-1
@@ -13,7 +13,7 @@
|
|||||||
"applicationinsights": "^2.1.3",
|
"applicationinsights": "^2.1.3",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cookies": "^0.8.0",
|
"cookie-cutter": "^0.2.0",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
"date-fns": "^2.25.0",
|
"date-fns": "^2.25.0",
|
||||||
"dom": "^0.0.3",
|
"dom": "^0.0.3",
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
"next": "^11.0.1",
|
"next": "^11.0.1",
|
||||||
"next-redux-wrapper": "^7.0.2",
|
"next-redux-wrapper": "^7.0.2",
|
||||||
"next-translate": "^1.0.7",
|
"next-translate": "^1.0.7",
|
||||||
|
"nookies": "^2.5.2",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"pm2": "^5.1.0",
|
"pm2": "^5.1.0",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Footer from "../../components/footer";
|
|||||||
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Footer from "../../components/footer";
|
|||||||
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Footer from "../../components/footer";
|
|||||||
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Footer from "../../components/footer";
|
|||||||
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Footer from "../../components/footer";
|
|||||||
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import CRMError from "../components/crmError";
|
import CRMError from "../components/crmError";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Case from "../components/case";
|
import Case from "../components/case";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Main from "../../components/dns//main";
|
import Main from "../../components/dns//main";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import ApplicationTabs from "../../components/dns/applications/applicationTabs";
|
import ApplicationTabs from "../../components/dns/applications/applicationTabs";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import ApplicationIntro from "../../components/dns/applications/applicationsIntro";
|
import ApplicationIntro from "../../components/dns/applications/applicationsIntro";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Main from "../../components/dns/main";
|
import Main from "../../components/dns/main";
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Main from "../../components/dns/main";
|
import Main from "../../components/dns/main";
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Main from "../../components/dns//main";
|
import Main from "../../components/dns//main";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Case from "../components/case";
|
import Case from "../components/case";
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import _ from "lodash";
|
||||||
|
import Head from "next/head";
|
||||||
|
import Header from "../../components/header";
|
||||||
|
import ServiceBanner from "../../components/servicebanner";
|
||||||
|
import CookieBanner from "../../components/cookieBanner";
|
||||||
|
import Breadcrumbs from "../../components/breadcrumbs";
|
||||||
|
import Footer from "../../components/footer";
|
||||||
|
import { wrapper } from "../../store/store";
|
||||||
|
import Errorpage from "../../components/errorpage";
|
||||||
|
import styles from "../../styles/Home.module.css";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import CookieManagementMain from "../../components/cookiemanager";
|
||||||
|
import { setCookieConsent } from "../../store/accountDetails/action";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import cookiemanager from "../../components/cookiemanager";
|
||||||
|
|
||||||
|
const CookieManagement = (props) => {
|
||||||
|
const { footerLinks, pages } = props;
|
||||||
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Head>
|
||||||
|
<title>{t("common:service-name")}</title>
|
||||||
|
</Head>
|
||||||
|
<div id="page_wrapper">
|
||||||
|
<CookieBanner />
|
||||||
|
<Header courseName="Appeals Casework Portal" />
|
||||||
|
<div className="govuk-width-container">
|
||||||
|
<Breadcrumbs />
|
||||||
|
<CookieManagementMain />
|
||||||
|
</div>
|
||||||
|
<Footer footerLinks={footerLinks} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CookieManagement;
|
||||||
@@ -10,7 +10,6 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { getIncidents } from "../actions";
|
import { getIncidents } from "../actions";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import CRMError from "../../components/crmError";
|
import CRMError from "../../components/crmError";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Case from "../../components/case";
|
import Case from "../../components/case";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import Cookies from "cookies";
|
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import Header from "../../components/header";
|
import Header from "../../components/header";
|
||||||
@@ -104,13 +104,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
await getAwaitingSubmission(token),
|
await getAwaitingSubmission(token),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const cookiesMaker = new Cookies(req, res);
|
// const cookiesMaker = new Cookies(req, res);
|
||||||
|
|
||||||
cookiesMaker.set("pinsUser", query.q, {
|
// cookiesMaker.set("pinsUser", query.q, {
|
||||||
httpOnly: true, // true by default
|
// httpOnly: true, // true by default
|
||||||
});
|
// });
|
||||||
|
|
||||||
console.log(" from cookie ", cookiesMaker.get("pinsUser"));
|
// console.log(" from cookie ", cookiesMaker.get("pinsUser"));
|
||||||
console.log(myCases);
|
console.log(myCases);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Errorpage from "../../components/errorpage";
|
|||||||
import styles from "../../styles/Home.module.css";
|
import styles from "../../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../../store/store";
|
import { wrapper } from "../../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Case from "../components/representation";
|
import Case from "../components/representation";
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import Errorpage from "../components/errorpage";
|
|||||||
import styles from "../styles/Home.module.css";
|
import styles from "../styles/Home.module.css";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import { wrapper } from "../store/store";
|
import { wrapper } from "../store/store";
|
||||||
import Cookies from "cookies";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import actions from "redux-form/lib/actions";
|
|
||||||
|
|
||||||
export const AccountDetailsDataActionTypes = {
|
export const AccountDetailsDataActionTypes = {
|
||||||
|
SETCOOKIECONSENT: "SETCOOKIECONSENT",
|
||||||
GETACCOUNTDETAILSDATA: "GETACCOUNTDETAILSDATA",
|
GETACCOUNTDETAILSDATA: "GETACCOUNTDETAILSDATA",
|
||||||
SETACCOUNTDETAILSDATA: "SETACCOUNTDETAILSDATA",
|
SETACCOUNTDETAILSDATA: "SETACCOUNTDETAILSDATA",
|
||||||
SETLOGGEDINUSER: "SETLOGGEDINUSER",
|
SETLOGGEDINUSER: "SETLOGGEDINUSER",
|
||||||
@@ -8,6 +7,14 @@ export const AccountDetailsDataActionTypes = {
|
|||||||
USER_LOGOUT: "USER_LOGOUT",
|
USER_LOGOUT: "USER_LOGOUT",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setCookieConsent = (cookieObj) => (dispatch) => {
|
||||||
|
console.log("wertyewrtyt", cookieObj);
|
||||||
|
return dispatch({
|
||||||
|
type: AccountDetailsDataActionTypes.SETCOOKIECONSENT,
|
||||||
|
cookieObj: cookieObj,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getAccountDetailsObj = () => (dispatch) => {
|
export const getAccountDetailsObj = () => (dispatch) => {
|
||||||
return dispatch({
|
return dispatch({
|
||||||
type: AccountDetailsDataActionTypes.GETACCOUNTDETAILSDATA,
|
type: AccountDetailsDataActionTypes.GETACCOUNTDETAILSDATA,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const AccountDetailsDataInitialState = {
|
|||||||
accountDetails: {},
|
accountDetails: {},
|
||||||
loggedinUserId: "",
|
loggedinUserId: "",
|
||||||
accCr: false,
|
accCr: false,
|
||||||
|
cookieObj: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function reducer(
|
export default function reducer(
|
||||||
@@ -26,6 +27,11 @@ export default function reducer(
|
|||||||
...state,
|
...state,
|
||||||
accCr: action.accCr,
|
accCr: action.accCr,
|
||||||
};
|
};
|
||||||
|
case AccountDetailsDataActionTypes.SETCOOKIECONSENT:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
cookieObj: action.cookieObj,
|
||||||
|
};
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ body {
|
|||||||
width: 28%;
|
width: 28%;
|
||||||
margin-right: 45px;
|
margin-right: 45px;
|
||||||
}
|
}
|
||||||
|
&.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cookies-banner__link,
|
.cookies-banner__link,
|
||||||
@@ -1320,3 +1323,54 @@ ul#sharePageLinks.active {
|
|||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.paragraph--type--call-out-message {
|
||||||
|
border-left-color: $blue;
|
||||||
|
background-color: $lightgrey_light;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cookies-js form {
|
||||||
|
background-color: $lightgrey_light;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
.govuk-radios__label:before {
|
||||||
|
border: 1px solid #666666;
|
||||||
|
background-color: $white;
|
||||||
|
}
|
||||||
|
.govuk-radios--small .govuk-radios__item {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
padding-left: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.govuk-radios--small
|
||||||
|
.govuk-radios__item:hover
|
||||||
|
.govuk-radios__input:not(:disabled)
|
||||||
|
+ .govuk-radios__label:before {
|
||||||
|
box-shadow: 0 0 0 5px $lightgrey;
|
||||||
|
}
|
||||||
|
.govuk-radios__item {
|
||||||
|
background-color: $lightgrey_semi;
|
||||||
|
&:hover {
|
||||||
|
background-color: $lightgrey;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
margin-top: 0px;
|
||||||
|
background-color: $lightgrey_semi;
|
||||||
|
padding: 20px 20px 20px 50px;
|
||||||
|
&:before {
|
||||||
|
top: 18px;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
left: 18px;
|
||||||
|
}
|
||||||
|
&:after {
|
||||||
|
top: 22px;
|
||||||
|
left: 22px;
|
||||||
|
border-width: 8px;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background-color: $lightgrey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user