From 5013b967f338616f48ff3f0b7a72c85fc2a42ee1 Mon Sep 17 00:00:00 2001 From: robbond Date: Fri, 20 Feb 2026 07:40:27 +0000 Subject: [PATCH] reinstate sips rep button logic --- .prettierrc | 3 +- components/case/summary.js | 578 +++++++++++++++----------- pages/case/[ticketnumber].js | 5 +- pages/myportal/case/[ticketnumber].js | 4 - 4 files changed, 347 insertions(+), 243 deletions(-) diff --git a/.prettierrc b/.prettierrc index ced81142..d67fc9a8 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "tabWidth": 4, "useTabs": false, -"quoteProps":"preserve" + "quoteProps": "preserve", + "trailingComma": "none" } \ No newline at end of file diff --git a/components/case/summary.js b/components/case/summary.js index 83605ce4..94ebe0d6 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -16,17 +16,17 @@ import { getLinkedCases, getPortalModuleDetailsProxy, getWatchedCasesProxy, - setCaseInvolvment, + setCaseInvolvment } from "../../actions"; import { setCurrentLinkedCases, setCurrentReference, - setCurrentView, + setCurrentView } from "../../store/currentView/action"; import { setWatchedCases, - setWatchedCasesDetails, + setWatchedCasesDetails } from "../../store/watchedCases/action"; import { signIn, useSession } from "next-auth/react"; @@ -43,7 +43,7 @@ import { hasOwnPropertyAndNotNull, linkedCasesList, showRepsEnded, - getBilingualText, + getBilingualText } from "./summary/utils/helpers"; import CaseNoticeBanner from "./caseNoticeBanner"; @@ -79,13 +79,13 @@ const CaseSummary = (props) => { currentView, messagesObj, docsOffline, - ticketnumber, + ticketnumber } = props; - // const showLoginCheck = - // currentType == "directResultsObj" ? "true" : currentView.showLogin; + const showLoginCheck = + currentType == "directResultsObj" ? "true" : currentView.showLogin; - let showLoginCheck = props.showLoginCheck; + //let showLoginCheck = props.showLoginCheck; const { data: session, status } = useSession(); const [isModalOpen, setIsModalOpen] = useState(false); @@ -112,7 +112,7 @@ const CaseSummary = (props) => { let updateBody = { "pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")", "pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")", - "pinswg_appealcasetype": +appealType, + "pinswg_appealcasetype": +appealType }; createWatchedCases(updateBody) @@ -133,13 +133,13 @@ const CaseSummary = (props) => { emailaddress, loggedInUser, incidentID, - appealType, + appealType ) => { let updateBody = { "pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")", "pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")", "pinswg_appealcasetype": +appealType, - "pinswg_emailnotifications": true, + "pinswg_emailnotifications": true }; console.log("Email signed up"); @@ -152,9 +152,9 @@ const CaseSummary = (props) => { getDetailsProxy(data, "myWatchedCases").then( (data) => { setWatchedCasesDetails(data); - }, + } )); - }, + } ); }); }; @@ -166,7 +166,7 @@ const CaseSummary = (props) => { whichIncident + "')]", json: watchedCases, - eval: true, + eval: true }); return isWatched; @@ -180,7 +180,7 @@ const CaseSummary = (props) => { "' && @.pinswg_emailnotifications==true)]", json: watchedCases, - eval: true, + eval: true }); return isEmail; }; @@ -202,7 +202,7 @@ const CaseSummary = (props) => { let newObj = {}; return Object.assign(newObj, { "@odata.count": required.length, - "value": required, + "value": required }); }; @@ -217,7 +217,7 @@ const CaseSummary = (props) => { getDetailsProxy(data, "myWatchedCases").then( (data) => { setWatchedCasesDetails(data); - }, + } )); }); }); @@ -240,30 +240,30 @@ const CaseSummary = (props) => { ? (casesObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: searchResultsObj, - eval: true, + eval: true })) : currentType == "watchedCases" ? (casesObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: setCaseQueryObj, - eval: true, + eval: true })) : currentType == "myCases" ? (casesObj = jsonpath({ path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]', json: setCaseQueryObj, - eval: true, + eval: true })) : currentType == "directResultsObj" ? (casesObj = jsonpath({ path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]', json: setCaseQueryObj, - eval: true, + eval: true })) : (casesObj = jsonpath({ path: '$..[?(@ && @.reference=="' + caseReference + '")]', json: setCaseQueryObj, - eval: true, + eval: true })); casesObj = Object.assign({}, ...casesObj); @@ -274,14 +274,14 @@ const CaseSummary = (props) => { ? (detailsObj = jsonpath({ path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', json: searchDetailsObj, - eval: true, + eval: true })) : currentType == "directResultsObj" ? (detailsObj = setCaseDetailsObj[0].value[0]) : (detailsObj = jsonpath({ path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]', jsopn: setCaseDetailsObj, - eval: true, + eval: true })); detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0]; @@ -308,7 +308,7 @@ const CaseSummary = (props) => { detailsObj.pinswg_anticipatedgridreferencenorthingtext || detailsObj.pinswg_anticipatedgridrefnorthing, detailsObj.pinswg_anticipatedgridreferenceeastingtext || - detailsObj.pinswg_anticipatedgridrefeasting, + detailsObj.pinswg_anticipatedgridrefeasting ); siteCoords = point.toOSGB36(); //console.log(siteCoords); @@ -319,7 +319,7 @@ const CaseSummary = (props) => { : parseFloat(siteCoords.latitude), lng: isNaN(parseFloat(siteCoords.longitude)) ? -3.437989 - : parseFloat(siteCoords.longitude), + : parseFloat(siteCoords.longitude) }; const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12; @@ -377,19 +377,19 @@ const CaseSummary = (props) => { {((hasValidKey( detailsObj, - "pinswg_anticipatedgridreferencenorthingtext", + "pinswg_anticipatedgridreferencenorthingtext" ) && hasValidKey( detailsObj, - "pinswg_anticipatedgridreferenceeastingtext", + "pinswg_anticipatedgridreferenceeastingtext" )) || (hasValidKey( detailsObj, - "pinswg_anticipatedgridrefeasting", + "pinswg_anticipatedgridrefeasting" ) && hasValidKey( detailsObj, - "pinswg_anticipatedgridrefnorthing", + "pinswg_anticipatedgridrefnorthing" ))) && (
  • { {getFormCollectionByID( appealTypeID || setCaseQueryObj.value[0] - .pinswg_appealcasetype, + .pinswg_appealcasetype ).PrimaryIdAttribute == "pinswg_dnsid" ? t( - "case:summary-applicantonly-label", + "case:summary-applicantonly-label" ) : getFormCollectionByID( appealTypeID || setCaseQueryObj .value[0] - .pinswg_appealcasetype, + .pinswg_appealcasetype ).PrimaryIdAttribute == "pinswg_nonvalidationid" ? t( - "case:summary-appellantonly-label", + "case:summary-appellantonly-label" ) : t( - "case:summary-applicant-label", + "case:summary-applicant-label" )}
    @@ -543,18 +543,18 @@ const CaseSummary = (props) => { null && (_.has( detailsObj, - "pinswg_agentcontactname", + "pinswg_agentcontactname" ) ? (
    {t( - "case:summary-agent-label", + "case:summary-agent-label" )}
    {_.has( detailsObj, - "pinswg_agentcontactname", + "pinswg_agentcontactname" ) ? detailsObj.pinswg_agentcontactname : ""} @@ -566,135 +566,135 @@ const CaseSummary = (props) => {
    {t( - "case:summary-site-address-label", + "case:summary-site-address-label" )}
    {getFormCollectionByID( appealTypeID || setCaseQueryObj.value[0] - .pinswg_appealcasetype, + .pinswg_appealcasetype ).PrimaryIdAttribute == "pinswg_dnsid" || getFormCollectionByID( - appealTypeID, + appealTypeID ).PrimaryIdAttribute == "pinswg_sipscase" ? 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] : "" : ""} {_.has( detailsObj, - "pinswg_siteaddressline1", + "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddressline1 : ""} {_.has( detailsObj, - "pinswg_addressline1", + "pinswg_addressline1" ) ? detailsObj.pinswg_addressline1 : ""} {_.has( detailsObj, - "pinswg_siteaddressline1", + "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
    } {_.has( detailsObj, - "pinswg_addressline1", + "pinswg_addressline1" ) && detailsObj.pinswg_addressline1 != null &&
    } {_.has( detailsObj, - "pinswg_siteaddressline2", + "pinswg_siteaddressline2" ) ? detailsObj.pinswg_siteaddressline2 : ""} {_.has( detailsObj, - "pinswg_addressline2", + "pinswg_addressline2" ) ? detailsObj.pinswg_addressline2 : ""} {_.has( detailsObj, - "pinswg_addressline2", + "pinswg_addressline2" ) && detailsObj.pinswg_addressline2 != null &&
    } {_.has( detailsObj, - "pinswg_siteaddresstown", + "pinswg_siteaddresstown" ) ? detailsObj.pinswg_siteaddresstown : ""} {_.has( detailsObj, - "pinswg_addresstown", + "pinswg_addresstown" ) ? detailsObj.pinswg_addresstown : ""} {_.has( detailsObj, - "pinswg_siteaddresstown", + "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
    } {_.has( detailsObj, - "pinswg_addresstown", + "pinswg_addresstown" ) && detailsObj.pinswg_addresstown != null &&
    } {_.has( detailsObj, - "pinswg_siteaddresscounty", + "pinswg_siteaddresscounty" ) ? detailsObj.pinswg_siteaddresscounty : ""} {_.has( detailsObj, - "pinswg_addresscounty", + "pinswg_addresscounty" ) ? detailsObj.pinswg_addresscounty : ""} {_.has( detailsObj, - "pinswg_siteaddresscounty", + "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
    } {_.has( detailsObj, - "pinswg_addresscounty", + "pinswg_addresscounty" ) && detailsObj.pinswg_addresscounty != null &&
    } {_.has( detailsObj, - "pinswg_siteaddresspostcode", + "pinswg_siteaddresspostcode" ) ? detailsObj.pinswg_siteaddresspostcode : ""} {_.has( detailsObj, - "pinswg_postcode", + "pinswg_postcode" ) ? detailsObj.pinswg_postcode : ""} @@ -704,13 +704,13 @@ const CaseSummary = (props) => {
    {t( - "case:summary-description-label", + "case:summary-description-label" )}
    {getBilingualText( casesObj.description, - router.locale, + router.locale )}
    @@ -720,7 +720,7 @@ const CaseSummary = (props) => {
    {t( - "case:summary-case-stage-label", + "case:summary-case-stage-label" )}
    @@ -733,13 +733,13 @@ const CaseSummary = (props) => { ] + '")].value_cy', json: transLookup, - eval: true, + eval: true }) : detailsObj[ "pinswg_casestage@OData.Community.Display.V1.FormattedValue" ] || t( - "case:summary-no-date-entered-label", + "case:summary-no-date-entered-label" )}
    @@ -750,7 +750,7 @@ const CaseSummary = (props) => {
    {t( - "case:summary-environmental-statement-label", + "case:summary-environmental-statement-label" )}
    @@ -764,17 +764,17 @@ const CaseSummary = (props) => {
    {t( - "case:summary-last-modified-label", + "case:summary-last-modified-label" )}
    {detailsObj.modifiedon > casesObj.modifiedon ? formatDates( - detailsObj.modifiedon, + detailsObj.modifiedon ) : formatDates( - casesObj.modifiedon, + casesObj.modifiedon )}
    @@ -787,31 +787,20 @@ const CaseSummary = (props) => {
    - {(_.has( - detailsObj, - "pinswg_startdate", - ) || - _.has( - detailsObj, - "pinswg_applicationacceptedasvalid", - ) || - _.has( - detailsObj, - "pinswg_startdates", - )) && + {getFormCollectionByID( + appealTypeID + ).PrimaryIdAttribute == + "pinswg_sipscase" && showReps( - detailsObj.pinswg_startdate || - detailsObj.pinswg_startdates || - detailsObj.pinswg_applicationacceptedasvalid, - detailsObj.pinswg_finalcommentsduedate || - detailsObj.pinswg_endofrepresentationperiod, + detailsObj.pinswg_consultationopen, + detailsObj.pinswg_consultationclose ) && ( <> {showRepButton( props .currentView .caseReference - .appealType, + .appealType ) ? ( <> { case: currentType == "searchResultsObj" - ? detailsObj.ticketnumber + ? detailsObj.pinswg_name : currentType == "watchedCases" ? casesObj.pinswg_title : currentType == "directResultsObj" - ? detailsObj.ticketnumber - : casesObj.reference, - }, + ? detailsObj.pinswg_name + : casesObj.reference + } }} className="govuk-button" > - {t( - "case:summary-make-representation-label", - )} + {props + .currentView + .caseReference + .appealType == + 846040002 + ? t( + "case:summary-make-consultation-label" + ) + : t( + "case:summary-make-representation-label" + )} { className="govuk-button govuk-button--secondary" > {t( - "case:summary-back-button-label", + "case:summary-back-button-label" )} @@ -867,7 +864,118 @@ const CaseSummary = (props) => { { startDate: formatDates( - detailsObj.pinswg_startdate, + detailsObj.pinswg_consultationopen + ), + endDate: + formatDates( + detailsObj.pinswg_consultationclose + ) + } + )} +
    {" "} + {t( + "case:representation-date-passed-additional-label" + )}{" "} + + {t( + "home:login-contact-email" + )} + +

    +
    +
    + + )} + + )} + {(_.has( + detailsObj, + "pinswg_startdate" + ) || + _.has( + detailsObj, + "pinswg_applicationacceptedasvalid" + ) || + _.has( + detailsObj, + "pinswg_startdates" + )) && + showReps( + detailsObj.pinswg_startdate || + detailsObj.pinswg_startdates || + detailsObj.pinswg_applicationacceptedasvalid, + detailsObj.pinswg_finalcommentsduedate || + detailsObj.pinswg_endofrepresentationperiod + ) && ( + <> + {showRepButton( + props + .currentView + .caseReference + .appealType + ) ? ( + <> + + {t( + "case:summary-make-representation-label" + )} + + + { + //spinnerState(); + router.back(); + }} + className="govuk-button govuk-button--secondary" + > + {t( + "case:summary-back-button-label" + )} + + + ) : !isLPA && + props.currentView + .caseReference + .appealType == + 846040004 ? ( + "" + ) : ( + <> +
    +
    +

    + {t( + "case:representation-date-passed-label", + { + startDate: + formatDates( + detailsObj.pinswg_startdate ), endDate: props @@ -876,27 +984,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" )}

    @@ -911,7 +1019,7 @@ const CaseSummary = (props) => { (isWatchedCase( props.currentView .caseReference - .incidentid, + .incidentid ).length > 0 == true ? ( @@ -920,32 +1028,32 @@ const CaseSummary = (props) => { onClick={() => { (confirm( t( - "case:you-have-stopped-watching-label", + "case:you-have-stopped-watching-label" ) + props .currentView .caseReference .currentReference + - "?", + "?" ) && deleteItem( isWatchedCase( props .currentView .caseReference - .incidentid, + .incidentid )[0] .pinswg_watchlistid, - "watchedCases", + "watchedCases" ), setCurrentView( { "viewName": "Watched Cases", "viewKey": - "watchedCases", - }, + "watchedCases" + } )); setCurrentReference( { @@ -972,16 +1080,16 @@ const CaseSummary = (props) => { .caseReference .appealType, "showMap": - showMap, - }, + showMap + } ); }} title={t( - "case:stop-watching-case-link", + "case:stop-watching-case-link" )} > {t( - "case:stop-watching-case-link", + "case:stop-watching-case-link" )}{" "} ) : ( @@ -991,14 +1099,14 @@ const CaseSummary = (props) => { onClick={() => { confirm( t( - "case:you-are-watching-label", + "case:you-are-watching-label" ) + " " + props .currentView .caseReference .currentReference + - "?", + "?" ) && selectWatchedCase( props @@ -1011,12 +1119,12 @@ const CaseSummary = (props) => { props .currentView .caseReference - .appealType, + .appealType ); }} > {t( - "case:watch-this-case-link", + "case:watch-this-case-link" )} @@ -1025,7 +1133,7 @@ const CaseSummary = (props) => { (isEmailSignUp( props.currentView .caseReference - .incidentid, + .incidentid ).length > 0 == true ? ( @@ -1034,32 +1142,32 @@ const CaseSummary = (props) => { onClick={() => { (confirm( t( - "case:summary-unsubscribe-mail-label", + "case:summary-unsubscribe-mail-label" ) + props .currentView .caseReference .currentReference + - "?", + "?" ) && deleteItem( isEmailSignUp( props .currentView .caseReference - .incidentid, + .incidentid )[0] .pinswg_watchlistid, - "watchedCases", + "watchedCases" ), setCurrentView( { "viewName": "Watched Cases", "viewKey": - "watchedCases", - }, + "watchedCases" + } )); setCurrentReference( { @@ -1086,16 +1194,16 @@ const CaseSummary = (props) => { .caseReference .appealType, "showMap": - showMap, - }, + showMap + } ); }} title={t( - "case:stop-sending-email-notifications", + "case:stop-sending-email-notifications" )} > {t( - "case:stop-sending-email-notifications", + "case:stop-sending-email-notifications" )}{" "} ) : ( @@ -1105,14 +1213,14 @@ const CaseSummary = (props) => { onClick={() => { confirm( t( - "case:summary-subscribe-mail-label", + "case:summary-subscribe-mail-label" ) + " " + props .currentView .caseReference .currentReference + - "?", + "?" ) && selectEmailNotifications( props @@ -1129,12 +1237,12 @@ const CaseSummary = (props) => { props .currentView .caseReference - .appealType, + .appealType ); }} > {t( - "case:send-email-notifications", + "case:send-email-notifications" )} {/* {" "} @@ -1241,7 +1349,7 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_startdate", + "pinswg_startdate" ) && (detailsObj.pinswg_startdate != null || @@ -1249,7 +1357,7 @@ const CaseSummary = (props) => { null) && showRepsEnded( detailsObj.pinswg_startdate, - detailsObj.pinswg_finalcommentsduedate, + detailsObj.pinswg_finalcommentsduedate ) && (
    {props.currentView @@ -1257,10 +1365,10 @@ const CaseSummary = (props) => { .appealType == 84604002 ? t( - "case:consultation-period-ended-on-label", + "case:consultation-period-ended-on-label" ) : t( - "case:representation-period-ended-on-label", + "case:representation-period-ended-on-label" )} {props.currentView @@ -1268,10 +1376,10 @@ const CaseSummary = (props) => { .appealType == 846040019 ? formatDates( - detailsObj.pinswg_statementduedate, + detailsObj.pinswg_statementduedate ) : formatDates( - detailsObj.pinswg_finalcommentsduedate, + detailsObj.pinswg_finalcommentsduedate )}
    )} @@ -1295,25 +1403,25 @@ const CaseSummary = (props) => { formatDates, linkedCasesList, currentView, - showMap, + showMap )}
    {((hasValidKey( detailsObj, - "pinswg_anticipatedgridreferencenorthingtext", + "pinswg_anticipatedgridreferencenorthingtext" ) && hasValidKey( detailsObj, - "pinswg_anticipatedgridreferenceeastingtext", + "pinswg_anticipatedgridreferenceeastingtext" )) || (hasValidKey( detailsObj, - "pinswg_anticipatedgridrefeasting", + "pinswg_anticipatedgridrefeasting" ) && hasValidKey( detailsObj, - "pinswg_anticipatedgridrefnorthing", + "pinswg_anticipatedgridrefnorthing" ))) && (
    {
    {
    {t( - "case:summary-site-address-label", + "case:summary-site-address-label" )}
    {getFormCollectionByID( - appealTypeID, + appealTypeID ).PrimaryIdAttribute == "pinswg_dnsid" || getFormCollectionByID( - appealTypeID, + appealTypeID ).PrimaryIdAttribute == "pinswg_sipscase" ? 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] : "" : ""} {_.has( detailsObj, - "pinswg_siteaddressline1", + "pinswg_siteaddressline1" ) ? detailsObj.pinswg_siteaddressline1 : ""} {_.has( detailsObj, - "pinswg_addressline1", + "pinswg_addressline1" ) ? detailsObj.pinswg_addressline1 : ""} {_.has( detailsObj, - "pinswg_siteaddressline1", + "pinswg_siteaddressline1" ) && detailsObj.pinswg_siteaddressline1 != null &&
    } {_.has( detailsObj, - "pinswg_addressline1", + "pinswg_addressline1" ) && detailsObj.pinswg_addressline1 != null &&
    } {_.has( detailsObj, - "pinswg_siteaddressline2", + "pinswg_siteaddressline2" ) ? detailsObj.pinswg_siteaddressline2 : ""} {_.has( detailsObj, - "pinswg_addressline2", + "pinswg_addressline2" ) ? detailsObj.pinswg_addressline2 : ""} {_.has( detailsObj, - "pinswg_addressline2", + "pinswg_addressline2" ) && detailsObj.pinswg_addressline2 != null &&
    } {_.has( detailsObj, - "pinswg_siteaddresstown", + "pinswg_siteaddresstown" ) ? detailsObj.pinswg_siteaddresstown : ""} {_.has( detailsObj, - "pinswg_addresstown", + "pinswg_addresstown" ) ? detailsObj.pinswg_addresstown : ""} {_.has( detailsObj, - "pinswg_siteaddresstown", + "pinswg_siteaddresstown" ) && detailsObj.pinswg_siteaddresstown != null &&
    } {_.has( detailsObj, - "pinswg_addresstown", + "pinswg_addresstown" ) && detailsObj.pinswg_addresstown != null &&
    } {_.has( detailsObj, - "pinswg_siteaddresscounty", + "pinswg_siteaddresscounty" ) ? detailsObj.pinswg_siteaddresscounty : ""} {_.has( detailsObj, - "pinswg_addresscounty", + "pinswg_addresscounty" ) ? detailsObj.pinswg_addresscounty : ""} {_.has( detailsObj, - "pinswg_siteaddresscounty", + "pinswg_siteaddresscounty" ) && detailsObj.pinswg_siteaddresscounty != null &&
    } {_.has( detailsObj, - "pinswg_addresscounty", + "pinswg_addresscounty" ) && detailsObj.pinswg_addresscounty != null &&
    } {_.has( detailsObj, - "pinswg_siteaddresspostcode", + "pinswg_siteaddresspostcode" ) ? detailsObj.pinswg_siteaddresspostcode : ""} {_.has( detailsObj, - "pinswg_postcode", + "pinswg_postcode" ) ? detailsObj.pinswg_postcode : ""} @@ -1506,19 +1614,19 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_screeningstartdate", + "pinswg_screeningstartdate" ) ? !_.isEmpty( - detailsObj.pinswg_screeningstartdate, + detailsObj.pinswg_screeningstartdate ) ? formatDates( - detailsObj.pinswg_screeningstartdate, + detailsObj.pinswg_screeningstartdate ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    @@ -1529,26 +1637,26 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_eiatargetdate", + "pinswg_eiatargetdate" ) ? !_.isEmpty( - detailsObj.pinswg_eiatargetdate, + detailsObj.pinswg_eiatargetdate ) ? formatDates( - detailsObj.pinswg_eiatargetdate, + detailsObj.pinswg_eiatargetdate ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    {hasValidKey( detailsObj, - "pinswg_targetextended", + "pinswg_targetextended" ) && (
    @@ -1557,19 +1665,19 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_targetextended", + "pinswg_targetextended" ) ? !_.isEmpty( - detailsObj.pinswg_targetextended, + detailsObj.pinswg_targetextended ) ? formatDates( - detailsObj.pinswg_targetextended, + detailsObj.pinswg_targetextended ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    @@ -1582,37 +1690,37 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_directionissueddate", + "pinswg_directionissueddate" ) ? !_.isEmpty( - detailsObj.pinswg_directionissueddate, + detailsObj.pinswg_directionissueddate ) ? formatDates( - detailsObj.pinswg_directionissueddate, + detailsObj.pinswg_directionissueddate ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    {hasValidKey( detailsObj, - "pinswg_eiarequired", + "pinswg_eiarequired" ) && (
    {t( - "case:summary-eia-required-label", + "case:summary-eia-required-label" )}
    {_.has( detailsObj, - "pinswg_eiarequired", + "pinswg_eiarequired" ) ? detailsObj.pinswg_eiarequired ? router.locale == @@ -1624,7 +1732,7 @@ const CaseSummary = (props) => { ? "Na" : "No" : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    @@ -1648,19 +1756,19 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_scopingstartdate", + "pinswg_scopingstartdate" ) ? !_.isEmpty( - detailsObj.pinswg_scopingstartdate, + detailsObj.pinswg_scopingstartdate ) ? formatDates( - detailsObj.pinswg_scopingstartdate, + detailsObj.pinswg_scopingstartdate ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    @@ -1671,25 +1779,25 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_scopingtargetdate", + "pinswg_scopingtargetdate" ) ? !_.isEmpty( - detailsObj.pinswg_scopingtargetdate, + detailsObj.pinswg_scopingtargetdate ) ? formatDates( - detailsObj.pinswg_scopingtargetdate, + detailsObj.pinswg_scopingtargetdate ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    {hasValidKey( detailsObj, - "pinswg_scopingtargetextended", + "pinswg_scopingtargetextended" ) && (
    @@ -1699,19 +1807,19 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_scopingtargetextended", + "pinswg_scopingtargetextended" ) ? !_.isEmpty( - detailsObj.pinswg_scopingtargetextended, + detailsObj.pinswg_scopingtargetextended ) ? formatDates( - detailsObj.pinswg_scopingtargetextended, + detailsObj.pinswg_scopingtargetextended ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    @@ -1724,19 +1832,19 @@ const CaseSummary = (props) => {
    {_.has( detailsObj, - "pinswg_scopingoutcomeissueddate", + "pinswg_scopingoutcomeissueddate" ) ? !_.isEmpty( - detailsObj.pinswg_scopingoutcomeissueddate, + detailsObj.pinswg_scopingoutcomeissueddate ) ? formatDates( - detailsObj.pinswg_scopingoutcomeissueddate, + detailsObj.pinswg_scopingoutcomeissueddate ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" ) : t( - "case:summary-awaiting-information-label", + "case:summary-awaiting-information-label" )}
    @@ -1818,7 +1926,7 @@ const CaseSummary = (props) => {
    {noRepresentationLink.includes( - router.pathname, + router.pathname ) == true ? ( "" ) : ( @@ -1827,7 +1935,7 @@ const CaseSummary = (props) => { className="govuk-button" > {t( - "case:summary-make-representation-label", + "case:summary-make-representation-label" )} )} @@ -1855,10 +1963,10 @@ const CaseSummary = (props) => { formatDates, linkedCasesList, currentView, - showMap, + showMap ) { const id = getFormCollectionByID( - appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype, + appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype ).PrimaryIdAttribute; const Component = CaseTypes[capitalizeFirstLetter(id)]; @@ -1878,7 +1986,7 @@ const CaseSummary = (props) => { useEffect(() => { const linkCaseObj = async () => { let docObj = await getLinkedCases( - incidentid || setCaseQueryObj.value[0].incidentid, + incidentid || setCaseQueryObj.value[0].incidentid ).then((data) => { //console.log(data); setCurrentLinkedCases(data); @@ -1977,7 +2085,7 @@ const CaseSummary = (props) => { ? showReps( props.searchDetailsObj[0].value[0].pinswg_startdate, props.searchDetailsObj[0].value[0] - .pinswg_finalcommentsduedate, + .pinswg_finalcommentsduedate ) : true; @@ -1996,7 +2104,7 @@ const CaseSummary = (props) => { case 846040019: return showReps( props.searchDetailsObj[0].value[0].pinswg_startdate, - props.searchDetailsObj[0].value[0].pinswg_statementduedate, + props.searchDetailsObj[0].value[0].pinswg_statementduedate ); default: @@ -2016,7 +2124,7 @@ const CaseSummary = (props) => { selectWatchedCase( props.accountDetails.accountDetails.contactid, incidentid, - appealTypeID, + appealTypeID ); destroyCookie({}, "pedwWatchCase", { path: "/" }); } @@ -2037,7 +2145,7 @@ const mapStateToProps = (state) => { myCases: state.myCases, watchedCases: state.watchedCases, myRepresentations: state.myRepresentations, - awaitingSubmission: state.awaitingSubmission, + awaitingSubmission: state.awaitingSubmission }; }; @@ -2057,7 +2165,7 @@ const mapDispatchToProps = (dispatch) => { }, setCurrentView: (currentView) => { dispatch(setCurrentView(currentView)); - }, + } }; }; diff --git a/pages/case/[ticketnumber].js b/pages/case/[ticketnumber].js index 2605b89c..e34f30f2 100644 --- a/pages/case/[ticketnumber].js +++ b/pages/case/[ticketnumber].js @@ -88,9 +88,7 @@ const CaseHome = (props) => { .ticketnumber } ticketnumber={ - props.currentView.caseReference.ticketnumber - } - ticketnumber={ + props.currentView.caseReference.ticketnumber || props.searchResultsObj.searchResultsObj.value[0] .ticketnumber } @@ -254,6 +252,7 @@ export const getServerSideProps = wrapper.getServerSideProps( ), showFilteredDocs: process.env.SHOWFILTERDOCS || false, showMaps: process.env.SHOWMAPS, + showLoginCheck: process.env.SHOWLOGIN || false, }, }; }, diff --git a/pages/myportal/case/[ticketnumber].js b/pages/myportal/case/[ticketnumber].js index 22a071c4..96e0e7f0 100644 --- a/pages/myportal/case/[ticketnumber].js +++ b/pages/myportal/case/[ticketnumber].js @@ -114,10 +114,6 @@ const CaseHome = (props) => { props.currentView.caseReference.ticketnumber || router.query.ticketnumber } - ticketnumber={ - props.currentView.caseReference.ticketnumber || - router.query.ticketnumber - } currentType={props.currentType} appealTypeID={ props.currentView.caseReference.appealType