diff --git a/actions/selectQueryTypes.js b/actions/selectQueryTypes.js index 6b0edf3c..772eec07 100644 --- a/actions/selectQueryTypes.js +++ b/actions/selectQueryTypes.js @@ -34,7 +34,7 @@ export const getSelectQuery = (appealTypeName) => { return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_startdateofevent,pinswg_typeofevent"; break; case "pinswg_harbourrevisionorders": - return "&$select=pinswg_eiascreeningrequested,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_projectdiscription,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"; + 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_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdiscription,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"; break; case "pinswg_householderappealhases": return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstmt,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode"; @@ -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 1d8c5243..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") && (
  • { )} + + {casesObj.pinswg_environmentalstatementlocation != + null && ( +
    +
    + {t( + "case:summary-environmental-statement-label" + )} +
    +
    + { + casesObj.pinswg_environmentalstatementlocation + } +
    +
    + )} +
    {t( @@ -1206,6 +1244,277 @@ const CaseSummary = (props) => {
    )} + +
    +
    +
    +
    +
    +
    +

    + 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") && (
    { ? jsonpath( '$..[?(@.value=="' + detailsObj[ - "pinswg_eiascreeningrequested@OData.Community.Display.V1.FormattedValue" + "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', transLookup ) : detailsObj[ - "pinswg_eiascreeningrequested@OData.Community.Display.V1.FormattedValue" + "pinswg_eiarequired@OData.Community.Display.V1.FormattedValue" ] || t( "case:summary-to-be-confirmed-label" diff --git a/components/case/summaryTypes/pinswg_sipscase.js b/components/case/summaryTypes/pinswg_sipscase.js index 0dc78ba5..2b616e39 100644 --- a/components/case/summaryTypes/pinswg_sipscase.js +++ b/components/case/summaryTypes/pinswg_sipscase.js @@ -221,6 +221,50 @@ const Pinswg_sipscase = (props) => { )}
    +
    +
    + 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) => {
    - + */} {/*
    diff --git a/locales/cy/case.json b/locales/cy/case.json index b399bb57..b9b4a013 100644 --- a/locales/cy/case.json +++ b/locales/cy/case.json @@ -14,6 +14,7 @@ "summary-site-address-label": "Cyfeiriad y Safle", "summary-description-label": "Disgrifiad", "summary-case-stage-label": "Cam yr Achos", + "summary-environmental-statement-label": "Lleoliad Datganiad Amgylcheddol", "summary-last-modified-label": "Addaswyd ddiwethaf", "summary-make-representation-label": "Cyflwyno sylwadau", "summary-representation-open-label": "Cynrychioliadau yn agor", diff --git a/locales/en/case.json b/locales/en/case.json index 716be3f2..0097725e 100644 --- a/locales/en/case.json +++ b/locales/en/case.json @@ -14,6 +14,7 @@ "summary-site-address-label": "Site Address", "summary-description-label": "Description", "summary-case-stage-label": "Case Stage", + "summary-environmental-statement-label": "Environmental Statement Location", "summary-last-modified-label": "Last modified", "summary-make-representation-label": "Make representation", "summary-representation-open-label": "Representations open", diff --git a/pages/api/endpoint/getadvancedsearch_api.js b/pages/api/endpoint/getadvancedsearch_api.js index 0833f72b..d483e408 100644 --- a/pages/api/endpoint/getadvancedsearch_api.js +++ b/pages/api/endpoint/getadvancedsearch_api.js @@ -82,7 +82,7 @@ export default async function ApiProxy(req, res) { //console.log(queryString); var queryUrl = - "incidents?$select=pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=" + + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=" + queryString + " pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getadvancedsearchpaged_api.js b/pages/api/endpoint/getadvancedsearchpaged_api.js index 9767a6e8..9db7bcb3 100644 --- a/pages/api/endpoint/getadvancedsearchpaged_api.js +++ b/pages/api/endpoint/getadvancedsearchpaged_api.js @@ -117,7 +117,7 @@ export default async function ApiProxy(req, res) { : ""; var queryUrl = - "incidents?$select=pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=" + + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=" + queryString + " pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=" + orderby + @@ -273,7 +273,7 @@ export default async function ApiProxy(req, res) { // : ""; // var queryUrl = -// "incidents?$select=pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=" + +// "incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=" + // queryString + // " pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=" + // orderby + diff --git a/pages/api/endpoint/getawaitingsubmission_api.js b/pages/api/endpoint/getawaitingsubmission_api.js index 3f3ccce3..8d90d318 100644 --- a/pages/api/endpoint/getawaitingsubmission_api.js +++ b/pages/api/endpoint/getawaitingsubmission_api.js @@ -41,7 +41,7 @@ export default async function ApiProxy(req, res) { var token = await getToken(); var queryUrl = - "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " + + "incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " + loggedInUserId + " and servicestage eq 1 and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getawaitingsubmissionproxy_api.js b/pages/api/endpoint/getawaitingsubmissionproxy_api.js index 49281eb2..4d706378 100644 --- a/pages/api/endpoint/getawaitingsubmissionproxy_api.js +++ b/pages/api/endpoint/getawaitingsubmissionproxy_api.js @@ -34,7 +34,7 @@ export default async function ApiProxy(req, res) { var token = await getToken(); var queryUrl = - "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " + + "incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " + loggedInUserId + " and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getbasicdnssearch_api.js b/pages/api/endpoint/getbasicdnssearch_api.js index f77ddb1d..4ac00f1c 100644 --- a/pages/api/endpoint/getbasicdnssearch_api.js +++ b/pages/api/endpoint/getbasicdnssearch_api.js @@ -43,7 +43,7 @@ export default async function ApiProxy(req, res) { var token = await getToken(); var queryUrl = - "incidents?$select=pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002)and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true"; + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002)and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true"; console.log(queryUrl); diff --git a/pages/api/endpoint/getbasicdnssearchpaged_api.js b/pages/api/endpoint/getbasicdnssearchpaged_api.js index b2aacafa..8fb39537 100644 --- a/pages/api/endpoint/getbasicdnssearchpaged_api.js +++ b/pages/api/endpoint/getbasicdnssearchpaged_api.js @@ -78,7 +78,7 @@ export default async function ApiProxy(req, res) { var showNumberOfRecords = req.query.showNumberOfRecords; var queryUrl = - "incidents?$select=pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=" + + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=" + orderby + " " + fieldSort + diff --git a/pages/api/endpoint/getbasicdnsurlsearch_api.js b/pages/api/endpoint/getbasicdnsurlsearch_api.js index 083a97ce..22c0f48b 100644 --- a/pages/api/endpoint/getbasicdnsurlsearch_api.js +++ b/pages/api/endpoint/getbasicdnsurlsearch_api.js @@ -46,7 +46,7 @@ export default async function ApiProxy(req, res) { searchString = searchString.replace(/\'/g, "''"); var queryUrl = - "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + + "incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + searchString + "') or contains(ticketnumber, '" + searchString + diff --git a/pages/api/endpoint/getbasicsearch_api.js b/pages/api/endpoint/getbasicsearch_api.js index b9a6dc97..a8b7c73c 100644 --- a/pages/api/endpoint/getbasicsearch_api.js +++ b/pages/api/endpoint/getbasicsearch_api.js @@ -45,7 +45,7 @@ export default async function ApiProxy(req, res) { searchString = searchString.replace(/\'/g, "''"); var queryUrl = - "incidents?$select=pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + searchString + "') or contains(ticketnumber, '" + searchString + diff --git a/pages/api/endpoint/getbasicsearch_by_address_api.js b/pages/api/endpoint/getbasicsearch_by_address_api.js index 6bca6b8f..72101e2f 100644 --- a/pages/api/endpoint/getbasicsearch_by_address_api.js +++ b/pages/api/endpoint/getbasicsearch_by_address_api.js @@ -635,7 +635,7 @@ export default async function ApiProxy(req, res) { searchResultsObj.map(async (key) => { console.log(key); var queryUrl = - "incidents?$select=ticketnumber,pinswg_publishtoweb,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=incidentid eq " + + "incidents?$select=pinswg_environmentalstatementlocation,ticketnumber,pinswg_publishtoweb,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=incidentid eq " + key.incidentid + " and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getbasicsearchpaged_api.js b/pages/api/endpoint/getbasicsearchpaged_api.js index d4c544e3..7eadff3e 100644 --- a/pages/api/endpoint/getbasicsearchpaged_api.js +++ b/pages/api/endpoint/getbasicsearchpaged_api.js @@ -79,7 +79,7 @@ export default async function ApiProxy(req, res) { searchString = searchString.replace(/\'/g, "''"); var queryUrl = - "incidents?$select=pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_caseaddress,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + searchString + "') or contains(ticketnumber, '" + searchString + diff --git a/pages/api/endpoint/getdnslist_api.js b/pages/api/endpoint/getdnslist_api.js index 66872103..3e4e7e84 100644 --- a/pages/api/endpoint/getdnslist_api.js +++ b/pages/api/endpoint/getdnslist_api.js @@ -25,7 +25,7 @@ export default async function ApiProxy(req, res) { var token = await getToken(); var queryUrl = - "incidents?$select=pinswg_appealcasetype,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,statuscode,ticketnumber,title &$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true"; + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_appealcasetype,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,statuscode,ticketnumber,title &$filter=(pinswg_appealcasetype eq 846040011 or pinswg_appealcasetype eq 846040002) and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true"; console.log(queryUrl); diff --git a/pages/api/endpoint/getincidentbyid_api.js b/pages/api/endpoint/getincidentbyid_api.js index 2f2f7d7d..a8160ba4 100644 --- a/pages/api/endpoint/getincidentbyid_api.js +++ b/pages/api/endpoint/getincidentbyid_api.js @@ -45,7 +45,7 @@ export default async function ApiProxy(req, res) { searchString = searchString.replace(/\'/g, "''"); var queryUrl = - "incidents?$select=pinswg_publishtoweb,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=incidentid eq " + + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_publishtoweb,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=incidentid eq " + searchString + " and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getispublishedbyid_api.js b/pages/api/endpoint/getispublishedbyid_api.js index d061583f..58432d03 100644 --- a/pages/api/endpoint/getispublishedbyid_api.js +++ b/pages/api/endpoint/getispublishedbyid_api.js @@ -44,7 +44,7 @@ export default async function ApiProxy(req, res) { searchString = searchString.replace(/\'/g, "''"); var queryUrl = - "incidents?$select=pinswg_publishtoweb,ticketnumber,title, _primarycontactid_value&$filter=incidentid eq " + + "incidents?$select=pinswg_environmentalstatementlocation,pinswg_publishtoweb,ticketnumber,title, _primarycontactid_value&$filter=incidentid eq " + searchString + " and pinswg_appealcasetype ne null &$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getmycases_api.js b/pages/api/endpoint/getmycases_api.js index 88033be2..11870581 100644 --- a/pages/api/endpoint/getmycases_api.js +++ b/pages/api/endpoint/getmycases_api.js @@ -41,7 +41,7 @@ export default async function ApiProxy(req, res) { var token = await getToken(); var queryUrl = - "incidents?$select=modifiedon,pinswg_publishtoweb,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " + + "incidents?$select=pinswg_environmentalstatementlocation,modifiedon,pinswg_publishtoweb,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " + loggedInUserId + " and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getmylpacases_api.js b/pages/api/endpoint/getmylpacases_api.js index ce7cbe79..5652e639 100644 --- a/pages/api/endpoint/getmylpacases_api.js +++ b/pages/api/endpoint/getmylpacases_api.js @@ -59,7 +59,7 @@ export default async function ApiProxy(req, res) { // ); var queryUrl = - "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_pinswg_associatedlpa_value eq " + + "incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_pinswg_associatedlpa_value eq " + lpaGUID[0].accountid + " and servicestage eq 0 and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getpartsavedappeal_api.js b/pages/api/endpoint/getpartsavedappeal_api.js index 1da8e3ee..d7e9edb0 100644 --- a/pages/api/endpoint/getpartsavedappeal_api.js +++ b/pages/api/endpoint/getpartsavedappeal_api.js @@ -28,7 +28,7 @@ export default async function ApiProxy(req, res) { searchString = searchString.replace(/\'/g, "''"); var queryUrl = - "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + + "incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" + searchString + "') or contains(ticketnumber, '" + searchString +