diff --git a/actions/selectQueryTypes.js b/actions/selectQueryTypes.js index fdab35f5..772eec07 100644 --- a/actions/selectQueryTypes.js +++ b/actions/selectQueryTypes.js @@ -82,7 +82,7 @@ export const getSelectQuery = (appealTypeName) => { return "&$select=pinswg_eiarequired,pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdate,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,pinswg_startdateofevent,pinswg_typeofevent"; case "pinswg_sipses": // return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage,_pinswg_dnsids_value,pinswg_startdateofevent,pinswg_typeofevent"; - return "&$select=_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate"; + return "&$select=_pinswg_projecttype_value,pinswg_eiarequired,pinswg_anticipatedgridrefeasting,pinswg_anticipatedgridrefnorthing,_pinswg_appellant_value,pinswg_name,_pinswg_associatedlpa_value,pinswg_choiceofprocedure,pinswg_decision,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,statuscode,pinswg_casestage,_pinswg_sipscase_value,pinswg_writtenacceptanceofnotification,pinswg_validnoticeofintentiontosubmit,pinswg_deadlineforsubmissionofapplication,pinswg_screeningstartdate,pinswg_eiatargetdate,pinswg_targetextended,pinswg_directionissueddate,pinswg_eiarequired,pinswg_scopingstartdate,pinswg_scopingtargetdate,pinswg_scopingtargetextended,pinswg_scopingoutcomeissueddate,pinswg_essubmitted,pinswg_deemedmarinelicenseappliedfor,pinswg_validationdeadlineextension,pinswg_casesuspensionstartdate,pinswg_casesuspensionenddate"; break; default: return ""; diff --git a/components/case/eia.js b/components/case/eia.js new file mode 100644 index 00000000..d5f64827 --- /dev/null +++ b/components/case/eia.js @@ -0,0 +1,221 @@ +import { setEventDetails } from "../../store/searchOutput/action"; +import { setCurrentPage } from "../../store/currentView/action"; +import { connect } from "react-redux"; +import useTranslation from "next-translate/useTranslation"; +import { formatDates } from "../utils"; + +const EIADetails = (props) => { + let { t } = useTranslation(); + + const EventView = (eventsArr) => { + eventsArr = eventsArr.value; + + return eventsArr.map((item, key) => { +
{item.pinswg_name}
; + }); + }; + + const eventsArr = props.eventsObj?.value || []; + + // event publishiing flag set to true displa + + function hasOwnPropertyAndNotNull(obj, property) { + return obj.hasOwnProperty(property) && obj[property] !== null; + } + + //console.log(eventsArr.length > 0); + + return ( + eventsArr.length > 0 && ( +
+
+
+

+ {t("case:event-title")} +

