updated error home link and copy on error page

This commit is contained in:
2022-11-07 13:30:09 +00:00
parent 6197646b0f
commit 0d5adbc899
10 changed files with 62 additions and 44 deletions
+4 -1
View File
@@ -99,7 +99,10 @@ const RegisterComplete = (props) => {
<a
className="govuk-link"
onClick={() => {
setLogout(), window.localStorage.clear();
setLogout(),
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
}}
>
{t(
+6 -3
View File
@@ -279,15 +279,18 @@ const CaseSummary = (props) => {
</dl>
</div>
</div>
{/* {_.has(detailsObj, "pinswg_startdatetimeiftheevent") &&
1{" "}
{_.has(detailsObj, "pinswg_startdatetimeiftheevent") &&
detailsObj.pinswg_startdatetimeiftheevent}
2{" "}
{_.has(detailsObj, "pinswg_startdateoftheevent") &&
detailsObj.pinswg_startdateoftheevent}
3{" "}
{_.has(detailsObj, "pinswg_startdateofevent") &&
detailsObj.pinswg_startdateofevent}
4{" "}
{_.has(detailsObj, "pinswg_starttimeoftheevent") &&
detailsObj.pinswg_starttimeoftheevent} */}
detailsObj.pinswg_starttimeoftheevent}
{/* <div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<div className="govuk-button-group">
+2 -2
View File
@@ -219,8 +219,8 @@ const Header = (props) => {
>
<a
onClick={() => {
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
}}
className="govuk-header__link govuk-!-margin-right-3"
+2 -2
View File
@@ -24,8 +24,8 @@ const MyPortal = (props) => {
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
};
+20 -19
View File
@@ -67,26 +67,27 @@ const DNSSearchResults = (props) => {
let dataArray = [];
//push your Json Data in the array
dnsCoords.map((item) => {
let point = new OSPoint(
item.pinswg_anticipatedgridreferencenorthingtext,
item.pinswg_anticipatedgridreferenceeastingtext
);
let siteCoords = point.toOSGB36();
//console.log(siteCoords);
//console.log(item);
dataArray.push({
appellant:
item[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
],
name: item.pinswg_projectname,
lat: parseFloat(siteCoords.latitude),
lng: parseFloat(siteCoords.longitude),
title: item.pinswg_name,
if (showMap == "true") {
dnsCoords.map((item) => {
let point = new OSPoint(
item.pinswg_anticipatedgridreferencenorthingtext || 0,
item.pinswg_anticipatedgridreferenceeastingtext || 0
);
let siteCoords = point.toOSGB36();
//console.log(siteCoords);
//console.log(item);
dataArray.push({
appellant:
item[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
],
name: item.pinswg_projectname,
lat: parseFloat(siteCoords.latitude),
lng: parseFloat(siteCoords.longitude),
title: item.pinswg_name,
});
});
});
}
//console.log(dataArray);
+2 -2
View File
@@ -40,8 +40,8 @@ const TimeOut = (props) => {
const handleLogout = () => {
console.info("////////////\n" + "logout" + "\n////////////");
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
signOut({ callbackUrl: "/logout" });
};
+2 -1
View File
@@ -70,5 +70,6 @@
"pages-label": "Tudalen",
"of-label": "o",
"change-link-label": "Newid",
"hide-banner-label": "Cuddio"
"hide-banner-label": "Cuddio",
"error-instruction-label": "Os nad ydych yn gallu gweld eich gweithgarwch diweddar, pwyswch Ctrl, Shift ac R i adnewyddu eich porwr (neu Cmd ac R os ydych yn defnyddio Mac)."
}
+2 -1
View File
@@ -70,5 +70,6 @@
"pages-label": "Page",
"of-label": "of",
"change-link-label": "Change",
"hide-banner-label": "Hide"
"hide-banner-label": "Hide",
"error-instruction-label": "If you are unable to view your recent activity, press Ctrl, Shift and R to refresh your browser (or Cmd and R if you are using a Mac)."
}
+11 -7
View File
@@ -31,15 +31,19 @@ function Error({ statusCode }, props) {
? `An error ${statusCode} occurred on server`
: t("common:error-page-message")}
</p>
<p className="govuk-body">
{t("common:error-instruction-label")}
</p>
<a
className="govuk-link--no-underline"
className="govuk-link"
onClick={() => {
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
signOut({
callbackUrl: "/",
});
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
session != null
? signOut({
callbackUrl: "/",
})
: Router.push("/");
}}
>
{" "}
+11 -6
View File
@@ -6,6 +6,7 @@ import Footer from "../components/footer";
import Header from "../components/header";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { useSession, signIn, signOut } from "next-auth/react";
import Router from "next/router";
function Error({ statusCode }, props) {
let { t, lang } = useTranslation();
@@ -34,16 +35,20 @@ function Error({ statusCode }, props) {
: `An error occured`}
</p>
<p className="govuk-body">
{t("common:error-instruction-label")}
</p>
<a
href={session != null ? "#" : "/"}
className="govuk-link"
onClick={() => {
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
session != null &&
signOut({
callbackUrl: "/",
});
window.localStorage.clear(),
destroyCookie({}, "pinsUser"),
session != null
? signOut({
callbackUrl: "/",
})
: Router.push("/");
}}
>
Go back home