From 19be69389e5b9dec9464b8fb557523dfcc2db233 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 26 Apr 2022 16:08:23 +0100 Subject: [PATCH] apostrophe fix and dns details ordering --- .env.local | 34 +- actions/selectQueryTypes.js | 2 +- components/case.js | 1 + components/case/summary.js | 2 + components/case/summaryTypes/pinswg_dnsid.js | 575 ++++++++++--------- components/dnssearchresults.js | 4 +- components/myportal/viewall.js | 2 +- components/search/dnssearchresults.js | 72 +-- components/search/searchresults.js | 4 +- locales/cy/case.json | 3 + locales/en/case.json | 3 + pages/api/endpoint/getappealtypes_api.js | 3 +- pages/dnsapplications.js | 8 +- pages/dnsdetails.js | 3 +- pages/index.js | 4 + 15 files changed, 381 insertions(+), 339 deletions(-) diff --git a/.env.local b/.env.local index 7c6dfc02..627bb41d 100644 --- a/.env.local +++ b/.env.local @@ -4,7 +4,7 @@ ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/ //ESNR Tenant TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502 //WGO Tenant -//TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5 +TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5 GRANT_TYPE = "client_credentials" HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c @@ -12,27 +12,27 @@ NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459 //Dev oauth ESNR -CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015 -CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY -RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/ -RELAYURI = "dev-pedw-ns.servicebus.windows.net" -RELAYPATH = "dev-pedw-hc" +//CLIENT_ID = e082def0-3453-461f-9a5e-f4ab127dc015 +//CLIENT_SECRET = qW.7Q~TSr3sZmLEnJQJPXEdOckb_yo2t1yJmY +//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/ +//RELAYURI = "dev-pedw-ns.servicebus.windows.net" +//RELAYPATH = "dev-pedw-hc" //Test Oauth ESNR -//CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa -//CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj- -//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/ -//RELAYURI = "test-pedw-ns.servicebus.windows.net" -//RELAYPATH = "test-pedw-hc" +CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa +CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj- +RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/ +RELAYURI = "test-pedw-ns.servicebus.windows.net" +RELAYPATH = "test-pedw-hc" //Preprod Oauth WGO -//CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a -//CLIENT_SECRET = Ioo7Q~RJfhWsE45wPsuHm1CzRk1SppnNN3lZF -//RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/ -//RELAYURI = "pp-pedw-ns.servicebus.windows.net" -//RELAYPATH = "pp-pedw-hc" +CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a +CLIENT_SECRET = Ioo7Q~RJfhWsE45wPsuHm1CzRk1SppnNN3lZF +RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/ +RELAYURI = "pp-pedw-ns.servicebus.windows.net" +RELAYPATH = "pp-pedw-hc" @@ -48,7 +48,7 @@ GOOGLE_TAG_MANAGER = GTM-T78CBC3 SHOWLOGIN = "true" SHOWREPRESENTATIONS = false SHOWFILEUPLOAD = "false" -SHOWMAPS = "true" +SHOWMAPS = "false" //BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2 diff --git a/actions/selectQueryTypes.js b/actions/selectQueryTypes.js index bd5d87bd..edf9ae11 100644 --- a/actions/selectQueryTypes.js +++ b/actions/selectQueryTypes.js @@ -19,7 +19,7 @@ export const getSelectQuery = (appealTypeName) => { case "pinswg_compulsorypurchaseorderses": return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode"; case "pinswg_dnses": - 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"; + 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"; case "pinswg_electricityacts": return "&$select=_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"; case "pinswg_householderappealhases": diff --git a/components/case.js b/components/case.js index f6c2ab0a..09b602c3 100644 --- a/components/case.js +++ b/components/case.js @@ -35,6 +35,7 @@ const Case = (props) => { searchDetailsObj={props.searchDetailsObj} searchString={props.searchString} incidentid={props.incidentid} + showMap={props.showMap} /> { setCurrentLinkedCases, linkedCasesReference, setCurrentReference, + showMap, } = props; const noRepresentationLink = [ @@ -414,6 +415,7 @@ const CaseSummary = (props) => { formatDates={formatDates} linkedCasesList={linkedCasesList} currentView={props.currentView} + showMap={showMap} /> ); break; diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js index 530f418b..d5a31851 100644 --- a/components/case/summaryTypes/pinswg_dnsid.js +++ b/components/case/summaryTypes/pinswg_dnsid.js @@ -13,7 +13,8 @@ import OSPoint from "ospoint"; const Pinswg_dnsid = (props) => { let { t } = useTranslation(); - const { casesObj, detailsObj, formatDates, linkedCasesList } = props; + const { casesObj, detailsObj, formatDates, linkedCasesList, showMap } = + props; const router = useRouter(); const { locale } = router; @@ -44,7 +45,13 @@ const Pinswg_dnsid = (props) => { {detailsObj.pinswg_projectdescription != null ? (
-
+

