updated service status down functionality
This commit is contained in:
@@ -41,7 +41,9 @@ const Case = (props) => {
|
|||||||
docsOffline={props.props.docsOffline}
|
docsOffline={props.props.docsOffline}
|
||||||
documentDetailsObj={props.documentDetailsObj}
|
documentDetailsObj={props.documentDetailsObj}
|
||||||
showFilteredDocs={props.showFilteredDocs}
|
showFilteredDocs={props.showFilteredDocs}
|
||||||
|
showLoginCheck={props.showLoginCheck}
|
||||||
eventsObj={props.eventsObj}
|
eventsObj={props.eventsObj}
|
||||||
|
mediaObj={props.mediaObj}
|
||||||
/>
|
/>
|
||||||
{showRepresentations == true && (
|
{showRepresentations == true && (
|
||||||
<RepresentationList
|
<RepresentationList
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ const Header = (props) => {
|
|||||||
"/myportal/contactus",
|
"/myportal/contactus",
|
||||||
"/unsubscribe/[watchlistid]",
|
"/unsubscribe/[watchlistid]",
|
||||||
"/unsubscribeall/[watchlistid]",
|
"/unsubscribeall/[watchlistid]",
|
||||||
|
"/status",
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasContactLink = [
|
const hasContactLink = [
|
||||||
@@ -84,14 +85,14 @@ const Header = (props) => {
|
|||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
console.info("////////////\n" + "logout" + "\n////////////");
|
console.info("////////////\n" + "logout" + "\n////////////");
|
||||||
window.localStorage.clear(),
|
(window.localStorage.clear(),
|
||||||
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
destroyCookie(null, "next-auth.csrf-token", { path: "/" }),
|
||||||
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
destroyCookie(null, "next-auth.callback-url", { path: "/" }),
|
||||||
destroyCookie(null, "pedw_locale", { path: "/" }),
|
destroyCookie(null, "pedw_locale", { path: "/" }),
|
||||||
destroyCookie(null, "pinsUser", { path: "/" }),
|
destroyCookie(null, "pinsUser", { path: "/" }),
|
||||||
signOut({
|
signOut({
|
||||||
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
callbackUrl: locale == "cy" ? "/cy/allgofnodi" : "/logout",
|
||||||
});
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
//const switchLocale = locale === "en" ? "cy" : "en";
|
//const switchLocale = locale === "en" ? "cy" : "en";
|
||||||
|
|||||||
+3
-1
@@ -24,8 +24,10 @@ const MainHome = (props) => {
|
|||||||
<div className="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
{showLogin != "true" && (
|
{showLogin != "true" && (
|
||||||
<>
|
<>
|
||||||
<LoginSoon />
|
{/* <LoginSoon />
|
||||||
|
<CaseSearch /> */}
|
||||||
<CaseSearch />
|
<CaseSearch />
|
||||||
|
<Login session={session} siteurl={siteurl} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{showLogin == "true" && (
|
{showLogin == "true" && (
|
||||||
|
|||||||
+98
-26
@@ -1,46 +1,118 @@
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import router from "next/router";
|
import router from "next/router";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import CaseNoticeBanner from "./case/caseNoticeBanner";
|
||||||
|
|
||||||
export default function ServiceBanner(props) {
|
export default function ServiceBanner(props) {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
|
const showSigninFromEnv = true;
|
||||||
|
const showNoticeFromEnv = false;
|
||||||
|
|
||||||
|
// keep backwards-compat with existing usage
|
||||||
|
const showSignin = props?.noSignin === true ? false : showSigninFromEnv;
|
||||||
|
|
||||||
const signInButton = () => {
|
const signInButton = () => {
|
||||||
router.push(
|
router.push(
|
||||||
`${
|
`${
|
||||||
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
|
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
|
||||||
}?callbackUrl=${encodeURIComponent(
|
}?callbackUrl=${encodeURIComponent(
|
||||||
window.location.href
|
window.location.href,
|
||||||
)}&error=EmailSignin`
|
)}&error=EmailSignin`,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className="servicebanner">
|
<>
|
||||||
<h1>
|
<div className="servicebanner">
|
||||||
<img
|
<h1>
|
||||||
className={
|
<img
|
||||||
router.locale == "cy"
|
className={
|
||||||
? "govuk-!-margin-top-4 serviceTitle cy"
|
router.locale == "cy"
|
||||||
: "govuk-!-margin-top-4 serviceTitle"
|
? "govuk-!-margin-top-4 serviceTitle cy"
|
||||||
}
|
: "govuk-!-margin-top-4 serviceTitle"
|
||||||
src={
|
}
|
||||||
router.locale == "cy"
|
src={
|
||||||
? "/assets/images/planning-casework-cy.svg"
|
router.locale == "cy"
|
||||||
: "/assets/images/planning-casework-en.svg"
|
? "/assets/images/planning-casework-cy.svg"
|
||||||
}
|
: "/assets/images/planning-casework-en.svg"
|
||||||
alt="Planning casework"
|
}
|
||||||
/>
|
alt="Planning casework"
|
||||||
</h1>
|
/>
|
||||||
{props.noSignin != true && (
|
</h1>
|
||||||
<div className="serviceBanner_userDetails">
|
|
||||||
<button
|
{showSignin && props.noSignin != true && (
|
||||||
onClick={() => signInButton()}
|
<div className="serviceBanner_userDetails">
|
||||||
className="govuk-header__link "
|
<button
|
||||||
|
onClick={() => signInButton()}
|
||||||
|
className="govuk-header__link "
|
||||||
|
>
|
||||||
|
{t("common:signin-label")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{showNoticeFromEnv && (
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
className="govuk-warning-text noticebanner govuk-!-margin-bottom-0"
|
||||||
|
key={1}
|
||||||
>
|
>
|
||||||
{t("common:signin-label")}
|
<strong className="govuk-warning-text__text">
|
||||||
</button>
|
<span className="govuk-visually-hidden">
|
||||||
|
Announcement
|
||||||
|
</span>
|
||||||
|
</strong>
|
||||||
|
<div>
|
||||||
|
<div className=" govuk-body-s">
|
||||||
|
<h2 className="govuk-heading-s">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? "Cyhoeddiad"
|
||||||
|
: "Announcement"}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-body-s">
|
||||||
|
{router.locale == "cy" ? (
|
||||||
|
<>
|
||||||
|
<p>
|
||||||
|
Oherwydd gwaith cynnal a chadw
|
||||||
|
hanfodol, rydym yn disgwyl rhywfaint
|
||||||
|
o darfu ar ein gwasanaethau Porth
|
||||||
|
Gwaith Achos rhwng 9-13 Chwefror
|
||||||
|
2026.{" "}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Ymddiheurwn am yr anghyfleustra. Am
|
||||||
|
ymholiadau brys yn ystod y cyfnod
|
||||||
|
hwn, cysylltwch â{" "}
|
||||||
|
<a href="mailto:pedw.gwaithachos@llyw.cymru">
|
||||||
|
pedw.gwaithachos@llyw.cymru
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<p>
|
||||||
|
Due to essential maintenance, we are
|
||||||
|
expecting some disruption to our
|
||||||
|
Casework Portal services between
|
||||||
|
9-13 February 2026.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
We apologise for the inconvenience.
|
||||||
|
For urgent enquries during this time
|
||||||
|
please contact{" "}
|
||||||
|
<a href="mailto:pedw.casework@gov.wales">
|
||||||
|
pedw.casework@gov.wales
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-8
@@ -84,7 +84,9 @@ const SignIn = (props) => {
|
|||||||
<div className="govuk-body-m">
|
<div className="govuk-body-m">
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
||||||
<h1 className="govuk-fieldset__heading govuk-heading-m">
|
<h1 className="govuk-fieldset__heading govuk-heading-m">
|
||||||
{t("auth:auth-page-title")}{" "}
|
{t(
|
||||||
|
"auth:auth-page-title",
|
||||||
|
)}{" "}
|
||||||
</h1>
|
</h1>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
@@ -122,7 +124,7 @@ const SignIn = (props) => {
|
|||||||
htmlFor="email"
|
htmlFor="email"
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"auth:auth-email-label"
|
"auth:auth-email-label",
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -142,7 +144,7 @@ const SignIn = (props) => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t(
|
{t(
|
||||||
"auth:auth-signin-button-label"
|
"auth:auth-signin-button-label",
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -163,10 +165,10 @@ const SignIn = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
export async function getServerSideProps(context) {
|
||||||
if (process.env.SHOWLOGIN == false) {
|
if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/404",
|
destination: "/status",
|
||||||
permanent: false,
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -177,7 +179,7 @@ export async function getServerSideProps(context) {
|
|||||||
"\n//////////////////////\n",
|
"\n//////////////////////\n",
|
||||||
"Sign in callbackurl: " + context.query.callbackUrl,
|
"Sign in callbackurl: " + context.query.callbackUrl,
|
||||||
context.locale,
|
context.locale,
|
||||||
"\n//////////////////////\n"
|
"\n//////////////////////\n",
|
||||||
);
|
);
|
||||||
let formURL = context.req.headers.host;
|
let formURL = context.req.headers.host;
|
||||||
//console.log("formUrl:", formURL);
|
//console.log("formUrl:", formURL);
|
||||||
@@ -207,7 +209,7 @@ export async function getServerSideProps(context) {
|
|||||||
|
|
||||||
// Append the query parameters to the new URL
|
// Append the query parameters to the new URL
|
||||||
params.forEach((value, key) =>
|
params.forEach((value, key) =>
|
||||||
toUrlObj.searchParams.append(key, value)
|
toUrlObj.searchParams.append(key, value),
|
||||||
);
|
);
|
||||||
|
|
||||||
return toUrlObj.toString(); // Return the full new URL as a string
|
return toUrlObj.toString(); // Return the full new URL as a string
|
||||||
@@ -216,7 +218,7 @@ export async function getServerSideProps(context) {
|
|||||||
typeof context.query.callbackUrl != "undefined" &&
|
typeof context.query.callbackUrl != "undefined" &&
|
||||||
(formURL = appendParamsAndPathToNewUrl(
|
(formURL = appendParamsAndPathToNewUrl(
|
||||||
context.query.callbackUrl,
|
context.query.callbackUrl,
|
||||||
formURL
|
formURL,
|
||||||
));
|
));
|
||||||
|
|
||||||
//formURL = appendParamsAndPathToNewUrl(context.query.callbackUrl, formURL);
|
//formURL = appendParamsAndPathToNewUrl(context.query.callbackUrl, formURL);
|
||||||
|
|||||||
@@ -236,10 +236,10 @@ export async function getServerSideProps(context) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.SHOWLOGIN == false) {
|
if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/404",
|
destination: "/status",
|
||||||
permanent: false,
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -250,7 +250,7 @@ export async function getServerSideProps(context) {
|
|||||||
"\n//////////////////////\n",
|
"\n//////////////////////\n",
|
||||||
"Sign in callbackurl: " + context.req.headers.host,
|
"Sign in callbackurl: " + context.req.headers.host,
|
||||||
context.locale,
|
context.locale,
|
||||||
csrfToken + "\n//////////////////////\n"
|
csrfToken + "\n//////////////////////\n",
|
||||||
);
|
);
|
||||||
let formURL = context.req.headers.host;
|
let formURL = context.req.headers.host;
|
||||||
console.log("formUrl:", formURL);
|
console.log("formUrl:", formURL);
|
||||||
|
|||||||
+70
-5
@@ -1,28 +1,93 @@
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
|
import CookieBanner from "../components/cookieBanner";
|
||||||
|
import Header from "../components/header";
|
||||||
|
import Footer from "../components/footer";
|
||||||
|
import router from "next/router";
|
||||||
|
|
||||||
const FourOhFour = (props) => {
|
const StatusPage = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
const { footerLinks, pages } = props;
|
const { footerLinks, pages } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Status Up</title>
|
<title>Site Status</title>
|
||||||
</Head>
|
</Head>
|
||||||
<div id="page_wrapper">
|
<div id="page_wrapper">
|
||||||
|
<CookieBanner />
|
||||||
|
<Header />
|
||||||
<div className="govuk-width-container govuk-!-padding-bottom-9">
|
<div className="govuk-width-container govuk-!-padding-bottom-9">
|
||||||
<main className="govuk-main-wrapper govuk-!-padding-top-9 govuk-!-padding-bottom-9">
|
<main className="govuk-main-wrapper govuk-!-padding-top-9 govuk-!-padding-bottom-9">
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-two-thirds ">
|
<div
|
||||||
<h1>Status Up</h1>
|
className="govuk-warning-text noticebanner govuk-!-margin-bottom-0"
|
||||||
|
key={1}
|
||||||
|
>
|
||||||
|
<strong className="govuk-warning-text__text">
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Announcement
|
||||||
|
</span>
|
||||||
|
</strong>
|
||||||
|
<div>
|
||||||
|
<div className=" govuk-body-s">
|
||||||
|
<h2 className="govuk-heading-s">
|
||||||
|
{router.locale == "cy"
|
||||||
|
? "Cyhoeddiad"
|
||||||
|
: "Announcement"}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-body-s">
|
||||||
|
{router.locale == "cy" ? (
|
||||||
|
<>
|
||||||
|
<p>
|
||||||
|
Oherwydd gwaith cynnal a
|
||||||
|
chadw hanfodol, rydym yn
|
||||||
|
disgwyl rhywfaint o darfu ar
|
||||||
|
ein gwasanaethau Porth
|
||||||
|
Gwaith Achos rhwng 9-13
|
||||||
|
Chwefror 2026.{" "}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Ymddiheurwn am yr
|
||||||
|
anghyfleustra. Am ymholiadau
|
||||||
|
brys yn ystod y cyfnod hwn,
|
||||||
|
cysylltwch â{" "}
|
||||||
|
<a href="mailto:pedw.gwaithachos@llyw.cymru">
|
||||||
|
pedw.gwaithachos@llyw.cymru
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<p>
|
||||||
|
Due to essential
|
||||||
|
maintenance, we are
|
||||||
|
expecting some disruption to
|
||||||
|
our Casework Portal services
|
||||||
|
between 9-13 February 2026.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
We apologise for the
|
||||||
|
inconvenience. For urgent
|
||||||
|
enquries during this time
|
||||||
|
please contact{" "}
|
||||||
|
<a href="mailto:pedw.casework@gov.wales">
|
||||||
|
pedw.casework@gov.wales
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FourOhFour;
|
export default StatusPage;
|
||||||
|
|||||||
Reference in New Issue
Block a user