+ {eventsArr.map( + (item, key) => + item.pinswg_eventpublishflag && ( + <> + {" "} +
+
+
+ + {" "} + {t( + "case:event-name-label" + )} + + : {item.pinswg_name} +
+ {hasOwnPropertyAndNotNull( + item, + "pinswg_eventname" + ) && ( +
+ + {t( + "case:event-event-name-label" + )} + + :{" "} + {item.pinswg_eventname} +
+ )} +
+
+ {hasOwnPropertyAndNotNull( + item, + "pinswg_eventaddressline1" + ) && ( + <> +
+ + {t( + "case:event-address-label" + )} + + : +
+
+ { + item.pinswg_eventaddressline1 + } +
+ + )} + + {hasOwnPropertyAndNotNull( + item, + "pinswg_eventaddressline2" + ) && ( +
+ { + item.pinswg_eventaddressline2 + } +
+ )} + {hasOwnPropertyAndNotNull( + item, + "pinswg_eventaddresstown" + ) && ( +
+ { + item.pinswg_eventaddresstown + } +
+ )} + {hasOwnPropertyAndNotNull( + item, + "pinswg_eventaddresscounty" + ) && ( +
+ { + item.pinswg_eventaddresscounty + } +
+ )} + {hasOwnPropertyAndNotNull( + item, + "pinswg_eventaddresscounty" + ) && ( +
+ { + item.pinswg_eventaddresspostcode + } +
+ )} +
+ {/* type of event + start date date of event - end date of event + + if virtual event no address showNoOfRecords + show event address */} +
+ {hasOwnPropertyAndNotNull( + item, + "pinswg_dateeventrequested" + ) && ( +
+ + {t( + "case:event-start-date-label" + )} + + :{" "} + {formatDates( + item.pinswg_dateeventrequested + )} +
+ )} + {hasOwnPropertyAndNotNull( + item, + "pinswg_enddateoftheevent" + ) && ( +
+ + {t( + "case:event-end-date-label" + )} + + :{" "} + {item.pinswg_enddateoftheevent != + null && + formatDates( + item.pinswg_enddateoftheevent + )} +
+ )} +
+
+ {hasOwnPropertyAndNotNull( + item, + [ + "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue", + ] + ) && ( +
+ + {t( + "case:event-type-of-event-label" + )} + + :{" "} + { + item[ + "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" + ] + } +
+ )} +
+
+ + ) + )}{" "} +
+
+
+ ) + ); +}; + +const mapStateToProps = (state) => { + return { + ...state, + }; +}; + +const mapDispatchToProps = (dispatch) => { + return { + setEventDetails: (eventsObj) => { + dispatch(setEventDetails(eventsObj)); + }, + setCurrentPage: (currentPage) => { + dispatch(setCurrentPage(currentPage)); + }, + }; +}; + +export default connect(mapStateToProps, mapDispatchToProps)(EIADetails); diff --git a/components/case/summary.js b/components/case/summary.js index 0959a14f..80002673 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -60,6 +60,7 @@ import Pinswg_transportandworkactid from "./summaryTypes/pinswg_transportandwork import Pinswg_wayleaveid from "./summaryTypes/pinswg_wayleaveid"; import CaseNoticeBanner from "./caseNoticeBanner"; import WatchModal from "./watchmodal"; +import EIADetails from "./eia"; import GoogleMapComponent from "../mapping"; import OSPoint from "ospoint"; @@ -357,6 +358,26 @@ const CaseSummary = (props) => { )} + + {getFormCollectionByID(appealTypeID) + .PrimaryIdAttribute == "pinswg_sipscase" && ( +
  • + setWhichTab("case-eia")} + > + {" "} + EIA + +
  • + )} {isObjectNotEmpty(props, "eventsObj") && (
  • { )} + +
    +
    +
    +
    +
    +
    +

    + EIA Screening +

    + +
    +
    +
    + Screening start date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_screeningstartdate" + ) + ? !_.isEmpty( + detailsObj.pinswg_screeningstartdate + ) + ? formatDates( + detailsObj.pinswg_screeningstartdate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    +
    +
    + EIA target date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_eiatargetdate" + ) + ? !_.isEmpty( + detailsObj.pinswg_eiatargetdate + ) + ? formatDates( + detailsObj.pinswg_eiatargetdate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + + {hasValidKey( + detailsObj, + "pinswg_targetextended" + ) && ( +
    +
    + Target Extended +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_targetextended" + ) + ? !_.isEmpty( + detailsObj.pinswg_targetextended + ) + ? formatDates( + detailsObj.pinswg_targetextended + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + )} +
    +
    + Direction Issued + Date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_directionissueddate" + ) + ? !_.isEmpty( + detailsObj.pinswg_directionissueddate + ) + ? formatDates( + detailsObj.pinswg_directionissueddate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + + {hasValidKey( + detailsObj, + "pinswg_eiarequired" + ) && ( +
    +
    + {t( + "case:summary-eia-required-label" + )} +
    +
    + {_.has( + detailsObj, + "pinswg_eiarequired" + ) + ? detailsObj.pinswg_eiarequired + ? router.locale == + "cy" + ? "Ie" + : "Yes" + : router.locale == + "cy" + ? "Na" + : "No" + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + )} +
    +
    +
    +
    +
    +
    +
    +

    + EIA Scoping +

    + +
    +
    +
    + Scoping Start Date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_scopingstartdate" + ) + ? !_.isEmpty( + detailsObj.pinswg_scopingstartdate + ) + ? formatDates( + detailsObj.pinswg_scopingstartdate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    +
    +
    + Scoping Target Date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_scopingtargetdate" + ) + ? !_.isEmpty( + detailsObj.pinswg_scopingtargetdate + ) + ? formatDates( + detailsObj.pinswg_scopingtargetdate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + {hasValidKey( + detailsObj, + "pinswg_scopingtargetextended" + ) && ( +
    +
    + Scoping Target + Extended +
    +
    + {_.has( + detailsObj, + "pinswg_scopingtargetextended" + ) + ? !_.isEmpty( + detailsObj.pinswg_scopingtargetextended + ) + ? formatDates( + detailsObj.pinswg_scopingtargetextended + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + )} +
    +
    + Scoping Outcome + Issued Date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_scopingoutcomeissueddate" + ) + ? !_.isEmpty( + detailsObj.pinswg_scopingoutcomeissueddate + ) + ? formatDates( + detailsObj.pinswg_scopingoutcomeissueddate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    +
    +
    +
    +
    +
    +
    +
    + {getFormCollectionByID(appealTypeID) + .PrimaryIdAttribute == "pinswg_sipscase" && ( + + )} {isObjectNotEmpty(props, "eventsObj") && (
    { )}
    +
    +
    + ES Submitted +
    +
    + {router.locale == "cy" + ? jsonpath( + '$..[?(@.value=="' + + detailsObj[ + "pinswg_essubmitted@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy', + transLookup + ) + : detailsObj[ + "pinswg_essubmitted@OData.Community.Display.V1.FormattedValue" + ] || + t( + "case:summary-to-be-confirmed-label" + )} +
    +
    +
    +
    + Deemed Marine License Applied for +
    +
    + {router.locale == "cy" + ? jsonpath( + '$..[?(@.value=="' + + detailsObj[ + "pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue" + ] + + '")].value_cy', + transLookup + ) + : detailsObj[ + "pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue" + ] || + t( + "case:summary-to-be-confirmed-label" + )} +
    +
    {/*
    @@ -536,7 +580,114 @@ const Pinswg_sipscase = (props) => {
    -
    + {(hasValidKey( + detailsObj, + "pinswg_validationdeadlineextension" + ) || + hasValidKey( + detailsObj, + "pinswg_casesuspensionstartdate" + ) || + hasValidKey( + detailsObj, + "pinswg_casesuspensionenddate" + )) && ( +
    +

    + Submission +

    + +
    + {hasValidKey( + detailsObj, + "pinswg_validationdeadlineextension" + ) && ( +
    +
    + Validation - Deadline + extension +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_validationdeadlineextension" + ) + ? !_.isEmpty( + detailsObj.pinswg_validationdeadlineextension + ) + ? formatDates( + detailsObj.pinswg_validationdeadlineextension + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + )} + {hasValidKey( + detailsObj, + "pinswg_casesuspensionstartdate" + ) && ( +
    +
    + Case Suspension Start + Date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_casesuspensionstartdate" + ) + ? !_.isEmpty( + detailsObj.pinswg_casesuspensionstartdate + ) + ? formatDates( + detailsObj.pinswg_casesuspensionstartdate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + )} + {hasValidKey( + detailsObj, + "pinswg_casesuspensionenddate" + ) && ( +
    +
    + Case Suspension End Date +
    {" "} +
    + {_.has( + detailsObj, + "pinswg_casesuspensionenddate" + ) + ? !_.isEmpty( + detailsObj.pinswg_casesuspensionenddate + ) + ? formatDates( + detailsObj.pinswg_casesuspensionenddate + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
    +
    + )} +
    +
    + )} + {/*

    EIA Screening

    @@ -672,8 +823,8 @@ const Pinswg_sipscase = (props) => {
    )} -
    -
    +
    */} + {/*

    EIA Scoping

    @@ -777,7 +928,7 @@ const Pinswg_sipscase = (props) => {
    - + */} {/*