{t("case:summary-project-details-label")}

@@ -80,22 +87,22 @@ const Pinswg_dnsid = (props) => { : ""}

*/}
- {/* {process.env.SHOWMAPS == "true" && ( */} -
-
- - {/* */} + {showMap == "true" && ( +
+
+ + {/* */} +
-
- {/* )} */} + )}
) : ( @@ -153,23 +160,6 @@ const Pinswg_dnsid = (props) => { ] || ""}
-
-
- {t( - "case:summary-case-officer-label" - )} -
-
- {" "} - {/* {casesObj.caseDetails.caseOfficer || - ""} */} - {_.has(casesObj, "_ownerid_value") - ? casesObj[ - "_ownerid_value@OData.Community.Display.V1.FormattedValue" - ] - : ""} -
-
{t("case:summary-procedure-label")} @@ -186,7 +176,10 @@ const Pinswg_dnsid = (props) => { ) : detailsObj[ "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" - ] || ""} + ] || + t( + "case:summary-to-be-confirmed-label" + )}
@@ -207,7 +200,47 @@ const Pinswg_dnsid = (props) => { "statuscode@OData.Community.Display.V1.FormattedValue" ] || t( - "case:summary-no-date-entered-label" + "case:summary-to-be-confirmed-label" + )} + +
+
+
+ {t( + "case:summary-case-officer-label" + )} +
+
+ {" "} + {/* {casesObj.caseDetails.caseOfficer || + ""} */} + {_.has(casesObj, "_ownerid_value") + ? casesObj[ + "_ownerid_value@OData.Community.Display.V1.FormattedValue" + ] + : ""} +
+
+
+
+ {t("case:summary-event-date-label")} +
+
+ {_.has( + detailsObj, + "pinswg_dateeventrequested" + ) + ? !_.isEmpty( + detailsObj.pinswg_dateeventrequested + ) + ? formatDates( + detailsObj.pinswg_dateeventrequested + ) + : t( + "case:summary-to-be-confirmed-label" + ) + : t( + "case:summary-to-be-confirmed-label" )}
@@ -229,7 +262,7 @@ const Pinswg_dnsid = (props) => { "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || t( - "case:summary-no-date-entered-label" + "case:summary-no-information-to-date-label" )}
@@ -241,6 +274,31 @@ const Pinswg_dnsid = (props) => { */}
+
+
+ {t( + "case:summary-decision-date-label" + )} +
+
+ {_.has( + detailsObj, + "pinswg_casedecisiondate" + ) + ? !_.isEmpty( + detailsObj.pinswg_casedecisiondate + ) + ? formatDates( + detailsObj.pinswg_casedecisiondate + ) + : t( + "case:summary-no-information-to-date-label" + ) + : t( + "case:summary-no-information-to-date-label" + )} +
+
{casesObj.numberofchildincidents > 0 && (
@@ -283,7 +341,7 @@ const Pinswg_dnsid = (props) => { ) : ( "" )} -
+ {/*
{t( "case:summary-case-recommendation-label" @@ -299,7 +357,7 @@ const Pinswg_dnsid = (props) => { ) : detailsObj.pinswg_recommendation} -
+ */} {detailsObj.pinswg_webaddress != null && (
@@ -353,53 +411,104 @@ const Pinswg_dnsid = (props) => {
- {t("case:summary-event-date-label")} -
+ {t( + "case:summary-valid-notice-of-intention-to-submit-an-application" + )} + {" "}
{_.has( detailsObj, - "pinswg_dateeventrequested" + "pinswg_validnoticeofintentiontosubmitanapplicati" ) ? !_.isEmpty( - detailsObj.pinswg_dateeventrequested + detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati ) ? formatDates( - detailsObj.pinswg_dateeventrequested + detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" )}
{t( - "case:summary-decision-date-label" + "case:summary-written-acceptance-of-notice" )}
{_.has( detailsObj, - "pinswg_casedecisiondate" + "pinswg_writtenacceptanceofnotification" ) ? !_.isEmpty( - detailsObj.pinswg_casedecisiondate + detailsObj.pinswg_writtenacceptanceofnotification ) ? formatDates( - detailsObj.pinswg_casedecisiondate + detailsObj.pinswg_writtenacceptanceofnotification ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" + )} +
+
+
+
+ {t( + "case:summary-deadline-for-submission-of-application" + )} +
+
+ {_.has( + detailsObj, + "pinswg_deadlineforsubmissionofapplication" + ) + ? !_.isEmpty( + detailsObj.pinswg_deadlineforsubmissionofapplication + ) + ? formatDates( + detailsObj.pinswg_deadlineforsubmissionofapplication + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
+
+
+
+ {t( + "case:summary-date-of-submission-of-application" + )} +
+
+ {_.has( + detailsObj, + "pinswg_dateofsubmissionofapplication" + ) + ? !_.isEmpty( + detailsObj.pinswg_dateofsubmissionofapplication + ) + ? formatDates( + detailsObj.pinswg_dateofsubmissionofapplication + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" )}
-
{t( @@ -418,10 +527,10 @@ const Pinswg_dnsid = (props) => { detailsObj.pinswg_applicationacceptedasvalid ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" )}
@@ -443,10 +552,60 @@ const Pinswg_dnsid = (props) => { detailsObj.pinswg_applicationrejectedasinvalid ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" + )} + +
+
+
+ {t( + "case:summary-end-of-representation-period" + )} +
+
+ {_.has( + detailsObj, + "pinswg_endofrepresentationperiod" + ) + ? !_.isEmpty( + detailsObj.pinswg_endofrepresentationperiod + ) + ? formatDates( + detailsObj.pinswg_endofrepresentationperiod + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
+
+
+
+ {t( + "case:summary-date-of-request-to-vary" + )} +
+
+ {_.has( + detailsObj, + "pinswg_dateofrequesttovarytheapplication" + ) + ? !_.isEmpty( + detailsObj.pinswg_dateofrequesttovarytheapplication + ) + ? formatDates( + detailsObj.pinswg_dateofrequesttovarytheapplication + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" )}
@@ -468,14 +627,64 @@ const Pinswg_dnsid = (props) => { detailsObj.pinswg_confirmrequesttovaryapplication ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" )}
+
+ {t( + "case:summary-reject-request-to-vary-application" + )} +
+
+ {_.has( + detailsObj, + "pinswg_rejectrequesttovaryapplication" + ) + ? !_.isEmpty( + detailsObj.pinswg_rejectrequesttovaryapplication + ) + ? formatDates( + detailsObj.pinswg_rejectrequesttovaryapplication + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
+
+
+
+ {t( + "case:summary-suspension-start-dates" + )} +
+
+ {_.has( + detailsObj, + "pinswg_suspensionstartdates" + ) + ? !_.isEmpty( + detailsObj.pinswg_suspensionstartdates + ) + ? formatDates( + detailsObj.pinswg_suspensionstartdates + ) + : t( + "case:summary-awaiting-information-label" + ) + : t( + "case:summary-awaiting-information-label" + )} +
+
+ {/*
{t( "case:summary-date-of-decisions" @@ -499,58 +708,9 @@ const Pinswg_dnsid = (props) => { "case:summary-no-date-entered-label" )} -
-
-
- {t( - "case:summary-date-of-request-to-vary" - )} -
-
- {_.has( - detailsObj, - "pinswg_dateofrequesttovarytheapplication" - ) - ? !_.isEmpty( - detailsObj.pinswg_dateofrequesttovarytheapplication - ) - ? formatDates( - detailsObj.pinswg_dateofrequesttovarytheapplication - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" - )} -
-
-
-
- {t( - "case:summary-date-of-submission-of-application" - )} -
-
- {_.has( - detailsObj, - "pinswg_dateofsubmissionofapplication" - ) - ? !_.isEmpty( - detailsObj.pinswg_dateofsubmissionofapplication - ) - ? formatDates( - detailsObj.pinswg_dateofsubmissionofapplication - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" - )} -
-
-
+
*/} + + {/*
{t( "case:summary-date-project-published-to-website" @@ -574,83 +734,8 @@ const Pinswg_dnsid = (props) => { "case:summary-no-date-entered-label" )} -
-
-
- {t( - "case:summary-deadline-for-submission-of-application" - )} -
-
- {_.has( - detailsObj, - "pinswg_deadlineforsubmissionofapplication" - ) - ? !_.isEmpty( - detailsObj.pinswg_deadlineforsubmissionofapplication - ) - ? formatDates( - detailsObj.pinswg_deadlineforsubmissionofapplication - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" - )} -
-
-
-
- {t( - "case:summary-end-of-representation-period" - )} -
-
- {_.has( - detailsObj, - "pinswg_endofrepresentationperiod" - ) - ? !_.isEmpty( - detailsObj.pinswg_endofrepresentationperiod - ) - ? formatDates( - detailsObj.pinswg_endofrepresentationperiod - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" - )} -
-
-
-
- {t( - "case:summary-inspector-report-submission-to-welsh-government" - )} -
-
- {_.has( - detailsObj, - "pinswg_inspectorreportsubmittedtowelshgovernment" - ) - ? !_.isEmpty( - detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment - ) - ? formatDates( - detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" - )} -
-
-
+
*/} + {/*
{t( "case:summary-procedure-confirmed" @@ -674,29 +759,30 @@ const Pinswg_dnsid = (props) => { "case:summary-no-date-entered-label" )} -
+ */} +
{t( - "case:summary-reject-request-to-vary-application" + "case:summary-suspension-end-dates" )}
{_.has( detailsObj, - "pinswg_rejectrequesttovaryapplication" + "pinswg_suspensionenddates" ) ? !_.isEmpty( - detailsObj.pinswg_rejectrequesttovaryapplication + detailsObj.pinswg_suspensionenddates ) ? formatDates( - detailsObj.pinswg_rejectrequesttovaryapplication + detailsObj.pinswg_suspensionenddates ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" )}
@@ -716,14 +802,14 @@ const Pinswg_dnsid = (props) => { detailsObj.pinswg_reportdueby ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" )} -
+ {/*
{t("case:summary-suspension-dates")}
@@ -745,79 +831,29 @@ const Pinswg_dnsid = (props) => { "case:summary-no-date-entered-label" )} -
+
*/}
{t( - "case:summary-suspension-end-dates" + "case:summary-inspector-report-submission-to-welsh-government" )}
{_.has( detailsObj, - "pinswg_suspensionenddates" + "pinswg_inspectorreportsubmittedtowelshgovernment" ) ? !_.isEmpty( - detailsObj.pinswg_suspensionenddates + detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment ) ? formatDates( - detailsObj.pinswg_suspensionenddates + detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" - )} -
-
-
-
- {t( - "case:summary-suspension-start-dates" - )} -
-
- {_.has( - detailsObj, - "pinswg_suspensionstartdates" - ) - ? !_.isEmpty( - detailsObj.pinswg_suspensionstartdates - ) - ? formatDates( - detailsObj.pinswg_suspensionstartdates - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" - )} -
-
-
-
- {t( - "case:summary-valid-notice-of-intention-to-submit-an-application" - )} -
{" "} -
- {_.has( - detailsObj, - "pinswg_validnoticeofintentiontosubmitanapplicati" - ) - ? !_.isEmpty( - detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati - ) - ? formatDates( - detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" )}
@@ -837,35 +873,10 @@ const Pinswg_dnsid = (props) => { detailsObj.pinswg_withdrawndate ) : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" ) : t( - "case:summary-no-date-entered-label" - )} - - -
-
- {t( - "case:summary-written-acceptance-of-notice" - )} -
-
- {_.has( - detailsObj, - "pinswg_writtenacceptanceofnotification" - ) - ? !_.isEmpty( - detailsObj.pinswg_writtenacceptanceofnotification - ) - ? formatDates( - detailsObj.pinswg_writtenacceptanceofnotification - ) - : t( - "case:summary-no-date-entered-label" - ) - : t( - "case:summary-no-date-entered-label" + "case:summary-awaiting-information-label" )}
diff --git a/components/dnssearchresults.js b/components/dnssearchresults.js index 4b4f1943..8824721f 100644 --- a/components/dnssearchresults.js +++ b/components/dnssearchresults.js @@ -7,7 +7,8 @@ import DNSSearchResults from "./search/dnssearchresults"; import CRMError from "./crmError"; export default function Search(props) { - const { searchString, searchResultsObj, myportal, watchedCases } = props; + const { searchString, searchResultsObj, myportal, watchedCases, showMap } = + props; let { t } = useTranslation(); const router = useRouter(); @@ -42,6 +43,7 @@ export default function Search(props) { dnsCoords={searchResultsObj.dnsCoordsObj.value} myportal={myportal} watchedCases={watchedCases} + showMap={showMap} /> diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js index 49b4cd58..a59bf55f 100644 --- a/components/myportal/viewall.js +++ b/components/myportal/viewall.js @@ -46,7 +46,7 @@ const ViewAllResults = (props) => { resultsArr.map((item, key) => { let detailsObj = jsonpath.query( searchDetailsObj, - "$..value[?(@.pinswg_name=='" + item.pinswg_title + "')]" + '$..value[?(@.pinswg_name=="' + item.pinswg_title + '")]' ); detailsObj = detailsObj[0]; diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index e9f3c952..e4f9ab6a 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -53,6 +53,7 @@ const DNSSearchResults = (props) => { watchedCases, setWatchedCases, setWatchedCasesDetails, + showMap, } = props; let { t } = useTranslation(); @@ -302,9 +303,9 @@ const DNSSearchResults = (props) => { resultsArr.map((item, key) => { let detailsObj = jsonpath.query( searchDetailsObj, - "$..value[?(@.pinswg_name=='" + + '$..value[?(@.pinswg_name=="' + item.title + - "')]" + '")]' ); detailsObj = detailsObj[0]; @@ -339,6 +340,7 @@ const DNSSearchResults = (props) => { item.incidentid, "appealType": item.pinswg_appealcasetype, + "showMap": showMap, }); }} > @@ -619,7 +621,13 @@ const DNSSearchResults = (props) => { <>
-
+

{t("dnsApplications:page-title")}

@@ -644,37 +652,37 @@ const DNSSearchResults = (props) => {
- {/* {process.env.SHOWMAPS == "true" && ( */} -
-
- +
- ModelsMap(map, maps) - } - /> + > + + ModelsMap(map, maps) + } + /> +
-
- {/* )} */} + )}
{searchResultsObj["@odata.count"] > 5 && ( diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 9acda3a0..926d9d26 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -247,9 +247,9 @@ const SearchResults = (props) => { resultsArr.map((item, key) => { let detailsObj = jsonpath.query( searchDetailsObj, - "$..value[?(@.pinswg_name=='" + + '$..value[?(@.pinswg_name=="' + item.title + - "')]" + '")]' ); detailsObj = detailsObj[0]; return ( diff --git a/locales/cy/case.json b/locales/cy/case.json index 47a1c822..1675e417 100644 --- a/locales/cy/case.json +++ b/locales/cy/case.json @@ -24,6 +24,9 @@ "summary-linked-cases-label": "Achosion cysylltiedig", "summary-dates-label": "Dyddiadau", "summary-no-date-entered-label": "dim dyddiad wedi'i nodi", + "summary-no-information-to-date-label": "Dim gwybodaeth hyd yma", + "summary-awaiting-information-label": "Aros am wybodaeth", + "summary-to-be-confirmed-label": "I gael ei gadarnhau", "summary-start-date-label": "Dyddiad Dechrau", "summary-questionnaire-due-date-label": "Holiadur i ddod", "summary-statement-due-date-label": "Datganiad(au) i ddod", diff --git a/locales/en/case.json b/locales/en/case.json index dd3ccdae..1f7fd05c 100644 --- a/locales/en/case.json +++ b/locales/en/case.json @@ -24,6 +24,9 @@ "summary-linked-cases-label": "Linked Cases", "summary-dates-label": "Dates", "summary-no-date-entered-label": "no date entered", + "summary-no-information-to-date-label": "No information to date", + "summary-awaiting-information-label": "Awaiting information", + "summary-to-be-confirmed-label": "To be confirmed", "summary-start-date-label": "Start Date", "summary-questionnaire-due-date-label": "Questionnaire due", "summary-statement-due-date-label": "Statement(s) due", diff --git a/pages/api/endpoint/getappealtypes_api.js b/pages/api/endpoint/getappealtypes_api.js index 3165624e..13c7c874 100644 --- a/pages/api/endpoint/getappealtypes_api.js +++ b/pages/api/endpoint/getappealtypes_api.js @@ -34,7 +34,8 @@ export default async function ApiProxy(req, res) { var token = await getToken(); var queryUrl = - "stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Developments of National Significance' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc"; + "stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc"; + //"stringmaps?$filter=objecttypecode eq 'incident' and attributename eq 'pinswg_appealcasetype' and value ne 'Developments of National Significance' and value ne 'LDP' and value ne 'Misc Casework'&$count=true&$select=value,stringmapid,organizationid,attributevalue&$orderby=value asc"; console.log(queryUrl); return axios diff --git a/pages/dnsapplications.js b/pages/dnsapplications.js index f5a85e83..e679b141 100644 --- a/pages/dnsapplications.js +++ b/pages/dnsapplications.js @@ -18,7 +18,7 @@ import { import { wrapper } from "../store/store"; const Home = (props) => { - const { footerLinks, pages } = props; + const { footerLinks, pages, showMap } = props; let { t, lang } = useTranslation(); const router = useRouter(); @@ -99,6 +99,7 @@ const Home = (props) => {
@@ -129,12 +130,17 @@ export const getServerSideProps = wrapper.getServerSideProps( } : searchResultsObj; + const showMapCheck = process.env.SHOWMAPS || false; + const searchDetailsObj = await getSearchDetails(searchResultsObj); const dnsCoords = await getDNSCoords(); store.dispatch(setSearchResults(searchResultsObj)); store.dispatch(setSearchDetails(searchDetailsObj)); store.dispatch(setSearch("DNS")); store.dispatch(setDNSCoords(dnsCoords)); + return { + props: { showMap: showMapCheck }, + }; } ); diff --git a/pages/dnsdetails.js b/pages/dnsdetails.js index 38c29962..264a4cdb 100644 --- a/pages/dnsdetails.js +++ b/pages/dnsdetails.js @@ -9,7 +9,7 @@ import Footer from "../components/footer"; import Header from "../components/header"; const Home = (props) => { - const { footerLinks, pages } = props; + const { footerLinks, pages, showMap } = props; let { t, lang } = useTranslation(); const router = useRouter(); @@ -63,6 +63,7 @@ const Home = (props) => { appealTypeID={ props.currentView.caseReference.appealType } + showMap={props.currentView.caseReference.showMap} />