added ga switch on cookie options

This commit is contained in:
2021-11-12 11:40:54 +00:00
parent b2aa7a0228
commit 1971208aa0
7 changed files with 71 additions and 24 deletions
+2 -2
View File
@@ -215,7 +215,7 @@ const CaseSummary = (props) => {
</Link>
)}
<a
{/* <a
onClick={() => {
//spinnerState();
router.back();
@@ -223,7 +223,7 @@ const CaseSummary = (props) => {
className="govuk-button govuk-button--secondary"
>
{t("case:summary-back-button-label")}
</a>
</a> */}
</div>
</div>
</div>
+13 -2
View File
@@ -17,11 +17,22 @@ const CookieBanner = () => {
let expDate = new Date(now);
expDate.setDate(now.getDate() + 365);
console.log(expDate);
cookie.set("planning_casework", true, {
expires: expDate,
});
let cookieStr = {
"essential": "accepted",
"usage": "accepted",
"communications": "accepted",
"settings": "accepted",
};
cookie.set("CookiePolicy", JSON.stringify(cookieStr).toString(), {
expires: expDate,
path: "/",
});
setBannerVisible(false);
};
+14
View File
@@ -30,9 +30,23 @@ const CookieManagementMain = (props) => {
cookie.set("CookiePolicy", JSON.stringify(values).toString(), {
expires: expDate,
path: "/",
});
function delete_cookie(name, path, domain) {
document.cookie =
name +
"=" +
(path ? ";path=" + path : "") +
(domain ? ";domain=" + domain : "") +
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
}
usageState == "revoked" && delete_cookie("CookiePolicy", "/");
cookie.set("planning_casework", true, {
expires: expDate,
path: "/",
});
};
+6
View File
@@ -126,12 +126,18 @@ let Login = (props) => {
const onHandleSubmit = (values) => {
//spinnerState();
let now = new Date();
let expDate = new Date(now);
expDate.setDate(now.getDate() + 0.41);
getLogin(values.loginUserID, values.loginUserPassword).then((data) => {
data.value.length != 0
? (setValidLoginID(true),
setLoggedInUserId(data.value[0].contactid),
setCookie(null, "pinsUser", data.value[0].contactid, {
path: "/",
expires: expDate,
}),
// spinnerState(),
router.replace({