Merged PR 2262: shows primary lpa and then lists additional lps below on the portal summary tab

shows primary lpa and then lists additional lps below on the portal summary tab

Related work items: #22699
This commit is contained in:
Robert Bond
2026-04-21 08:39:37 +00:00
parent 05d83822f2
commit 5bf885933d
27 changed files with 4427 additions and 6127 deletions
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_advertsid = (props) => { const Pinswg_advertsid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -64,20 +65,16 @@ const Pinswg_advertsid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_callinss77id = (props) => { const Pinswg_callinss77id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_callinss77id = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_commonlandid = (props) => { const Pinswg_commonlandid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_commonlandid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_communityinfrastructurelevyid = (props) => { const Pinswg_communityinfrastructurelevyid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
+150 -267
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping/"; import GoogleMapComponent from "../../mapping/";
@@ -24,7 +25,7 @@ const Pinswg_dnsid = (props) => {
point = new OSPoint( point = new OSPoint(
detailsObj.pinswg_anticipatedgridreferencenorthingtext, detailsObj.pinswg_anticipatedgridreferencenorthingtext,
detailsObj.pinswg_anticipatedgridreferenceeastingtext, detailsObj.pinswg_anticipatedgridreferenceeastingtext
); );
siteCoords = point.toOSGB36(); siteCoords = point.toOSGB36();
//console.log(siteCoords); //console.log(siteCoords);
@@ -35,7 +36,7 @@ const Pinswg_dnsid = (props) => {
: parseFloat(siteCoords.latitude), : parseFloat(siteCoords.latitude),
lng: isNaN(parseFloat(siteCoords.longitude)) lng: isNaN(parseFloat(siteCoords.longitude))
? -3.437989 ? -3.437989
: parseFloat(siteCoords.longitude), : parseFloat(siteCoords.longitude)
}; };
const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12; const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12;
@@ -58,7 +59,7 @@ const Pinswg_dnsid = (props) => {
<p className="govuk-body"> <p className="govuk-body">
{getBilingualText( {getBilingualText(
detailsObj.pinswg_projectdescription, detailsObj.pinswg_projectdescription,
router.locale, router.locale
)} )}
</p> </p>
</div> </div>
@@ -67,7 +68,7 @@ const Pinswg_dnsid = (props) => {
<div <div
style={{ style={{
height: "40vh", height: "40vh",
width: "100%", width: "100%"
}} }}
> >
<GoogleMapComponent <GoogleMapComponent
@@ -95,11 +96,10 @@ const Pinswg_dnsid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -109,28 +109,23 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-no-date-entered-label", "case:summary-no-date-entered-label"
) )
} }
/> />
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label", "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -138,7 +133,7 @@ const Pinswg_dnsid = (props) => {
detailsObj.pinswg_webaddress + detailsObj.pinswg_webaddress +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: ( : (
<a <a
@@ -146,7 +141,7 @@ const Pinswg_dnsid = (props) => {
rel="noreferrer" rel="noreferrer"
href={ href={
detailsObj.pinswg_webaddress.indexOf( detailsObj.pinswg_webaddress.indexOf(
"https://", "https://"
) )
? "https://" + ? "https://" +
detailsObj.pinswg_webaddress detailsObj.pinswg_webaddress
@@ -159,45 +154,31 @@ const Pinswg_dnsid = (props) => {
</a> </a>
) || ) ||
t( t(
"case:summary-no-date-entered-label", "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-eia-required-label", "case:summary-eia-required-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -205,24 +186,21 @@ const Pinswg_dnsid = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] + ] +
'")].value_cy', '")].value_cy',
transLookup, transLookup
) )
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-procedure-label")} "case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -232,17 +210,15 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
@@ -277,13 +253,10 @@ const Pinswg_dnsid = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-type-of-event-label", "case:summary-type-of-event-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -293,68 +266,58 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-start-event-date-label", "case:summary-start-event-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_startdateofevent", "pinswg_startdateofevent"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent, detailsObj.pinswg_startdateofevent
) )
? formatDates( ? formatDates(
detailsObj.pinswg_startdateofevent, detailsObj.pinswg_startdateofevent
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-event-date-label")} "case:summary-event-date-label"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateeventrequested", "pinswg_dateeventrequested"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested, detailsObj.pinswg_dateeventrequested
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateeventrequested, detailsObj.pinswg_dateeventrequested
) )
: t( : t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
: t( : t(
"case:summary-to-be-confirmed-label", "case:summary-to-be-confirmed-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -370,13 +333,13 @@ const Pinswg_dnsid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
)} )}
<br /> <br />
@@ -389,54 +352,49 @@ const Pinswg_dnsid = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label", "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision", "pinswg_dateofdecision"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateofdecision, detailsObj.pinswg_dateofdecision
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateofdecision, detailsObj.pinswg_dateofdecision
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
: t( : t(
"case:summary-no-information-to-date-label", "case:summary-no-information-to-date-label"
) )
} }
/> />
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t(
"case:summary-case-link-status-label", "case:summary-case-link-status-label"
)} )}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, [
"numberofchildincidents", "numberofchildincidents"
]) ])
? casesObj.numberofchildincidents > ? casesObj.numberofchildincidents >
0 0
? t( ? t(
"case:summary-case-link-status-linked", "case:summary-case-link-status-linked"
) )
: t( : t(
"case:summary-case-link-status-not-linked", "case:summary-case-link-status-not-linked"
) )
: t( : t(
"case:summary-case-link-status-not-linked", "case:summary-case-link-status-not-linked"
)} )}
</dd> </dd>
</div> </div>
@@ -445,13 +403,13 @@ const Pinswg_dnsid = (props) => {
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t(
"case:summary-linked-cases-label", "case:summary-linked-cases-label"
)} )}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView
.linkedCaseReferences, .linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -509,370 +467,305 @@ const Pinswg_dnsid = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice", "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification", "pinswg_writtenacceptanceofnotification"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_writtenacceptanceofnotification, detailsObj.pinswg_writtenacceptanceofnotification
) )
? formatDates( ? formatDates(
detailsObj.pinswg_writtenacceptanceofnotification, detailsObj.pinswg_writtenacceptanceofnotification
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application", "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication", "pinswg_deadlineforsubmissionofapplication"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_deadlineforsubmissionofapplication, detailsObj.pinswg_deadlineforsubmissionofapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_deadlineforsubmissionofapplication, detailsObj.pinswg_deadlineforsubmissionofapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-submission-of-application", "case:summary-date-of-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofsubmissionofapplication", "pinswg_dateofsubmissionofapplication"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateofsubmissionofapplication, detailsObj.pinswg_dateofsubmissionofapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateofsubmissionofapplication, detailsObj.pinswg_dateofsubmissionofapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_applicationacceptedasvalid", "pinswg_applicationacceptedasvalid"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-accepted-as-valid", "case:summary-application-accepted-as-valid"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationacceptedasvalid, detailsObj.pinswg_applicationacceptedasvalid
) )
? formatDates( ? formatDates(
detailsObj.pinswg_applicationacceptedasvalid, detailsObj.pinswg_applicationacceptedasvalid
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_applicationrejectedasinvalid", "pinswg_applicationrejectedasinvalid"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-rejected-as-invalid", "case:summary-application-rejected-as-invalid"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) )
? formatDates( ? formatDates(
detailsObj.pinswg_applicationrejectedasinvalid, detailsObj.pinswg_applicationrejectedasinvalid
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-end-of-representation-period", "case:summary-end-of-representation-period"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_endofrepresentationperiod", "pinswg_endofrepresentationperiod"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_endofrepresentationperiod, detailsObj.pinswg_endofrepresentationperiod
) )
? formatDates( ? formatDates(
detailsObj.pinswg_endofrepresentationperiod, detailsObj.pinswg_endofrepresentationperiod
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_dateofrequesttovarytheapplication", "pinswg_dateofrequesttovarytheapplication"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication, detailsObj.pinswg_dateofrequesttovarytheapplication
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-request-to-vary", "case:summary-date-of-request-to-vary"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_dateofrequesttovarytheapplication, detailsObj.pinswg_dateofrequesttovarytheapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_dateofrequesttovarytheapplication, detailsObj.pinswg_dateofrequesttovarytheapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication", "pinswg_confirmrequesttovaryapplication"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) && ) &&
(_.has( (_.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication", "pinswg_rejectrequesttovaryapplication"
) && ) &&
_.isEmpty( _.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) ? ( ) ? (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-confirm-request-to-vary-application", "case:summary-confirm-request-to-vary-application"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
) : ( ) : (
"" ""
))} ))}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication", "pinswg_rejectrequesttovaryapplication"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) && ) &&
(_.has( (_.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication", "pinswg_confirmrequesttovaryapplication"
) && ) &&
_.isEmpty( _.isEmpty(
detailsObj.pinswg_confirmrequesttovaryapplication, detailsObj.pinswg_confirmrequesttovaryapplication
) ? ( ) ? (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-reject-request-to-vary-application", "case:summary-reject-request-to-vary-application"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) )
? formatDates( ? formatDates(
detailsObj.pinswg_rejectrequesttovaryapplication, detailsObj.pinswg_rejectrequesttovaryapplication
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
) : ( ) : (
"" ""
))} ))}
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_suspensionstartdates", "pinswg_suspensionstartdates"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_suspensionstartdates, detailsObj.pinswg_suspensionstartdates
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-start-dates", "case:summary-suspension-start-dates"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_suspensionstartdates, detailsObj.pinswg_suspensionstartdates
) )
? formatDates( ? formatDates(
detailsObj.pinswg_suspensionstartdates, detailsObj.pinswg_suspensionstartdates
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-end-dates", "case:summary-suspension-end-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionenddates", "pinswg_suspensionenddates"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_suspensionenddates, detailsObj.pinswg_suspensionenddates
) )
? formatDates( ? formatDates(
detailsObj.pinswg_suspensionenddates, detailsObj.pinswg_suspensionenddates
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-report-due-by")} label={t("case:summary-report-due-by")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportdueby", "pinswg_reportdueby"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_reportdueby, detailsObj.pinswg_reportdueby
) )
? formatDates( ? formatDates(
detailsObj.pinswg_reportdueby, detailsObj.pinswg_reportdueby
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t("case:summary-suspension-dates")} label={t("case:summary-suspension-dates")}
@@ -896,60 +789,50 @@ const Pinswg_dnsid = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-inspector-report-submission-to-welsh-government", "case:summary-inspector-report-submission-to-welsh-government"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment", "pinswg_inspectorreportsubmittedtowelshgovernment"
) )
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment, detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
) )
? formatDates( ? formatDates(
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment, detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
{_.has( {_.has(
detailsObj, detailsObj,
"pinswg_withdrawndate", "pinswg_withdrawndate"
) && ) &&
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_withdrawndate, detailsObj.pinswg_withdrawndate
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-withdrawn-date", "case:summary-withdrawn-date"
)} )}
value={ value={
!_.isEmpty( !_.isEmpty(
detailsObj.pinswg_withdrawndate, detailsObj.pinswg_withdrawndate
) )
? formatDates( ? formatDates(
detailsObj.pinswg_withdrawndate, detailsObj.pinswg_withdrawndate
) )
: t( : t(
"case:summary-awaiting-information-label", "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_electricityactid = (props) => { const Pinswg_electricityactid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -62,11 +63,10 @@ const Pinswg_electricityactid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -76,7 +76,7 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,42 +84,28 @@ const Pinswg_electricityactid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-eia-required-label" "case:summary-eia-required-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -135,9 +121,7 @@ const Pinswg_electricityactid = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -157,11 +141,10 @@ const Pinswg_electricityactid = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-procedure-label")} "case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -171,23 +154,18 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-type-of-event-label" "case:summary-type-of-event-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -197,21 +175,16 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -221,7 +194,7 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
@@ -229,9 +202,7 @@ const Pinswg_electricityactid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -247,7 +218,7 @@ const Pinswg_electricityactid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -274,7 +245,7 @@ const Pinswg_electricityactid = (props) => {
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, [
"numberofchildincidents", "numberofchildincidents"
]) ])
? casesObj.numberofchildincidents > ? casesObj.numberofchildincidents >
0 0
@@ -308,13 +279,10 @@ const Pinswg_electricityactid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-recommendation-label" "case:summary-case-recommendation-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -322,25 +290,20 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_recommendation + detailsObj.pinswg_recommendation +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_recommendation || : detailsObj.pinswg_recommendation ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label" "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -348,15 +311,13 @@ const Pinswg_electricityactid = (props) => {
detailsObj.pinswg_webaddress + detailsObj.pinswg_webaddress +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_webaddress || : detailsObj.pinswg_webaddress ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -371,11 +332,10 @@ const Pinswg_electricityactid = (props) => {
</h3> </h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-event-date-label")} "case:summary-event-date-label"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateeventrequested" "pinswg_dateeventrequested"
@@ -392,18 +352,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label" "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casedecisiondate" "pinswg_casedecisiondate"
@@ -420,22 +375,14 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-accepted-as-valid" "case:summary-application-accepted-as-valid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationacceptedasvalid" "pinswg_applicationacceptedasvalid"
@@ -452,20 +399,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-rejected-as-invalid" "case:summary-application-rejected-as-invalid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationrejectedasinvalid" "pinswg_applicationrejectedasinvalid"
@@ -482,18 +422,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-confirm-request-to-vary-application" "case:summary-confirm-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication" "pinswg_confirmrequesttovaryapplication"
@@ -510,18 +445,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-decisions" "case:summary-date-of-decisions"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision" "pinswg_dateofdecision"
@@ -538,18 +468,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-request-to-vary" "case:summary-date-of-request-to-vary"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofrequesttovarytheapplication" "pinswg_dateofrequesttovarytheapplication"
@@ -566,18 +491,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-submission-of-application" "case:summary-date-of-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofsubmissionofapplication" "pinswg_dateofsubmissionofapplication"
@@ -594,18 +514,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-project-published-to-website" "case:summary-date-project-published-to-website"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateprojectpublishedonwebsite" "pinswg_dateprojectpublishedonwebsite"
@@ -622,18 +537,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application" "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication" "pinswg_deadlineforsubmissionofapplication"
@@ -650,18 +560,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-end-of-representation-period" "case:summary-end-of-representation-period"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_endofrepresentationperiod" "pinswg_endofrepresentationperiod"
@@ -678,18 +583,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-inspector-report-submission-to-welsh-government" "case:summary-inspector-report-submission-to-welsh-government"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment" "pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -706,18 +606,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-procedure-confirmed" "case:summary-procedure-confirmed"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_procedureconfirmed" "pinswg_procedureconfirmed"
@@ -734,18 +629,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-reject-request-to-vary-application" "case:summary-reject-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication" "pinswg_rejectrequesttovaryapplication"
@@ -762,16 +652,11 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-report-due-by")} label={t("case:summary-report-due-by")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportdueby" "pinswg_reportdueby"
@@ -788,16 +673,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-suspension-dates")} "case:summary-suspension-dates"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensiondates" "pinswg_suspensiondates"
@@ -814,18 +696,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-end-dates" "case:summary-suspension-end-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionenddates" "pinswg_suspensionenddates"
@@ -842,18 +719,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-start-dates" "case:summary-suspension-start-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionstartdates" "pinswg_suspensionstartdates"
@@ -870,18 +742,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application" "case:summary-valid-notice-of-intention-to-submit-an-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati" "pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -898,16 +765,11 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-withdrawn-date")} label={t("case:summary-withdrawn-date")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_withdrawndate" "pinswg_withdrawndate"
@@ -924,18 +786,13 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice" "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification" "pinswg_writtenacceptanceofnotification"
@@ -952,9 +809,7 @@ const Pinswg_electricityactid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
</dl> </dl>
</div> </div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementlistedbuildingconseid = (props) => { const Pinswg_enforcementlistedbuildingconseid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_enforcementnoticeappeals174id = (props) => { const Pinswg_enforcementnoticeappeals174id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -451,20 +369,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_environmentalpermittingid = (props) => { const Pinswg_environmentalpermittingid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_environmentalpermittingid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_environmentalpermittingid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_environmentalpermittingid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_environmentalpermittingid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_environmentalpermittingid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -222,19 +199,18 @@ const Pinswg_environmentalpermittingid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -242,12 +218,10 @@ const Pinswg_environmentalpermittingid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -258,50 +232,34 @@ const Pinswg_environmentalpermittingid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -311,25 +269,14 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -339,22 +286,16 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -380,25 +321,16 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -408,11 +340,8 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -436,13 +365,9 @@ const Pinswg_environmentalpermittingid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -452,24 +377,14 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -479,20 +394,13 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -502,10 +410,8 @@ const Pinswg_environmentalpermittingid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_harbourrevisionorderid = (props) => { const Pinswg_harbourrevisionorderid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -62,11 +63,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -76,7 +76,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -84,42 +84,28 @@ const Pinswg_harbourrevisionorderid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-eia-required-label" "case:summary-eia-required-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -135,9 +121,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -157,11 +141,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-procedure-label")} "case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -171,21 +154,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -195,7 +173,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
@@ -203,9 +181,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -221,7 +197,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -248,7 +224,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, [
"numberofchildincidents", "numberofchildincidents"
]) ])
? casesObj.numberofchildincidents > ? casesObj.numberofchildincidents >
0 0
@@ -282,13 +258,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-recommendation-label" "case:summary-case-recommendation-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -296,25 +269,20 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_recommendation + detailsObj.pinswg_recommendation +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_recommendation || : detailsObj.pinswg_recommendation ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label" "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -322,15 +290,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
detailsObj.pinswg_webaddress + detailsObj.pinswg_webaddress +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj.pinswg_webaddress || : detailsObj.pinswg_webaddress ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -345,11 +311,10 @@ const Pinswg_harbourrevisionorderid = (props) => {
</h3> </h3>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-event-date-label")} "case:summary-event-date-label"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateeventrequested" "pinswg_dateeventrequested"
@@ -366,18 +331,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label" "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casedecisiondate" "pinswg_casedecisiondate"
@@ -394,22 +354,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-accepted-as-valid" "case:summary-application-accepted-as-valid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationacceptedasvalid" "pinswg_applicationacceptedasvalid"
@@ -426,20 +378,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-application-rejected-as-invalid" "case:summary-application-rejected-as-invalid"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_applicationrejectedasinvalid" "pinswg_applicationrejectedasinvalid"
@@ -456,18 +401,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-confirm-request-to-vary-application" "case:summary-confirm-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_confirmrequesttovaryapplication" "pinswg_confirmrequesttovaryapplication"
@@ -484,18 +424,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-decisions" "case:summary-date-of-decisions"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision" "pinswg_dateofdecision"
@@ -512,18 +447,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-request-to-vary" "case:summary-date-of-request-to-vary"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofrequesttovarytheapplication" "pinswg_dateofrequesttovarytheapplication"
@@ -540,18 +470,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-of-submission-of-application" "case:summary-date-of-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofsubmissionofapplication" "pinswg_dateofsubmissionofapplication"
@@ -568,18 +493,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-date-project-published-to-website" "case:summary-date-project-published-to-website"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateprojectpublishedonwebsite" "pinswg_dateprojectpublishedonwebsite"
@@ -596,18 +516,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application" "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication" "pinswg_deadlineforsubmissionofapplication"
@@ -624,18 +539,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-end-of-representation-period" "case:summary-end-of-representation-period"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_endofrepresentationperiod" "pinswg_endofrepresentationperiod"
@@ -652,18 +562,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-inspector-report-submission-to-welsh-government" "case:summary-inspector-report-submission-to-welsh-government"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_inspectorreportsubmittedtowelshgovernment" "pinswg_inspectorreportsubmittedtowelshgovernment"
@@ -680,18 +585,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-procedure-confirmed" "case:summary-procedure-confirmed"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_procedureconfirmed" "pinswg_procedureconfirmed"
@@ -708,18 +608,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-reject-request-to-vary-application" "case:summary-reject-request-to-vary-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_rejectrequesttovaryapplication" "pinswg_rejectrequesttovaryapplication"
@@ -736,16 +631,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-report-due-by")} label={t("case:summary-report-due-by")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportdueby" "pinswg_reportdueby"
@@ -762,16 +652,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-suspension-dates")} "case:summary-suspension-dates"
)}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensiondates" "pinswg_suspensiondates"
@@ -788,18 +675,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-end-dates" "case:summary-suspension-end-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionenddates" "pinswg_suspensionenddates"
@@ -816,18 +698,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-suspension-start-dates" "case:summary-suspension-start-dates"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_suspensionstartdates" "pinswg_suspensionstartdates"
@@ -844,18 +721,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application" "case:summary-valid-notice-of-intention-to-submit-an-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validnoticeofintentiontosubmitanapplicati" "pinswg_validnoticeofintentiontosubmitanapplicati"
@@ -872,16 +744,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-withdrawn-date")} label={t("case:summary-withdrawn-date")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_withdrawndate" "pinswg_withdrawndate"
@@ -898,18 +765,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice" "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification" "pinswg_writtenacceptanceofnotification"
@@ -926,9 +788,7 @@ const Pinswg_harbourrevisionorderid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
</dl> </dl>
</div> </div>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_hedgeshedgerowstreepreservatioid = (props) => { const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,24 +33,19 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={"Specialist Case Process"} label={"Specialist Case Process"}
value={
router.locale == "cy"
value={router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -59,43 +54,33 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
<>
value={router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true, }
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -107,16 +92,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -125,18 +107,17 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -145,18 +126,17 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -165,15 +145,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -189,7 +167,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -210,16 +188,11 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -235,14 +208,11 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -250,19 +220,18 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -270,12 +239,10 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -286,50 +253,34 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -339,25 +290,14 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -367,22 +307,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -408,25 +342,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -436,11 +361,8 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -464,13 +386,9 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -480,24 +398,14 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -507,20 +415,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -530,10 +431,8 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_householderappealhasid = (props) => { const Pinswg_householderappealhasid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -43,20 +44,16 @@ const Pinswg_householderappealhasid = (props) => {
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true </>
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_lawfuldevelopmentcertificatappid = (props) => { const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -451,20 +369,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
+76 -167
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_ldpid = (props) => { const Pinswg_ldpid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_ldpid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,44 +33,34 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
value={router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -79,19 +69,17 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -100,18 +88,17 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -120,15 +107,13 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -144,7 +129,7 @@ const Pinswg_ldpid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -165,16 +150,11 @@ const Pinswg_ldpid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -190,14 +170,11 @@ const Pinswg_ldpid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -213,50 +190,34 @@ const Pinswg_ldpid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -266,25 +227,14 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -294,22 +244,16 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -335,25 +279,16 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -363,11 +298,8 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -391,13 +323,9 @@ const Pinswg_ldpid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -407,24 +335,14 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -434,20 +352,13 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -457,10 +368,8 @@ const Pinswg_ldpid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_listedbuildingandconservationrid = (props) => { const Pinswg_listedbuildingandconservationrid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_starttimeofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_starttimeofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_starttimeofevent detailsObj.pinswg_starttimeofevent
) )
@@ -451,20 +369,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_maintenanceoflands217id = (props) => { const Pinswg_maintenanceoflands217id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_maintenanceoflands217id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_maintenanceoflands217id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_maintenanceoflands217id = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_maintenanceoflands217id = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_maintenanceoflands217id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_maintenanceoflands217id = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -451,20 +369,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_maintenanceoflands217id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_miscellaneouscasewordid = (props) => { const Pinswg_miscellaneouscasewordid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_miscellaneouscasewordid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_miscellaneouscasewordid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -222,19 +199,18 @@ const Pinswg_miscellaneouscasewordid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -242,12 +218,10 @@ const Pinswg_miscellaneouscasewordid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -258,50 +232,34 @@ const Pinswg_miscellaneouscasewordid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -311,25 +269,14 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -339,22 +286,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -380,25 +321,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -408,11 +340,8 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -436,13 +365,9 @@ const Pinswg_miscellaneouscasewordid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -452,24 +377,14 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -479,20 +394,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -502,10 +410,8 @@ const Pinswg_miscellaneouscasewordid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_nonvalidationid = (props) => { const Pinswg_nonvalidationid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,11 +22,8 @@ const Pinswg_nonvalidationid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -35,67 +33,33 @@ const Pinswg_nonvalidationid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true,
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
{/* <SummaryRow
label={t("case:summary-procedure-label")}
value={
router.locale == "cy"
? jsonpath({path:
'$..[?(@ && @.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
json: transLookup,
eval: true,
})
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""
}
/> */}
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -105,17 +69,13 @@ const Pinswg_nonvalidationid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -131,7 +91,7 @@ const Pinswg_nonvalidationid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue" "pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
@@ -158,55 +118,32 @@ const Pinswg_nonvalidationid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={ value={
_.has(detailsObj, "pinswg_validdate") _.has(detailsObj, "pinswg_validdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_validdate)
detailsObj.pinswg_validdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_validdate detailsObj.pinswg_validdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={ value={
_.has(detailsObj, "pinswg_decisionissueddate")
_.has(
detailsObj,
"pinswg_decisionissueddate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_decisionissueddate detailsObj.pinswg_decisionissueddate
) )
@@ -216,14 +153,8 @@ const Pinswg_nonvalidationid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label"
)
} }
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayValue, getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningappeals78id = (props) => { const Pinswg_planningappeals78id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -41,35 +42,23 @@ const Pinswg_planningappeals78id = (props) => {
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -83,16 +72,11 @@ const Pinswg_planningappeals78id = (props) => {
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-to-be-confirmed-label") t("case:summary-to-be-confirmed-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -107,16 +91,11 @@ const Pinswg_planningappeals78id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -134,16 +113,11 @@ const Pinswg_planningappeals78id = (props) => {
t( t(
"case:summary-no-information-to-date-label" "case:summary-no-information-to-date-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -159,9 +133,7 @@ const Pinswg_planningappeals78id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-no-date-entered-label") t("case:summary-no-date-entered-label")
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -196,11 +168,8 @@ const Pinswg_planningappeals78id = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={ value={
_.has(detailsObj, "pinswg_casedecisiondate") _.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
@@ -212,9 +181,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -259,11 +226,8 @@ const Pinswg_planningappeals78id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={ value={
_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate) ? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates( ? formatDates(
@@ -281,24 +245,15 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
label={t("case:summary-questionnaire-due-date-label")} )}
value={ value={
_.has(detailsObj, "pinswg_questionnaireduedate")
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -309,24 +264,14 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-statement-interested-party-due-date-label" "case:summary-statement-interested-party-due-date-label"
)} )}
value={ value={
_.has(detailsObj, "pinswg_statementduedate") _.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
@@ -338,11 +283,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{/* <SummaryRow {/* <SummaryRow
@@ -383,18 +324,9 @@ const Pinswg_planningappeals78id = (props) => {
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-final-comments-date-label")} label={t("case:summary-final-comments-date-label")}
value={ value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -405,11 +337,7 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -457,14 +385,8 @@ const Pinswg_planningappeals78id = (props) => {
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_startdatetimeiftheevent" "pinswg_startdatetimeiftheevent"
@@ -479,22 +401,15 @@ const Pinswg_planningappeals78id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{detailsObj.pinswg_typeofevent == 846040002 || {detailsObj.pinswg_typeofevent == 846040002 ||
detailsObj.pinswg_typeofevent == 846040007 || detailsObj.pinswg_typeofevent == 846040007 ||
detailsObj.pinswg_typeofevent == 846040012 || detailsObj.pinswg_typeofevent == 846040012 ||
detailsObj.pinswg_typeofevent == 846040009 ? ( detailsObj.pinswg_typeofevent == 846040009 ? (
<SummaryRow <SummaryRow
label={t("case:summary-start-event-time-label")} label={t("case:summary-start-event-time-label")}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_startdatetimeiftheevent" "pinswg_startdatetimeiftheevent"
@@ -512,9 +427,7 @@ const Pinswg_planningappeals78id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
) : ( ) : (
"" ""
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningconditionss73s79id = (props) => { const Pinswg_planningconditionss73s79id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -41,35 +42,23 @@ const Pinswg_planningconditionss73s79id = (props) => {
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={ value={
<>
router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -83,16 +72,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-to-be-confirmed-label") t("case:summary-to-be-confirmed-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -107,16 +91,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -131,16 +110,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || "" ] || ""
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
@@ -156,9 +130,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t("case:summary-no-date-entered-label") t("case:summary-no-date-entered-label")
} }
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -235,11 +207,8 @@ const Pinswg_planningconditionss73s79id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={ value={
_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty(detailsObj.pinswg_startdate) ? !_.isEmpty(detailsObj.pinswg_startdate)
? formatDates( ? formatDates(
@@ -257,24 +226,15 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t(
"case:summary-questionnaire-due-date-label"
label={t("case:summary-questionnaire-due-date-label")} )}
value={ value={
_.has(detailsObj, "pinswg_questionnaireduedate")
_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -285,22 +245,12 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")} label={t("case:summary-statement-due-date-label")}
value={ value={
_.has(detailsObj, "pinswg_statementduedate") _.has(detailsObj, "pinswg_statementduedate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
@@ -312,22 +262,14 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t(
"case:summary-interested-party-date-label"
label={t("case:summary-interested-party-date-label")} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
@@ -355,28 +297,15 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={ value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -387,11 +316,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -417,11 +342,8 @@ const Pinswg_planningconditionss73s79id = (props) => {
} }
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={ value={
_.has(detailsObj, "pinswg_dateeventrequested") _.has(detailsObj, "pinswg_dateeventrequested")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
@@ -433,20 +355,12 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")} label={t("case:summary-start-event-date-label")}
value={ value={
_.has(detailsObj, "pinswg_startdateofevent") _.has(detailsObj, "pinswg_startdateofevent")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
@@ -458,18 +372,11 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={ value={
_.has(detailsObj, "pinswg_casedecisiondate") _.has(detailsObj, "pinswg_casedecisiondate")
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
@@ -481,9 +388,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t("case:summary-no-date-entered-label") : t("case:summary-no-date-entered-label")
} }
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_planningobligationappeals106id = (props) => { const Pinswg_planningobligationappeals106id = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_planningobligationappeals106id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_planningobligationappeals106id = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_planningobligationappeals106id = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_planningobligationappeals106id = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -230,50 +207,34 @@ const Pinswg_planningobligationappeals106id = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -283,25 +244,14 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -311,22 +261,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -352,25 +296,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -380,11 +315,8 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -408,13 +340,9 @@ const Pinswg_planningobligationappeals106id = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -424,24 +352,14 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -451,20 +369,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -474,10 +385,8 @@ const Pinswg_planningobligationappeals106id = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
+91 -192
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_rowid = (props) => { const Pinswg_rowid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_rowid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,24 +33,19 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={"Specialist Case Process"} label={"Specialist Case Process"}
value={
router.locale == "cy"
value={router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -59,43 +54,33 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
<>
value={router.locale == "cy" {getCaseLpaDisplayLines({
? jsonpath({ casesObj,
path: detailsObj,
'$..[?(@ && @.value=="' + locale: router.locale,
casesObj[ transLookup
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" }).map((name) => (
] + <div key={name}>{name}</div>
'")].value_cy', ))}
json: transLookup, </>
eval: true, }
})
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -107,16 +92,13 @@ const Pinswg_rowid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -125,18 +107,17 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -145,18 +126,17 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -165,15 +145,13 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -189,7 +167,7 @@ const Pinswg_rowid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -210,16 +188,11 @@ const Pinswg_rowid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -235,14 +208,11 @@ const Pinswg_rowid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -250,19 +220,18 @@ const Pinswg_rowid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -270,12 +239,10 @@ const Pinswg_rowid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -286,50 +253,34 @@ const Pinswg_rowid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -339,25 +290,14 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -367,22 +307,16 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -408,25 +342,16 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -436,11 +361,8 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -464,13 +386,9 @@ const Pinswg_rowid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -480,24 +398,14 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateoftheevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateoftheevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateoftheevent detailsObj.pinswg_startdateoftheevent
) )
@@ -507,20 +415,13 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -530,10 +431,8 @@ const Pinswg_rowid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
+25 -113
View File
@@ -5,6 +5,7 @@ import useTranslation from "next-translate/useTranslation";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
import GoogleMapComponent from "../../mapping"; import GoogleMapComponent from "../../mapping";
@@ -86,11 +87,10 @@ const Pinswg_sipscase = (props) => {
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t(
label={t("case:summary-case-type-label")} "case:summary-case-type-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -106,9 +106,7 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
{hasValidKey( {hasValidKey(
@@ -116,11 +114,8 @@ const Pinswg_sipscase = (props) => {
"_pinswg_projecttype_value" "_pinswg_projecttype_value"
) && ( ) && (
<SummaryRow <SummaryRow
label={"Project Type"} label={"Project Type"}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -136,21 +131,16 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
{detailsObj.pinswg_webaddress != null && ( {detailsObj.pinswg_webaddress != null && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-website-label" "case:summary-case-website-label"
)} )}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -179,9 +169,7 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
} }
/> />
)} )}
{/* <div className="govuk-summary-list__row"> {/* <div className="govuk-summary-list__row">
@@ -190,32 +178,26 @@ const Pinswg_sipscase = (props) => {
</dt> </dt>
<dd className="govuk-summary-list__value"></dd> <dd className="govuk-summary-list__value"></dd>
</div> */} </div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-lpa-label")}
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
</dd>
</div>
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")}
label={t("case:summary-procedure-label")} value={
<>
{getCaseLpaDisplayLines({
casesObj,
detailsObj,
locale: router.locale,
transLookup
}).map((name) => (
<div key={name}>{name}</div>
))}
</>
}
/>
<SummaryRow
label={t(
"case:summary-procedure-label"
)}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -231,16 +213,11 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={"ES Submitted"} label={"ES Submitted"}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -256,16 +233,13 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={
label={"Deemed Marine License Applied for"} "Deemed Marine License Applied for"
}
value={ value={
router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
@@ -281,9 +255,7 @@ const Pinswg_sipscase = (props) => {
t( t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
/> />
{/* <SummaryRow {/* <SummaryRow
@@ -422,13 +394,10 @@ const Pinswg_sipscase = (props) => {
</dd> </dd>
</div> </div>
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-date-label" "case:summary-decision-date-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_dateofdecision" "pinswg_dateofdecision"
@@ -445,9 +414,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-no-information-to-date-label" "case:summary-no-information-to-date-label"
) )
} }
/> />
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
@@ -525,13 +492,10 @@ const Pinswg_sipscase = (props) => {
</h4> </h4>
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-valid-notice-of-intention-to-submit-an-application" "case:summary-valid-notice-of-intention-to-submit-an-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validnoticeofintentiontosubmit" "pinswg_validnoticeofintentiontosubmit"
@@ -548,18 +512,13 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-written-acceptance-of-notice" "case:summary-written-acceptance-of-notice"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_writtenacceptanceofnotification" "pinswg_writtenacceptanceofnotification"
@@ -576,18 +535,13 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-deadline-for-submission-of-application" "case:summary-deadline-for-submission-of-application"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_deadlineforsubmissionofapplication" "pinswg_deadlineforsubmissionofapplication"
@@ -604,9 +558,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
</dl> </dl>
</div> </div>
@@ -635,13 +587,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_validationdeadlineextension" "pinswg_validationdeadlineextension"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-validation-deadline-extension" "case:summary-validation-deadline-extension"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_validationdeadlineextension" "pinswg_validationdeadlineextension"
@@ -658,9 +607,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -668,13 +615,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionstartdate" "pinswg_casesuspensionstartdate"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-suspension-start-date" "case:summary-case-suspension-start-date"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casesuspensionstartdate" "pinswg_casesuspensionstartdate"
@@ -691,9 +635,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -701,13 +643,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_casesuspensionenddate" "pinswg_casesuspensionenddate"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-suspension-end-date" "case:summary-case-suspension-end-date"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_casesuspensionenddate" "pinswg_casesuspensionenddate"
@@ -724,9 +663,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -757,13 +694,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_reportissuedtowelshministers" "pinswg_reportissuedtowelshministers"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-report-issued-to-welsh-ministers" "case:summary-report-issued-to-welsh-ministers"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_reportissuedtowelshministers" "pinswg_reportissuedtowelshministers"
@@ -780,9 +714,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -790,13 +722,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionissuedtoapplicant" "pinswg_decisionissuedtoapplicant"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-issued-to-applicant" "case:summary-decision-issued-to-applicant"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_decisionissuedtoapplicant" "pinswg_decisionissuedtoapplicant"
@@ -813,9 +742,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -823,13 +750,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_decisionoutcome" "pinswg_decisionoutcome"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-decision-outcome" "case:summary-decision-outcome"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_decisionoutcome" "pinswg_decisionoutcome"
@@ -846,9 +770,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
@@ -872,13 +794,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_redetermination" "pinswg_redetermination"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-post-decision-redetermination-label" "case:summary-post-decision-redetermination-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_redetermination@OData.Community.Display.V1.FormattedValue" "pinswg_redetermination@OData.Community.Display.V1.FormattedValue"
@@ -897,9 +816,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
{hasValidKey( {hasValidKey(
@@ -907,13 +824,10 @@ const Pinswg_sipscase = (props) => {
"pinswg_redeterminationconsultationdeadline" "pinswg_redeterminationconsultationdeadline"
) && ( ) && (
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-post-decision-redetermination-deadline-label" "case:summary-post-decision-redetermination-deadline-label"
)} )}
value={ value={
_.has( _.has(
detailsObj, detailsObj,
"pinswg_redeterminationconsultationdeadline" "pinswg_redeterminationconsultationdeadline"
@@ -930,9 +844,7 @@ const Pinswg_sipscase = (props) => {
: t( : t(
"case:summary-awaiting-information-label" "case:summary-awaiting-information-label"
) )
} }
/> />
)} )}
</dl> </dl>
+86 -180
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/router";
import transLookup from "../../../data/lookuptranslations.json"; import transLookup from "../../../data/lookuptranslations.json";
import SummaryCard from "../summary/components/SummaryCard"; import SummaryCard from "../summary/components/SummaryCard";
import SummaryRow from "../summary/components/SummaryRow"; import SummaryRow from "../summary/components/SummaryRow";
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
const Pinswg_wayleaveid = (props) => { const Pinswg_wayleaveid = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -21,10 +22,9 @@ const Pinswg_wayleaveid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-case-type-label")} label={t("case:summary-case-type-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -33,41 +33,33 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-lpa-label")} label={t("case:summary-lpa-label")}
value={
value={router.locale == "cy" <>
? jsonpath({ {getCaseLpaDisplayLines({
path: casesObj,
'$..[?(@ && @.value=="' + detailsObj,
casesObj[ locale: router.locale,
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" transLookup
] + }).map((name) => (
'")].value_cy', <div key={name}>{name}</div>
json: transLookup, ))}
eval: true, </>
}) }
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || ""}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-eia-required-label")} label={t("case:summary-eia-required-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
detailsObj[ detailsObj[
@@ -79,16 +71,13 @@ const Pinswg_wayleaveid = (props) => {
: detailsObj[ : detailsObj[
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue" "pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-to-be-confirmed-label")
"case:summary-to-be-confirmed-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-procedure-label")} label={t("case:summary-procedure-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -97,18 +86,17 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue" "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-type-of-event-label")} label={t("case:summary-type-of-event-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -117,18 +105,17 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] || ""} ] || ""
}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-status-label")} label={t("case:summary-status-label")}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.value=="' + '$..[?(@ && @.value=="' +
@@ -137,15 +124,13 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: casesObj[ : casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue" "statuscode@OData.Community.Display.V1.FormattedValue"
] || ] ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
@@ -161,7 +146,7 @@ const Pinswg_wayleaveid = (props) => {
] + ] +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: detailsObj[ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue" "pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -182,16 +167,11 @@ const Pinswg_wayleaveid = (props) => {
{casesObj.numberofchildincidents > 0 && ( {casesObj.numberofchildincidents > 0 && (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-case-link-status-label")}
"case:summary-case-link-status-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{_.has(casesObj, [ {_.has(casesObj, ["numberofchildincidents"])
"numberofchildincidents", ? casesObj.numberofchildincidents > 0
])
? casesObj.numberofchildincidents >
0
? t( ? t(
"case:summary-case-link-status-linked" "case:summary-case-link-status-linked"
) )
@@ -207,14 +187,11 @@ const Pinswg_wayleaveid = (props) => {
{casesObj.numberofchildincidents > 0 ? ( {casesObj.numberofchildincidents > 0 ? (
<div className="govuk-summary-list__row"> <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key"> <dt className="govuk-summary-list__key">
{t( {t("case:summary-linked-cases-label")}
"case:summary-linked-cases-label"
)}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{linkedCasesList( {linkedCasesList(
props.currentView props.currentView.linkedCaseReferences
.linkedCaseReferences
)} )}
</dd> </dd>
</div> </div>
@@ -222,19 +199,18 @@ const Pinswg_wayleaveid = (props) => {
"" ""
)} )}
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-case-relevant-authoritylabel" "case:summary-case-relevant-authoritylabel"
)} )}
value={
value={router.locale == "cy" router.locale == "cy"
? jsonpath({ ? jsonpath({
path: path:
'$..[?(@ && @.pinswg_lpa=="' + '$..[?(@ && @.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: jsonpath({ : jsonpath({
path: path:
@@ -242,12 +218,10 @@ const Pinswg_wayleaveid = (props) => {
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value', '")].value',
json: transLookup, json: transLookup,
eval: true, eval: true
}) || }) ||
t( t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -258,50 +232,34 @@ const Pinswg_wayleaveid = (props) => {
> >
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9"> <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
<SummaryRow <SummaryRow
label={t("case:summary-start-date-label")} label={t("case:summary-start-date-label")}
value={
value={_.has(detailsObj, "pinswg_startdate") _.has(detailsObj, "pinswg_startdate")
? !_.isEmpty( ? !_.isEmpty(detailsObj.pinswg_startdate)
detailsObj.pinswg_startdate
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdate detailsObj.pinswg_startdate
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: _.has( : _.has(detailsObj, "pinswg_startdates")
detailsObj, ? !_.isEmpty(detailsObj.pinswg_startdates)
"pinswg_startdates"
)
? !_.isEmpty(
detailsObj.pinswg_startdates
)
? formatDates( ? formatDates(
detailsObj.pinswg_startdates detailsObj.pinswg_startdates
) )
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-questionnaire-due-date-label" "case:summary-questionnaire-due-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_questionnaireduedate")
value={_.has(
detailsObj,
"pinswg_questionnaireduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_questionnaireduedate detailsObj.pinswg_questionnaireduedate
) )
@@ -311,25 +269,14 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-statement-due-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_statementduedate")
"case:summary-statement-due-date-label"
)}
value={_.has(
detailsObj,
"pinswg_statementduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_statementduedate detailsObj.pinswg_statementduedate
) )
@@ -339,22 +286,16 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-interested-party-date-label" "case:summary-interested-party-date-label"
)} )}
value={
_.has(
value={_.has(
detailsObj, detailsObj,
"pinswg_otherpartiesstatement" "pinswg_otherpartiesstatement"
) )
@@ -380,25 +321,16 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t( label={t(
"case:summary-applicant-final-comments-date-label" "case:summary-applicant-final-comments-date-label"
)} )}
value={
_.has(detailsObj, "pinswg_finalcommentsduedate")
value={_.has(
detailsObj,
"pinswg_finalcommentsduedate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_finalcommentsduedate detailsObj.pinswg_finalcommentsduedate
) )
@@ -408,11 +340,8 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
{/* <SummaryRow {/* <SummaryRow
label={t( label={t(
@@ -436,13 +365,9 @@ const Pinswg_wayleaveid = (props) => {
)} )}
/> */} /> */}
<SummaryRow <SummaryRow
label={t("case:summary-event-date-label")} label={t("case:summary-event-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_dateeventrequested")
detailsObj,
"pinswg_dateeventrequested"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_dateeventrequested detailsObj.pinswg_dateeventrequested
) )
@@ -452,24 +377,14 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-start-event-date-label")}
value={
label={t( _.has(detailsObj, "pinswg_startdateofevent")
"case:summary-start-event-date-label"
)}
value={_.has(
detailsObj,
"pinswg_startdateofevent"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_startdateofevent detailsObj.pinswg_startdateofevent
) )
@@ -479,20 +394,13 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
<SummaryRow <SummaryRow
label={t("case:summary-decision-date-label")} label={t("case:summary-decision-date-label")}
value={
value={_.has( _.has(detailsObj, "pinswg_casedecisiondate")
detailsObj,
"pinswg_casedecisiondate"
)
? !_.isEmpty( ? !_.isEmpty(
detailsObj.pinswg_casedecisiondate detailsObj.pinswg_casedecisiondate
) )
@@ -502,10 +410,8 @@ const Pinswg_wayleaveid = (props) => {
: t( : t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
) )
: t( : t("case:summary-no-date-entered-label")
"case:summary-no-date-entered-label" }
)}
/> />
</dl> </dl>
</SummaryCard> </SummaryCard>
@@ -0,0 +1,69 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
const translateLpaName = ({ name, locale, transLookup }) => {
if (!name) return "";
if (locale !== "cy") return name;
return (
jsonpath({
path: '$..[?(@ && @.value=="' + name + '")].value_cy',
json: transLookup,
eval: true
})?.[0] || name
);
};
export const getCaseLpaNames = ({
casesObj,
detailsObj,
locale,
transLookup
}) => {
if (!casesObj) return [];
const primaryLpaName =
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "";
const translatedPrimaryLpaName = translateLpaName({
name: primaryLpaName,
locale,
transLookup
});
const additionalLpaNames = (detailsObj.additionalLPAs || []).map((lpa) =>
translateLpaName({
name: lpa?.name || "",
locale,
transLookup
})
);
return [
...new Set(
[translatedPrimaryLpaName, ...additionalLpaNames].filter(Boolean)
)
];
};
export const getCaseLpaDisplayValue = ({
casesObj,
detailsObj,
locale,
transLookup
}) => {
return getCaseLpaNames({ casesObj, detailsObj, locale, transLookup }).join(
", "
);
};
export const getCaseLpaDisplayLines = ({
casesObj,
locale,
detailsObj,
transLookup
}) => {
return getCaseLpaNames({ casesObj, detailsObj, locale, transLookup });
};
+37 -32
View File
@@ -32,8 +32,8 @@
import { azureHeaders } from "../../../actions/core/headers"; import { azureHeaders } from "../../../actions/core/headers";
import { getSelectQuery } from "../../../actions/selectQueryTypes"; import { getSelectQuery } from "../../../actions/selectQueryTypes";
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils"; import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
import { respondError } from "../middleware/apiResponse"; import { respondError, respondSuccess } from "../middleware/apiResponse";
import { relayGet } from "../middleware/relayForwarding"; import { relayGetData } from "../middleware/relayForwarding";
export default async function ApiProxy(req, res) { export default async function ApiProxy(req, res) {
const appealTypeName = req.query.appealTypeName; const appealTypeName = req.query.appealTypeName;
@@ -88,45 +88,50 @@ export default async function ApiProxy(req, res) {
navigationProperty + navigationProperty +
"($select=ticketnumber)"; "($select=ticketnumber)";
//" and statuscode eq 1&$count=true";
// queryUrl =
// queryUrl +
// getSelectQuery(appealTypeName) +
// ",_" +
// (primaryIdAttribute == "pinswg_sipscase"
// ? "pinswg_sipscase_value"
// : primaryIdAttribute + "s_value");
queryUrl = queryUrl + getSelectQuery(appealTypeName); queryUrl = queryUrl + getSelectQuery(appealTypeName);
// console.log( const incidentQueryUrl =
// "\n==========================================\n", "incidents(" +
// "\nSearch Details query ", incidentID +
// "\nAppealType: " + appealTypeName, ")?$select=title,ticketnumber" +
// "\nIncident ID: " + incidentID, "&$expand=pinswg_Incident_Account_AdditionalLPAs($select=name,accountnumber)" +
// "\n\nQuery url: " + queryUrl, "&$count=true";
// "\n==========================================\n"
// );
return relayGet({ try {
const [searchResult, incidentResult] = await Promise.all([
relayGetData({
queryUrl, queryUrl,
res, requestOptionsBuilder: (accessToken) =>
requestOptionsBuilder: (accessToken) => azureHeaders(accessToken), azureHeaders(accessToken)
transformData: (data) => { }),
let flattened = data.value.map((r) => ({ relayGetData({
queryUrl: incidentQueryUrl,
requestOptionsBuilder: (accessToken) =>
azureHeaders(accessToken)
})
]);
const data = searchResult.data;
const incidentData = incidentResult.data;
const additionalLPAs =
incidentData?.pinswg_Incident_Account_AdditionalLPAs || [];
data.value = (data.value || []).map((r) => ({
...r, ...r,
ticketnumber: r[navigationProperty]?.ticketnumber || null ticketnumber:
r[navigationProperty]?.ticketnumber ||
incidentData?.ticketnumber ||
null,
incidenttitle: incidentData?.title || null,
additionalLPAs
})); }));
data.value = flattened; return respondSuccess(res, data);
} catch (error) {
return data; return respondError(res, {
},
errorResponse: {
status: 400, status: 400,
code: "BASIC_SEARCH_DETAILS_FETCH_FAILED", code: "BASIC_SEARCH_DETAILS_FETCH_FAILED",
message: "Failed to fetch basic search details" message: "Failed to fetch basic search details"
}
}); });
}
} }
@@ -30,11 +30,11 @@
*/ */
import _ from "lodash"; import _ from "lodash";
import { azureHeadersPaged } from "../../../actions/core/headers"; import { azureHeaders, azureHeadersPaged } from "../../../actions/core/headers";
import { getSelectQuery } from "../../../actions/selectQueryTypes"; import { getSelectQuery } from "../../../actions/selectQueryTypes";
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils"; import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
import { respondError } from "../middleware/apiResponse"; import { respondError, respondSuccess } from "../middleware/apiResponse";
import { relayGet } from "../middleware/relayForwarding"; import { relayGetData } from "../middleware/relayForwarding";
export default async function ApiProxy(req, res) { export default async function ApiProxy(req, res) {
const appealTypeName = req.query.appealTypeName; const appealTypeName = req.query.appealTypeName;
@@ -76,13 +76,6 @@ export default async function ApiProxy(req, res) {
primaryIdAttribute primaryIdAttribute
).NavigationProperty; ).NavigationProperty;
// "?$filter=_" +
// (primaryIdAttribute == "pinswg_sipscase"
// ? "pinswg_sipscase_value"
// : primaryIdAttribute + "s_value ") +
// " eq " +
// incidentID +
let queryUrl = let queryUrl =
appealTypeName + appealTypeName +
"?$filter=" + "?$filter=" +
@@ -92,8 +85,6 @@ export default async function ApiProxy(req, res) {
navigationProperty + navigationProperty +
"($select=ticketnumber)"; "($select=ticketnumber)";
//" and statuscode eq 1&$count=true";
queryUrl = queryUrl =
queryUrl + queryUrl +
getSelectQuery(appealTypeName) + getSelectQuery(appealTypeName) +
@@ -102,29 +93,53 @@ export default async function ApiProxy(req, res) {
? "pinswg_sipscase_value" ? "pinswg_sipscase_value"
: primaryIdAttribute + "s_value"); : primaryIdAttribute + "s_value");
return relayGet({ const incidentQueryUrl =
queryUrl, "incidents(" +
res, req.query.incidentID +
requestOptionsBuilder: (accessToken) => azureHeadersPaged(accessToken), ")?$select=title,ticketnumber" +
transformData: (data) => { "&$expand=pinswg_Incident_Account_AdditionalLPAs($select=name,accountnumber)" +
let flattened = data.value.map((r) => ({ "&$count=true";
...r,
ticketnumber: r[navigationProperty]?.ticketnumber || null
}));
data.value = flattened; try {
const [searchResult, incidentResult] = await Promise.all([
relayGetData({
queryUrl,
requestOptionsBuilder: (accessToken) =>
azureHeadersPaged(accessToken)
}),
relayGetData({
queryUrl: incidentQueryUrl,
requestOptionsBuilder: (accessToken) =>
azureHeaders(accessToken)
})
]);
const data = searchResult.data;
const incidentData = incidentResult.data;
const additionalLPAs =
incidentData?.pinswg_Incident_Account_AdditionalLPAs || [];
data.value = (data.value || []).map((r) => ({
...r,
ticketnumber:
r[navigationProperty]?.ticketnumber ||
incidentData?.ticketnumber ||
null,
incidenttitle: incidentData?.title || null,
additionalLPAs
}));
if (_.has(data, "@odata.nextLink") === true) { if (_.has(data, "@odata.nextLink") === true) {
const dataStr = JSON.stringify(data["@odata.nextLink"]); const dataStr = JSON.stringify(data["@odata.nextLink"]);
data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]; data["@odata.nextLink"] = dataStr.split("/v8.2/")[1];
} }
return data; return respondSuccess(res, data);
}, } catch (error) {
errorResponse: { return respondError(res, {
status: 400, status: 400,
code: "BASIC_SEARCH_DETAILS_PAGED_FETCH_FAILED", code: "BASIC_SEARCH_DETAILS_PAGED_FETCH_FAILED",
message: "Failed to fetch paged basic search details" message: "Failed to fetch paged basic search details"
}
}); });
}
} }