diff --git a/components/case.js b/components/case.js index 6d98d253..7c34f042 100644 --- a/components/case.js +++ b/components/case.js @@ -41,6 +41,7 @@ const Case = (props) => { docsOffline={props.props.docsOffline} documentDetailsObj={props.documentDetailsObj} showFilteredDocs={props.showFilteredDocs} + showLoginCheck={props.showLoginCheck} /> {showRepresentations == true && ( { ticketnumber, } = props; - const showLoginCheck = - currentType == "directResultsObj" ? "true" : currentView.showLogin; + // const showLoginCheck = + // currentType == "directResultsObj" ? "true" : currentView.showLogin; + + let showLoginCheck = props.showLoginCheck; const { data: session, status } = useSession(); const [isModalOpen, setIsModalOpen] = useState(false); @@ -154,10 +156,10 @@ const CaseSummary = (props) => { .then((data) => data) .then(() => { getWatchedCasesProxy(loggedInUser).then((data) => { - setWatchedCases(data), + (setWatchedCases(data), getDetailsProxy(data, "myWatchedCases").then((data) => { setWatchedCasesDetails(data); - }); + })); }); }); @@ -184,12 +186,12 @@ const CaseSummary = (props) => { .then((data) => data) .then(() => { getWatchedCasesProxy(cookies.pinsUser).then((data) => { - setWatchedCases(data), + (setWatchedCases(data), getDetailsProxy(data, "myWatchedCases").then( (data) => { setWatchedCasesDetails(data); - } - ); + }, + )); }); }); }; @@ -214,28 +216,28 @@ const CaseSummary = (props) => { eval: true, })) : currentType == "watchedCases" - ? (casesObj = jsonpath({ - path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', - json: setCaseQueryObj, - eval: true, - })) - : currentType == "myCases" - ? (casesObj = jsonpath({ - path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]', - json: setCaseQueryObj, - eval: true, - })) - : currentType == "directResultsObj" - ? (casesObj = jsonpath({ - path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', - json: setCaseQueryObj, - eval: true, - })) - : (casesObj = jsonpath({ - path: '$..[?(@ && @.reference=="' + caseReference + '")]', - json: setCaseQueryObj, - eval: true, - })); + ? (casesObj = jsonpath({ + path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', + json: setCaseQueryObj, + eval: true, + })) + : currentType == "myCases" + ? (casesObj = jsonpath({ + path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]', + json: setCaseQueryObj, + eval: true, + })) + : currentType == "directResultsObj" + ? (casesObj = jsonpath({ + path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', + json: setCaseQueryObj, + eval: true, + })) + : (casesObj = jsonpath({ + path: '$..[?(@ && @.reference=="' + caseReference + '")]', + json: setCaseQueryObj, + eval: true, + })); casesObj = Object.assign({}, ...casesObj); @@ -248,12 +250,12 @@ const CaseSummary = (props) => { eval: true, })) : currentType == "directResultsObj" - ? (detailsObj = setCaseDetailsObj[0].value[0]) - : (detailsObj = jsonpath({ - path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', - jsopn: setCaseDetailsObj, - eval: true, - })); + ? (detailsObj = setCaseDetailsObj[0].value[0]) + : (detailsObj = jsonpath({ + path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', + jsopn: setCaseDetailsObj, + eval: true, + })); detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0]; @@ -281,10 +283,10 @@ const CaseSummary = (props) => { {currentType == "searchResultsObj" ? detailsObj.pinswg_name : currentType == "directResultsObj" - ? casesObj.title - : currentType == "watchedCases" - ? casesObj.pinswg_title - : casesObj.reference} + ? casesObj.title + : currentType == "watchedCases" + ? casesObj.pinswg_title + : casesObj.reference} {props.messagesObj["@odata.count"] > 0 && ( @@ -295,17 +297,19 @@ const CaseSummary = (props) => { {getFormCollectionByID( appealTypeID || setCaseQueryObj.value[0] - .pinswg_appealcasetype + .pinswg_appealcasetype, ).PrimaryIdAttribute == "pinswg_dnsid" ? t("case:summary-applicantonly-label") : getFormCollectionByID( - appealTypeID || - setCaseQueryObj.value[0] - .pinswg_appealcasetype - ).PrimaryIdAttribute == - "pinswg_nonvalidationid" - ? t("case:summary-appellantonly-label") - : t("case:summary-applicant-label")} + appealTypeID || + setCaseQueryObj.value[0] + .pinswg_appealcasetype, + ).PrimaryIdAttribute == + "pinswg_nonvalidationid" + ? t( + "case:summary-appellantonly-label", + ) + : t("case:summary-applicant-label")}
{casesObj.pinswg_appellantagent == 846040001 @@ -320,7 +324,7 @@ const CaseSummary = (props) => { {detailsObj.pinswg_agentcontactname != null && (_.has( detailsObj, - "pinswg_agentcontactname" + "pinswg_agentcontactname", ) ? (
@@ -329,7 +333,7 @@ const CaseSummary = (props) => {
{_.has( detailsObj, - "pinswg_agentcontactname" + "pinswg_agentcontactname", ) ? detailsObj.pinswg_agentcontactname : ""} @@ -346,44 +350,44 @@ const CaseSummary = (props) => { {getFormCollectionByID( appealTypeID || setCaseQueryObj.value[0] - .pinswg_appealcasetype + .pinswg_appealcasetype, ).PrimaryIdAttribute == "pinswg_dnsid" ? detailsObj.pinswg_projectlocation != null ? detailsObj.pinswg_projectlocation.indexOf( - ";" + ";", ) < 0 ? detailsObj.pinswg_projectlocation : router.locale == "cy" - ? detailsObj.pinswg_projectlocation.split( - ";" - )[1] - : detailsObj.pinswg_projectlocation.split( - ";" - )[0] + ? detailsObj.pinswg_projectlocation.split( + ";", + )[1] + : detailsObj.pinswg_projectlocation.split( + ";", + )[0] : "" : ""} {_.has( detailsObj, - "pinswg_siteaddressline1" + "pinswg_siteaddressline1", ) ? detailsObj.pinswg_siteaddressline1 : ""} {_.has( detailsObj, - "pinswg_siteaddressline1" + "pinswg_siteaddressline1", ) && detailsObj.pinswg_siteaddressline1 != null &&
} {_.has( detailsObj, - "pinswg_siteaddressline2" + "pinswg_siteaddressline2", ) ? detailsObj.pinswg_siteaddressline2 : ""} {_.has( detailsObj, - "pinswg_siteaddressline2" + "pinswg_siteaddressline2", ) && detailsObj.pinswg_siteaddressline2 != null &&
} @@ -392,25 +396,25 @@ const CaseSummary = (props) => { : ""} {_.has( detailsObj, - "pinswg_siteaddresstown" + "pinswg_siteaddresstown", ) && detailsObj.pinswg_siteaddresstown != null &&
} {_.has( detailsObj, - "pinswg_siteaddresscounty" + "pinswg_siteaddresscounty", ) ? detailsObj.pinswg_siteaddresscounty : ""} {_.has( detailsObj, - "pinswg_siteaddresscounty" + "pinswg_siteaddresscounty", ) && detailsObj.pinswg_siteaddresscounty != null &&
} {_.has( detailsObj, - "pinswg_siteaddresspostcode" + "pinswg_siteaddresspostcode", ) ? detailsObj.pinswg_siteaddresspostcode : ""} @@ -425,10 +429,12 @@ const CaseSummary = (props) => { {casesObj.description.indexOf(";") < 0 ? casesObj.description : router.locale == "cy" - ? casesObj.description.split(";")[1] - : casesObj.description.split( - ";" - )[0]} + ? casesObj.description.split( + ";", + )[1] + : casesObj.description.split( + ";", + )[0]}
)} @@ -453,7 +459,7 @@ const CaseSummary = (props) => { "pinswg_casestage@OData.Community.Display.V1.FormattedValue" ] || t( - "case:summary-no-date-entered-label" + "case:summary-no-date-entered-label", )} @@ -480,24 +486,24 @@ const CaseSummary = (props) => { {(_.has(detailsObj, "pinswg_startdate") || _.has( detailsObj, - "pinswg_applicationacceptedasvalid" + "pinswg_applicationacceptedasvalid", ) || _.has( detailsObj, - "pinswg_startdates" + "pinswg_startdates", )) && showReps( detailsObj.pinswg_startdate || detailsObj.pinswg_startdates || detailsObj.pinswg_applicationacceptedasvalid, detailsObj.pinswg_finalcommentsduedate || - detailsObj.pinswg_endofrepresentationperiod + detailsObj.pinswg_endofrepresentationperiod, ) && ( <> {showRepButton( props.currentView .caseReference - .appealType + .appealType, ) ? ( <> {ShowDocLinks ? ( @@ -513,7 +519,7 @@ const CaseSummary = (props) => { Notice {t( - "case:docsoffline-reps-label" + "case:docsoffline-reps-label", )} @@ -528,18 +534,18 @@ const CaseSummary = (props) => { "searchResultsObj" ? detailsObj.ticketnumber : currentType == - "watchedCases" - ? casesObj.pinswg_title - : currentType == - "directResultsObj" - ? detailsObj.ticketnumber - : casesObj.reference, + "watchedCases" + ? casesObj.pinswg_title + : currentType == + "directResultsObj" + ? detailsObj.ticketnumber + : casesObj.reference, }, }} className="govuk-button" > {t( - "case:summary-make-representation-label" + "case:summary-make-representation-label", )} )} @@ -551,7 +557,7 @@ const CaseSummary = (props) => { className="govuk-button govuk-button--secondary" > {t( - "case:summary-back-button-label" + "case:summary-back-button-label", )} @@ -571,7 +577,7 @@ const CaseSummary = (props) => { { startDate: formatDates( - detailsObj.pinswg_startdate + detailsObj.pinswg_startdate, ), endDate: props @@ -580,27 +586,27 @@ const CaseSummary = (props) => { .appealType == 846040019 ? formatDates( - detailsObj.pinswg_statementduedate + detailsObj.pinswg_statementduedate, ) : formatDates( - detailsObj.pinswg_finalcommentsduedate + detailsObj.pinswg_finalcommentsduedate, ), - } + }, )}
{" "} {t( - "case:representation-date-passed-additional-label" + "case:representation-date-passed-additional-label", )}{" "} {t( - "home:login-contact-email" + "home:login-contact-email", )}

@@ -614,40 +620,40 @@ const CaseSummary = (props) => { {session && (isWatchedCase( props.currentView.caseReference - .incidentid + .incidentid, ).length > 0 == true ? ( ) : ( @@ -689,14 +695,14 @@ const CaseSummary = (props) => { onClick={() => { confirm( t( - "case:you-are-watching-label" + "case:you-are-watching-label", ) + " " + props .currentView .caseReference .currentReference + - "?" + "?", ) && selectWatchedCase( props @@ -709,12 +715,12 @@ const CaseSummary = (props) => { props .currentView .caseReference - .appealType + .appealType, ); }} > {t( - "case:watch-this-case-link" + "case:watch-this-case-link", )} {/* {/* + + )} + + + {showNoticeFromEnv && ( +
+
- {t("common:signin-label")} - + + + Announcement + + +
+
+

+ {router.locale == "cy" + ? "Cyhoeddiad" + : "Announcement"} +

+
+
+ {router.locale == "cy" ? ( + <> +

+ Oherwydd gwaith cynnal a chadw + hanfodol, rydym yn disgwyl rhywfaint + o darfu ar ein gwasanaethau Porth + Gwaith Achos rhwng 9-13 Chwefror + 2026.{" "} +

+

+ Ymddiheurwn am yr anghyfleustra. Am + ymholiadau brys yn ystod y cyfnod + hwn, cysylltwch â{" "} + + pedw.gwaithachos@llyw.cymru + +

+ + ) : ( + <> +

+ Due to essential maintenance, we are + expecting some disruption to our + Casework Portal services between + 9-13 February 2026. +

+

+ We apologise for the inconvenience. + For urgent enquries during this time + please contact{" "} + + pedw.casework@gov.wales + +

+ + )} +
+
+
)} - + ); } diff --git a/pages/auth/signin.js b/pages/auth/signin.js index 747c76cb..1f9c5253 100644 --- a/pages/auth/signin.js +++ b/pages/auth/signin.js @@ -53,7 +53,9 @@ const SignIn = (props) => {

- {t("auth:auth-page-title")}{" "} + {t( + "auth:auth-page-title", + )}{" "}

@@ -91,7 +93,7 @@ const SignIn = (props) => { htmlFor="email" > {t( - "auth:auth-email-label" + "auth:auth-email-label", )} @@ -111,7 +113,7 @@ const SignIn = (props) => { } > {t( - "auth:auth-signin-button-label" + "auth:auth-signin-button-label", )}
@@ -132,10 +134,10 @@ const SignIn = (props) => { }; export async function getServerSideProps(context) { - if (process.env.SHOWLOGIN == false) { + if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) { return { redirect: { - destination: "/404", + destination: "/status", permanent: false, }, }; @@ -146,7 +148,7 @@ export async function getServerSideProps(context) { "\n//////////////////////\n", "Sign in callbackurl: " + context.query.callbackUrl, context.locale, - "\n//////////////////////\n" + "\n//////////////////////\n", ); let formURL = context.req.headers.host; //console.log("formUrl:", formURL); @@ -176,7 +178,7 @@ export async function getServerSideProps(context) { // Append the query parameters to the new URL 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 @@ -185,7 +187,7 @@ export async function getServerSideProps(context) { typeof context.query.callbackUrl != "undefined" && (formURL = appendParamsAndPathToNewUrl( context.query.callbackUrl, - formURL + formURL, )); //formURL = appendParamsAndPathToNewUrl(context.query.callbackUrl, formURL); diff --git a/pages/auth/signin2.js b/pages/auth/signin2.js index 569281e7..b4e703e3 100644 --- a/pages/auth/signin2.js +++ b/pages/auth/signin2.js @@ -236,10 +236,10 @@ export async function getServerSideProps(context) { }; } - if (process.env.SHOWLOGIN == false) { + if (process.env.SHOWLOGIN === "false" || process.env.SHOWLOGIN === false) { return { redirect: { - destination: "/404", + destination: "/status", permanent: false, }, }; @@ -250,7 +250,7 @@ export async function getServerSideProps(context) { "\n//////////////////////\n", "Sign in callbackurl: " + context.req.headers.host, context.locale, - csrfToken + "\n//////////////////////\n" + csrfToken + "\n//////////////////////\n", ); let formURL = context.req.headers.host; console.log("formUrl:", formURL); diff --git a/pages/case/[ticketnumber].js b/pages/case/[ticketnumber].js index c66c4cb8..2fc3a01d 100644 --- a/pages/case/[ticketnumber].js +++ b/pages/case/[ticketnumber].js @@ -102,7 +102,7 @@ const CaseHome = (props) => { representationsObj={ props.searchResultsObj.representationsObj } - showLoginCheck={true} + showLoginCheck={props.showLoginCheck} messagesObj={props.messagesObj} showFilteredDocs={props.showFilteredDocs} showMaps={props.showMaps} @@ -170,7 +170,7 @@ export const getServerSideProps = wrapper.getServerSideProps( console.log( searchResultsObj["@odata.count"] > 1 || - searchResultsObj["@odata.count"] < 1 + searchResultsObj["@odata.count"] < 1, ); if (searchResultsObj["@odata.count"] < 1) { @@ -211,7 +211,7 @@ export const getServerSideProps = wrapper.getServerSideProps( searchDetailsObj[0].value[0] .pinswg_specialistcaseprocess : "", - }) + }), ); } } @@ -225,13 +225,14 @@ export const getServerSideProps = wrapper.getServerSideProps( currentType: "directResultsObj", docsOffline: process.env.DOCAPI_OFFLINE || false, messagesObj: await getCaseMessage( - searchResultsObj.value[0].incidentid + searchResultsObj.value[0].incidentid, ), showFilteredDocs: process.env.SHOWFILTERDOCS || false, showMaps: process.env.SHOWMAPS, + showLoginCheck: process.env.SHOWLOGIIN || true, }, }; - } + }, ); const mapStateToProps = (state) => { diff --git a/pages/status.js b/pages/status.js index e59c8e59..17892561 100644 --- a/pages/status.js +++ b/pages/status.js @@ -1,28 +1,93 @@ import useTranslation from "next-translate/useTranslation"; 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(); const { footerLinks, pages } = props; return (
- Status Up + Site Status
+ +
-
-

Status Up

+
+ + + Announcement + + +
+
+

+ {router.locale == "cy" + ? "Cyhoeddiad" + : "Announcement"} +

+
+
+ {router.locale == "cy" ? ( + <> +

+ Oherwydd gwaith cynnal a + chadw hanfodol, rydym yn + disgwyl rhywfaint o darfu ar + ein gwasanaethau Porth + Gwaith Achos rhwng 9-13 + Chwefror 2026.{" "} +

+

+ Ymddiheurwn am yr + anghyfleustra. Am ymholiadau + brys yn ystod y cyfnod hwn, + cysylltwch â{" "} + + pedw.gwaithachos@llyw.cymru + +

+ + ) : ( + <> +

+ Due to essential + maintenance, we are + expecting some disruption to + our Casework Portal services + between 9-13 February 2026. +

+

+ We apologise for the + inconvenience. For urgent + enquries during this time + please contact{" "} + + pedw.casework@gov.wales + +

+ + )} +
+
+
); }; -export default FourOhFour; +export default StatusPage;