diff --git a/components/account/registerComplete.js b/components/account/registerComplete.js index 797c1c3e..66607e12 100644 --- a/components/account/registerComplete.js +++ b/components/account/registerComplete.js @@ -99,7 +99,10 @@ const RegisterComplete = (props) => { { - setLogout(), window.localStorage.clear(); + setLogout(), + window.localStorage.clear(), + destroyCookie({}, "pinsUser"), + signOut({ callbackUrl: "/logout" }); }} > {t( diff --git a/components/case/summary.js b/components/case/summary.js index 857d04c1..bdcce2a6 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -279,15 +279,18 @@ const CaseSummary = (props) => { - {/* {_.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} {/*
diff --git a/components/header.js b/components/header.js index ccbcd35a..e3a10c4b 100644 --- a/components/header.js +++ b/components/header.js @@ -219,8 +219,8 @@ const Header = (props) => { > { - destroyCookie({}, "pinsUser"), - window.localStorage.clear(), + window.localStorage.clear(), + destroyCookie({}, "pinsUser"), signOut({ callbackUrl: "/logout" }); }} className="govuk-header__link govuk-!-margin-right-3" diff --git a/components/myportal.js b/components/myportal.js index a52f09c0..fee936ef 100644 --- a/components/myportal.js +++ b/components/myportal.js @@ -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" }); }; diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 1146d4dc..71366d13 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -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); diff --git a/components/timeout/index.js b/components/timeout/index.js index 35013f36..afa15428 100644 --- a/components/timeout/index.js +++ b/components/timeout/index.js @@ -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" }); }; diff --git a/locales/cy/common.json b/locales/cy/common.json index 4db6e6e2..e0b01da7 100644 --- a/locales/cy/common.json +++ b/locales/cy/common.json @@ -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)." } \ No newline at end of file diff --git a/locales/en/common.json b/locales/en/common.json index f095b702..e31d8ee4 100644 --- a/locales/en/common.json +++ b/locales/en/common.json @@ -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)." } \ No newline at end of file diff --git a/pages/_error.js b/pages/_error.js index b8c72c2d..a59c0856 100644 --- a/pages/_error.js +++ b/pages/_error.js @@ -31,15 +31,19 @@ function Error({ statusCode }, props) { ? `An error ${statusCode} occurred on server` : t("common:error-page-message")}

- +

+ {t("common:error-instruction-label")} +

{ - destroyCookie({}, "pinsUser"), - window.localStorage.clear(), - signOut({ - callbackUrl: "/", - }); + window.localStorage.clear(), + destroyCookie({}, "pinsUser"), + session != null + ? signOut({ + callbackUrl: "/", + }) + : Router.push("/"); }} > {" "} diff --git a/pages/error.js b/pages/error.js index 40a09645..6ef931de 100644 --- a/pages/error.js +++ b/pages/error.js @@ -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`}

+

+ {t("common:error-instruction-label")} +

{ - destroyCookie({}, "pinsUser"), - window.localStorage.clear(), - session != null && - signOut({ - callbackUrl: "/", - }); + window.localStorage.clear(), + destroyCookie({}, "pinsUser"), + session != null + ? signOut({ + callbackUrl: "/", + }) + : Router.push("/"); }} > Go back home