added ga switch on cookie options
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
@@ -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: "/",
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user