From 05f791e6a86772375398c14ad567d1bc9483a638 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 15 Apr 2025 12:59:27 +0100 Subject: [PATCH 1/2] update jsonpath for csp fix --- components/case/documents.js | 69 ++++++---- components/case/representation/index.js | 76 ++++++----- .../representation/representationDetails.js | 9 +- .../case/representation/representationLPA.js | 20 +-- .../representationLPADetails.js | 9 +- ...resentationLPAQuestionnaire_enforcement.js | 20 +-- .../representationLPAQuestionnaire_s78.js | 20 +-- components/case/representationList.js | 20 +-- components/case/summary.js | 85 +++++++----- .../case/summaryTypes/pinswg_advertsid.js | 70 ++++++---- .../case/summaryTypes/pinswg_callinss77id.js | 60 +++++---- .../case/summaryTypes/pinswg_commonlandid.js | 80 ++++++----- .../pinswg_communityinfrastructurelevyid.js | 60 +++++---- .../pinswg_compulsorypurchaseordersid.js | 70 ++++++---- components/case/summaryTypes/pinswg_dnsid.js | 65 +++++---- .../summaryTypes/pinswg_electricityactid.js | 80 ++++++----- ...pinswg_enforcementlistedbuildingconseid.js | 60 +++++---- .../pinswg_enforcementnoticeappeals174id.js | 60 +++++---- .../pinswg_environmentalpermittingid.js | 80 ++++++----- .../pinswg_harbourrevisionorderid.js | 70 ++++++---- ...pinswg_hedgeshedgerowstreepreservatioid.js | 90 ++++++++----- .../pinswg_householderappealhasid.js | 50 ++++--- ...pinswg_lawfuldevelopmentcertificatappid.js | 60 +++++---- components/case/summaryTypes/pinswg_ldpid.js | 60 +++++---- ...pinswg_listedbuildingandconservationrid.js | 60 +++++---- .../pinswg_maintenanceoflands217id.js | 60 +++++---- .../pinswg_miscellaneouscasewordid.js | 80 ++++++----- .../summaryTypes/pinswg_nonvalidationid.js | 47 ++++--- .../pinswg_planningappeals78id.js | 60 +++++---- .../pinswg_planningconditionss73s79id.js | 60 +++++---- .../pinswg_planningobligationappeals106id.js | 60 +++++---- components/case/summaryTypes/pinswg_rowid.js | 90 ++++++++----- .../pinswg_transportandworkactid.js | 30 +++-- .../case/summaryTypes/pinswg_wayleaveid.js | 80 ++++++----- components/elements/index.js | 39 ++++-- components/myportal.js | 10 +- components/myportal/advancedsearch.js | 20 +-- .../myportal/awaitingsubmissionfromblob.js | 20 +-- components/myportal/topthree.js | 20 +-- components/myportal/topthree_reps.js | 50 ++++--- components/myportal/viewall.js | 124 +++++++++++------- components/newappeal/buildcheckrow.js | 22 +++- components/newappeal/buildchecksection.js | 12 +- components/newappeal/buildrow.js | 2 +- components/newappeal/createCase.js | 20 +-- components/pdftemplates/appealRow_pdf.js | 8 +- components/search/addresssearchresults.js | 63 +++++---- components/search/advancedsearch.js | 30 +++-- components/search/dnssearchresults.js | 42 +++--- components/search/searchresults.js | 53 +++++--- components/utils/index.js | 81 +++++++----- package.json | 4 +- .../getbasicsearch_by_address_api copy.js | 6 +- .../endpoint/getbasicsearch_by_address_api.js | 6 +- pages/api/endpoint/getmylpacases_api.js | 6 +- pages/myportal/[appealtypes].js | 9 +- pages/newappeal/[appealtypes].js | 9 +- 57 files changed, 1585 insertions(+), 1041 deletions(-) diff --git a/components/case/documents.js b/components/case/documents.js index 9f4e6b88..41b94b9a 100644 --- a/components/case/documents.js +++ b/components/case/documents.js @@ -157,10 +157,11 @@ const DocumentDetails = (props) => { > {documentTypes.map((item, key) => { @@ -172,12 +173,14 @@ const DocumentDetails = (props) => { } > {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item.pinswg_isharedocumentlocationsLabel + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item.pinswg_isharedocumentlocationsLabel || t( "case:summary-no-date-entered-label" @@ -317,12 +320,14 @@ const DocumentDetails = (props) => { ) : ( documentDetailsArr.map((item, key) => { - let detailsObj = jsonpath( - "$..[?(@._pinswg_documentids_value=='" + + let detailsObj = jsonpath({ + path: + "$..[?(@._pinswg_documentids_value=='" + incidentid + "')]", - item - ); + json: item, + sanbox: {}, + }); detailsObj = item; return (
{ {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sanbox: {}, + }) : detailsObj[ "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" ] || @@ -566,12 +573,14 @@ const DocumentDetails = (props) => { } > {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item.pinswg_isharedocumentlocationsLabel + '")].value_cy', - transLookup - ) + jsonL: transLookup, + sanbox: {}, + }) : item.pinswg_isharedocumentlocationsLabel || t( "case:summary-no-date-entered-label" @@ -720,12 +729,14 @@ const DocumentDetails = (props) => {
) : ( documentDetailsArr.map((item, key) => { - let detailsObj = jsonpath( - "$..[?(@._pinswg_documentids_value=='" + + let detailsObj = jsonpath({ + path: + "$..[?(@._pinswg_documentids_value=='" + incidentid + "')]", - item - ); + json: item, + sandbox: {}, + }); detailsObj = item; return (
{ {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/representation/index.js b/components/case/representation/index.js index 41fdbb0e..ce849cbe 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -209,19 +209,22 @@ let MakeRepresentation = (props) => { isLPA && setRepresentationCapacity("LPA"); currentType == "searchResultsObj" - ? (casesObj = jsonpath( - '$..[?(@.title=="' + caseReference + '")]', - setCaseQueryObj - )) + ? (casesObj = jsonpath({ + path: '$..[?(@.title=="' + caseReference + '")]', + json: setCaseQueryObj, + sandbox: {}, + })) : currentType == "watchedCases" - ? (casesObj = jsonpath( - '$..[?(@.ticketnumber=="' + caseReference + '")]', - watchedCases - )) - : (casesObj = jsonpath( - '$..[?(@.reference=="' + caseReference + '")]', - setCaseQueryObj - )); + ? (casesObj = jsonpath({ + path: '$..[?(@.ticketnumber=="' + caseReference + '")]', + json: watchedCases, + sandbox: {}, + })) + : (casesObj = jsonpath({ + path: '$..[?(@.reference=="' + caseReference + '")]', + json: setCaseQueryObj, + sandbox: {}, + })); casesObj = Object.assign({}, ...casesObj); @@ -262,33 +265,41 @@ let MakeRepresentation = (props) => { var resultsObj = {}; - resultsObj = jsonpath( - '$..[?(@.ticketnumber=="' + + resultsObj = jsonpath({ + path: + '$..[?(@.ticketnumber=="' + currentView.caseReference.currentReference + '")]', - setCaseResultsObj - ); + json: setCaseResultsObj, + sandbox: {}, + }); resultsObj = resultsObj[0]; detailsObj = router.query.hasOwnProperty("state") ? router.query.state == "edit" - ? jsonpath( - '$..[?(@.repfile_name =="' + router.query.created + '")]', - setCaseDetailsObj - ) - : jsonpath( - '$..[?(@.pinswg_name =="' + + ? jsonpath({ + path: + '$..[?(@.repfile_name =="' + router.query.created + '")]', + json: setCaseDetailsObj, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_name =="' + currentView.caseReference.currentReference + '")]', - setCaseDetailsObj - ) - : jsonpath( - '$..[?(@.pinswg_name =="' + + json: setCaseDetailsObj, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_name =="' + currentView.caseReference.currentReference + '")]', - setCaseDetailsObj - ); + json: setCaseDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0]; @@ -931,10 +942,11 @@ let MakeRepresentation = (props) => { var detailsObj = {}; - detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + caseReference + '")]', - setCaseDetailsObj - ); + detailsObj = jsonpath({ + path: '$..[?(@.pinswg_name=="' + caseReference + '")]', + json: setCaseDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0]; diff --git a/components/case/representation/representationDetails.js b/components/case/representation/representationDetails.js index efe5380c..8b32d7a3 100644 --- a/components/case/representation/representationDetails.js +++ b/components/case/representation/representationDetails.js @@ -28,10 +28,11 @@ const RepDetails = (props) => { : caseReference : caseReference; - detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + caseReference + '")]', - setCaseDetailsObj - ); + detailsObj = jsonpath({ + path: '$..[?(@.pinswg_name=="' + caseReference + '")]', + json: setCaseDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0]; diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index 477d5c9d..d2950f83 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -176,12 +176,14 @@ let RepLPA = (props) => { var detailsObj = {}; - detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + + detailsObj = jsonpath({ + path: + '$..[?(@.pinswg_name=="' + currentView.caseReference.currentReference + '")]', - setCaseDetailsObj - ); + json: setCaseDetailsObj, + sandbox: {}, + }); let setCaseResultssObj = router.query.hasOwnProperty("state") ? router.query.state == "edit" @@ -193,12 +195,14 @@ let RepLPA = (props) => { var resultsObj = {}; - resultsObj = jsonpath( - '$..[?(@.pinswg_name=="' + + resultsObj = jsonpath({ + path: + '$..[?(@.pinswg_name=="' + currentView.caseReference.currentReference + '")]', - setCaseResultssObj - ); + json: setCaseResultssObj, + sandbox: {}, + }); resultsObj = resultsObj[0]; props.formObj.hasOwnProperty("representationForm") && diff --git a/components/case/representation/representationLPADetails.js b/components/case/representation/representationLPADetails.js index f38e40f2..b9433e0b 100644 --- a/components/case/representation/representationLPADetails.js +++ b/components/case/representation/representationLPADetails.js @@ -20,10 +20,11 @@ const RepLPADetails = (props) => { var detailsObj = {}; - detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + caseReference + '")]', - setCaseDetailsObj - ); + detailsObj = jsonpath({ + path: '$..[?(@.pinswg_name=="' + caseReference + '")]', + json: setCaseDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0]; diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js index e33bd895..ef433f52 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js @@ -58,12 +58,14 @@ let Enforcement_Questionnaire = (props) => { var detailsObj = {}; - detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + + detailsObj = jsonpath({ + path: + '$..[?(@.pinswg_name=="' + currentView.caseReference.currentReference + '")]', - setCaseDetailsObj - ); + json: setCaseDetailsObj, + sandbox: {}, + }); let setCaseResultssObj = router.query.hasOwnProperty("state") ? router.query.state == "edit" @@ -79,12 +81,14 @@ let Enforcement_Questionnaire = (props) => { var resultsObj = {}; - resultsObj = jsonpath( - '$..[?(@.ticketnumber=="' + + resultsObj = jsonpath({ + path: + '$..[?(@.ticketnumber=="' + currentView.caseReference.currentReference + '")]', - setCaseResultssObj - ); + json: setCaseResultssObj, + sandbox: {}, + }); resultsObj = resultsObj[0]; return ( diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js index 3eaf275d..20b6cc6a 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js @@ -60,12 +60,14 @@ let S78_Questionnaire = (props) => { var detailsObj = {}; - detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + + detailsObj = jsonpath({ + path: + '$..[?(@.pinswg_name=="' + currentView.caseReference.currentReference + '")]', - setCaseDetailsObj - ); + json: setCaseResultssObj, + sandbox: {}, + }); let setCaseResultssObj = router.query.hasOwnProperty("state") ? router.query.state == "edit" @@ -81,8 +83,9 @@ let S78_Questionnaire = (props) => { var resultsObj = {}; - resultsObj = jsonpath( - "$..[?(@." + + resultsObj = jsonpath({ + path: + "$..[?(@." + (router.query.hasOwnProperty("state") ? router.query.state == "edit" ? "caseRef" @@ -91,8 +94,9 @@ let S78_Questionnaire = (props) => { '=="' + currentView.caseReference.currentReference + '")]', - setCaseResultssObj - ); + json: setCaseResultssObj, + sandbox: {}, + }); resultsObj = resultsObj[0]; //console.log(resultsObj); diff --git a/components/case/representationList.js b/components/case/representationList.js index 0a5db79f..7c24ae12 100644 --- a/components/case/representationList.js +++ b/components/case/representationList.js @@ -57,12 +57,14 @@ const RepresentationList = (props) => {
{representationsArr.map((item, key) => { - let detailsObj = jsonpath( - "$..[?(@.pinswg_representationsid=='" + + let detailsObj = jsonpath({ + path: + "$..[?(@.pinswg_representationsid=='" + incidentid + "')]", - item - ); + json: item, + sandbox: {}, + }); detailsObj = item; console.log(detailsObj); @@ -87,14 +89,16 @@ const RepresentationList = (props) => { {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sanbox: {}, + }) : detailsObj[ "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summary.js b/components/case/summary.js index 44f0201e..ddedc878 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -132,10 +132,14 @@ const CaseSummary = (props) => { }; const isWatchedCase = (whichIncident) => { - let isWatched = jsonpath( - "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]", - watchedCases - ); + let isWatched = jsonpath({ + path: + "$..value[?(@._pinswg_watchedcase_value=='" + + whichIncident + + "')]", + json: watchedCases, + sandbox: {}, + }); return isWatched; }; @@ -171,45 +175,52 @@ const CaseSummary = (props) => { var casesObj = {}; currentType == "searchResultsObj" - ? (casesObj = jsonpath( - '$..[?(@.title=="' + caseReference + '")]', - searchResultsObj - )) + ? (casesObj = jsonpath({ + path: '$..[?(@.title=="' + caseReference + '")]', + json: searchResultsObj, + sandbox: {}, + })) : currentType == "watchedCases" - ? (casesObj = jsonpath( - '$..[?(@.pinswg_title=="' + caseReference + '")]', - setCaseQueryObj - )) + ? (casesObj = jsonpath({ + path: '$..[?(@.pinswg_title=="' + caseReference + '")]', + json: setCaseQueryObj, + sandbox: {}, + })) : currentType == "myCases" - ? (casesObj = jsonpath( - '$..[?(@.pinswg_title=="' + caseReference + '")]', - setCaseQueryObj - )) + ? (casesObj = jsonpath({ + path: '$..[?(@.pinswg_title=="' + caseReference + '")]', + json: setCaseQueryObj, + sandbox: {}, + })) : currentType == "directResultsObj" - ? (casesObj = jsonpath( - '$..[?(@.ticketnumber=="' + caseReference + '")]', - setCaseQueryObj - )) - : (casesObj = jsonpath( - '$..[?(@.reference=="' + caseReference + '")]', - setCaseQueryObj - )); + ? (casesObj = jsonpath({ + path: '$..[?(@.ticketnumber=="' + caseReference + '")]', + json: setCaseQueryObj, + sandbox: {}, + })) + : (casesObj = jsonpath({ + path: '$..[?(@.reference=="' + caseReference + '")]', + json: setCaseQueryObj, + sandbox: {}, + })); casesObj = Object.assign({}, ...casesObj); var detailsObj = {}; currentType == "searchResultsObj" - ? (detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + caseReference + '")]', - searchDetailsObj - )) + ? (detailsObj = jsonpath({ + path: '$..[?(@.pinswg_name=="' + caseReference + '")]', + json: searchDetailsObj, + sandbox: {}, + })) : currentType == "directResultsObj" ? (detailsObj = setCaseDetailsObj[0].value[0]) - : (detailsObj = jsonpath( - '$..[?(@.pinswg_name=="' + caseReference + '")]', - setCaseDetailsObj - )); + : (detailsObj = jsonpath({ + path: '$..[?(@.pinswg_name=="' + caseReference + '")]', + jsopn: setCaseDetailsObj, + sandbox: {}, + })); detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0]; @@ -386,14 +397,16 @@ const CaseSummary = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_casestage@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_casestage@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_advertsid.js b/components/case/summaryTypes/pinswg_advertsid.js index 27c483ad..b6208e39 100644 --- a/components/case/summaryTypes/pinswg_advertsid.js +++ b/components/case/summaryTypes/pinswg_advertsid.js @@ -27,14 +27,16 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -50,14 +52,16 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -70,14 +74,16 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -104,14 +110,16 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -123,14 +131,16 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -142,14 +152,16 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -165,14 +177,16 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_callinss77id.js b/components/case/summaryTypes/pinswg_callinss77id.js index bb649b14..f56d2685 100644 --- a/components/case/summaryTypes/pinswg_callinss77id.js +++ b/components/case/summaryTypes/pinswg_callinss77id.js @@ -27,14 +27,16 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_commonlandid.js b/components/case/summaryTypes/pinswg_commonlandid.js index 8f428ce4..0f9a093b 100644 --- a/components/case/summaryTypes/pinswg_commonlandid.js +++ b/components/case/summaryTypes/pinswg_commonlandid.js @@ -27,14 +27,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -217,18 +229,22 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.pinswg_lpa=="' + + ? jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.pinswg_lpa=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value', - transLookup - ) || + json: transLookup, + sandbox: {}, + }) || t( "case:summary-no-date-entered-label" )} diff --git a/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js b/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js index 338926ad..724cfe8b 100644 --- a/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js +++ b/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js @@ -27,14 +27,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_compulsorypurchaseordersid.js b/components/case/summaryTypes/pinswg_compulsorypurchaseordersid.js index 4d7fa147..409b26d7 100644 --- a/components/case/summaryTypes/pinswg_compulsorypurchaseordersid.js +++ b/components/case/summaryTypes/pinswg_compulsorypurchaseordersid.js @@ -27,14 +27,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -65,14 +67,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -84,14 +88,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -103,14 +109,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -125,14 +133,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -199,18 +209,22 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.pinswg_lpa=="' + + ? jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.pinswg_lpa=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value', - transLookup - ) || + json: transLookup, + sandbox: {}, + }) || t( "case:summary-no-date-entered-label" )} diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js index efcd32de..5a624b8f 100644 --- a/components/case/summaryTypes/pinswg_dnsid.js +++ b/components/case/summaryTypes/pinswg_dnsid.js @@ -122,14 +122,17 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -148,12 +151,14 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj.pinswg_webaddress + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : ( {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -203,14 +210,16 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" ] || @@ -225,7 +234,7 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy" - ? jsonpath( + ? jsonpath({path: '$..[?(@.value=="' + casesObj[ @@ -264,14 +273,16 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -331,14 +342,16 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -430,7 +443,7 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy" - ? jsonpath( + ? jsonpath({path: '$..[?(@.value=="' + detailsObj.pinswg_recommendation + '")].value_cy', diff --git a/components/case/summaryTypes/pinswg_electricityactid.js b/components/case/summaryTypes/pinswg_electricityactid.js index 1c62f3ed..35b51298 100644 --- a/components/case/summaryTypes/pinswg_electricityactid.js +++ b/components/case/summaryTypes/pinswg_electricityactid.js @@ -65,14 +65,16 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -87,14 +89,16 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -123,14 +127,16 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -144,14 +150,16 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -163,14 +171,16 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -185,14 +195,16 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -259,12 +271,14 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj.pinswg_recommendation + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj.pinswg_recommendation || t( "case:summary-no-date-entered-label" @@ -280,12 +294,14 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj.pinswg_webaddress + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj.pinswg_webaddress || t( "case:summary-no-date-entered-label" diff --git a/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js b/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js index 952dd551..00fb137d 100644 --- a/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js +++ b/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js @@ -27,14 +27,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_enforcementnoticeappeals174id.js b/components/case/summaryTypes/pinswg_enforcementnoticeappeals174id.js index 6ef58db0..5c6f393e 100644 --- a/components/case/summaryTypes/pinswg_enforcementnoticeappeals174id.js +++ b/components/case/summaryTypes/pinswg_enforcementnoticeappeals174id.js @@ -27,14 +27,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_environmentalpermittingid.js b/components/case/summaryTypes/pinswg_environmentalpermittingid.js index 6be71cd9..e9e76b0b 100644 --- a/components/case/summaryTypes/pinswg_environmentalpermittingid.js +++ b/components/case/summaryTypes/pinswg_environmentalpermittingid.js @@ -27,14 +27,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -217,18 +229,22 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.pinswg_lpa=="' + + ? jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.pinswg_lpa=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value', - transLookup - ) || + json: transLookup, + sandbox: {}, + }) || t( "case:summary-no-date-entered-label" )} diff --git a/components/case/summaryTypes/pinswg_harbourrevisionorderid.js b/components/case/summaryTypes/pinswg_harbourrevisionorderid.js index 283443c5..980373f5 100644 --- a/components/case/summaryTypes/pinswg_harbourrevisionorderid.js +++ b/components/case/summaryTypes/pinswg_harbourrevisionorderid.js @@ -65,14 +65,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -87,14 +89,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -123,14 +127,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -142,14 +148,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -164,14 +172,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -238,12 +248,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj.pinswg_recommendation + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj.pinswg_recommendation || t( "case:summary-no-date-entered-label" @@ -259,12 +271,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj.pinswg_webaddress + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj.pinswg_webaddress || t( "case:summary-no-date-entered-label" diff --git a/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js b/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js index 1fbe7ef8..d3ed5d7f 100644 --- a/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js +++ b/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js @@ -27,14 +27,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -50,14 +52,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -70,14 +74,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -104,14 +110,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -123,14 +131,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -142,14 +152,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -164,14 +176,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -238,18 +252,22 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.pinswg_lpa=="' + + ? jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.pinswg_lpa=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value', - transLookup - ) || + json: transLookup, + sandbox: {}, + }) || t( "case:summary-no-date-entered-label" )} diff --git a/components/case/summaryTypes/pinswg_householderappealhasid.js b/components/case/summaryTypes/pinswg_householderappealhasid.js index 49ad4fcd..98d8f8fe 100644 --- a/components/case/summaryTypes/pinswg_householderappealhasid.js +++ b/components/case/summaryTypes/pinswg_householderappealhasid.js @@ -27,14 +27,16 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -124,14 +132,16 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_lawfuldevelopmentcertificatappid.js b/components/case/summaryTypes/pinswg_lawfuldevelopmentcertificatappid.js index dc72a42f..54c02828 100644 --- a/components/case/summaryTypes/pinswg_lawfuldevelopmentcertificatappid.js +++ b/components/case/summaryTypes/pinswg_lawfuldevelopmentcertificatappid.js @@ -27,14 +27,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_ldpid.js b/components/case/summaryTypes/pinswg_ldpid.js index f5ab5685..b04d8699 100644 --- a/components/case/summaryTypes/pinswg_ldpid.js +++ b/components/case/summaryTypes/pinswg_ldpid.js @@ -27,14 +27,16 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_listedbuildingandconservationrid.js b/components/case/summaryTypes/pinswg_listedbuildingandconservationrid.js index ca66c98f..e66f06bb 100644 --- a/components/case/summaryTypes/pinswg_listedbuildingandconservationrid.js +++ b/components/case/summaryTypes/pinswg_listedbuildingandconservationrid.js @@ -27,14 +27,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_maintenanceoflands217id.js b/components/case/summaryTypes/pinswg_maintenanceoflands217id.js index 3b6d4d1d..97a2dd62 100644 --- a/components/case/summaryTypes/pinswg_maintenanceoflands217id.js +++ b/components/case/summaryTypes/pinswg_maintenanceoflands217id.js @@ -27,14 +27,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_miscellaneouscasewordid.js b/components/case/summaryTypes/pinswg_miscellaneouscasewordid.js index 7251bd03..793aa1cf 100644 --- a/components/case/summaryTypes/pinswg_miscellaneouscasewordid.js +++ b/components/case/summaryTypes/pinswg_miscellaneouscasewordid.js @@ -27,14 +27,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -217,18 +229,22 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.pinswg_lpa=="' + + ? jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.pinswg_lpa=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value', - transLookup - ) || + json: transLookup, + sandbox: {}, + }) || t( "case:summary-no-date-entered-label" )} diff --git a/components/case/summaryTypes/pinswg_nonvalidationid.js b/components/case/summaryTypes/pinswg_nonvalidationid.js index 04896099..33bd1483 100644 --- a/components/case/summaryTypes/pinswg_nonvalidationid.js +++ b/components/case/summaryTypes/pinswg_nonvalidationid.js @@ -27,14 +27,16 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,15 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy" - ? jsonpath( + ? jsonpath({path: '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +107,16 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -124,14 +131,16 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decisionissued@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decisionissued@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_planningappeals78id.js b/components/case/summaryTypes/pinswg_planningappeals78id.js index 8c58c358..9a60cc48 100644 --- a/components/case/summaryTypes/pinswg_planningappeals78id.js +++ b/components/case/summaryTypes/pinswg_planningappeals78id.js @@ -27,14 +27,16 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || @@ -124,14 +132,16 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -146,14 +156,16 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_dicision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_dicision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_planningconditionss73s79id.js b/components/case/summaryTypes/pinswg_planningconditionss73s79id.js index cc9e805b..a89cf9ab 100644 --- a/components/case/summaryTypes/pinswg_planningconditionss73s79id.js +++ b/components/case/summaryTypes/pinswg_planningconditionss73s79id.js @@ -27,14 +27,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_planningobligationappeals106id.js b/components/case/summaryTypes/pinswg_planningobligationappeals106id.js index 03da14c6..1b124841 100644 --- a/components/case/summaryTypes/pinswg_planningobligationappeals106id.js +++ b/components/case/summaryTypes/pinswg_planningobligationappeals106id.js @@ -27,14 +27,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || diff --git a/components/case/summaryTypes/pinswg_rowid.js b/components/case/summaryTypes/pinswg_rowid.js index 955372b3..3c78b453 100644 --- a/components/case/summaryTypes/pinswg_rowid.js +++ b/components/case/summaryTypes/pinswg_rowid.js @@ -27,14 +27,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -50,14 +52,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -70,14 +74,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -104,14 +110,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -123,14 +131,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -142,14 +152,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -164,14 +176,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -238,18 +252,22 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.pinswg_lpa=="' + + ? jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.pinswg_lpa=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value', - transLookup - ) || + json: transLookup, + sandbox: {}, + }) || t( "case:summary-no-date-entered-label" )} diff --git a/components/case/summaryTypes/pinswg_transportandworkactid.js b/components/case/summaryTypes/pinswg_transportandworkactid.js index 396fbc5d..5ca48c8a 100644 --- a/components/case/summaryTypes/pinswg_transportandworkactid.js +++ b/components/case/summaryTypes/pinswg_transportandworkactid.js @@ -65,14 +65,16 @@ const Pinswg_transportandworkactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -90,12 +92,14 @@ const Pinswg_transportandworkactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj.pinswg_recommendation + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj.pinswg_recommendation || t( "case:summary-no-date-entered-label" @@ -111,12 +115,14 @@ const Pinswg_transportandworkactid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj.pinswg_webaddress + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj.pinswg_webaddress || t( "case:summary-no-date-entered-label" diff --git a/components/case/summaryTypes/pinswg_wayleaveid.js b/components/case/summaryTypes/pinswg_wayleaveid.js index d535ebf8..bc3eb60e 100644 --- a/components/case/summaryTypes/pinswg_wayleaveid.js +++ b/components/case/summaryTypes/pinswg_wayleaveid.js @@ -27,14 +27,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -49,14 +51,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -83,14 +87,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_procedure@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -102,14 +108,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_typeofevent@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -121,14 +129,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : casesObj[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || @@ -143,14 +153,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "pinswg_decision@OData.Community.Display.V1.FormattedValue" ] || @@ -217,18 +229,22 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" - ? jsonpath( - '$..[?(@.pinswg_lpa=="' + + ? jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.pinswg_lpa=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.pinswg_lpa=="' + detailsObj.pinswg_relevantauthorityname + '")].value', - transLookup - ) || + json: transLookup, + sandbox: {}, + }) || t( "case:summary-no-date-entered-label" )} diff --git a/components/elements/index.js b/components/elements/index.js index f676b273..5f3b594b 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -1339,10 +1339,11 @@ const RenderPickList = ({ }) => { let { t } = useTranslation(); - var dropdownObj = jsonpath( - "$..value[?(@.LogicalName=='" + datafieldname + "')]..Options", - picklistData - ); + var dropdownObj = jsonpath({ + path: "$..value[?(@.LogicalName=='" + datafieldname + "')]..Options", + json: picklistData, + sandbox: {}, + }); dropdownObj = dropdownObj[0]; const required = (value) => { @@ -1716,11 +1717,19 @@ export const FieldsTranslations = (label) => { const { locale } = router; const { appealtypes } = router.query; - let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup); + let formObj = jsonpath({ + path: "$['" + appealtypes + "']", + json: fieldLookup, + sandbox: {}, + }); let labelTrans = router.locale == "cy" - ? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)[0] + ? jsonpath({ + path: '$..[?(@.value=="' + label + '")].value_cy', + json: formObj, + sandbox: {}, + })[0] : label; //labelTrans = labelTrans.length > 1 ? labelTrans[0] : labelTrans; @@ -1735,10 +1744,11 @@ const PickListTranslations = (optionValue) => { //console.log(optionValue); let optionTrans = router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + optionValue + '")].value_cy', - pickListLookup - ) + ? jsonpath({ + path: '$..[?(@.value=="' + optionValue + '")].value_cy', + json: pickListLookup, + sandbox: {}, + }) : optionValue; //console.log(optionTrans, optionValue); return optionTrans; @@ -1934,10 +1944,11 @@ const RenderFileUpload = (field) => { const filelistObj = field.fileList || {}; - const blobList = jsonpath( - "$..[?(@.documentType=='" + field.documentTypeCode + "')]", - filelistObj - ); + const blobList = jsonpath({ + path: "$..[?(@.documentType=='" + field.documentTypeCode + "')]", + json: filelistObj, + sandbox: {}, + }); //const blobList = filelistObj; const deleteThisBlob = async ( diff --git a/components/myportal.js b/components/myportal.js index 5ea4a188..9162deb8 100644 --- a/components/myportal.js +++ b/components/myportal.js @@ -106,14 +106,16 @@ const MyPortal = (props) => {

{router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + props.accountDetails.accountDetails[ "pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : props.accountDetails.accountDetails[ "pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue" ]}{" "} diff --git a/components/myportal/advancedsearch.js b/components/myportal/advancedsearch.js index a446ca75..58b95e7e 100644 --- a/components/myportal/advancedsearch.js +++ b/components/myportal/advancedsearch.js @@ -146,13 +146,15 @@ let AdvancedSearch = (props) => { {/* {optionsObj[key].name} */} {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + optionsObj[key] .name + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : optionsObj[key].name || t( "case:summary-no-date-entered-label" @@ -249,13 +251,15 @@ let AdvancedSearch = (props) => { ) ? "" : router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + optionsObj[key] .value + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : optionsObj[key].value || t( "case:summary-no-date-entered-label" diff --git a/components/myportal/awaitingsubmissionfromblob.js b/components/myportal/awaitingsubmissionfromblob.js index be32e0eb..bca702d2 100644 --- a/components/myportal/awaitingsubmissionfromblob.js +++ b/components/myportal/awaitingsubmissionfromblob.js @@ -202,15 +202,17 @@ const AwaitingSubmissionFromBlob = (props) => {
{t("myportal:appeal-type-label")}:{" "} {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + getFormCollectionByID( showTopThreeArr[key] .pinswg_appealcasetype ).value + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : getFormCollectionByID( showTopThreeArr[key] .pinswg_appealcasetype @@ -293,14 +295,16 @@ const AwaitingSubmissionFromBlob = (props) => { : {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + showTopThreeArr[key][ "pinswg_lpaname" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : showTopThreeArr[key][ "pinswg_lpaname" ] || ""} diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index 9c33cdbb..640e9c96 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -326,14 +326,16 @@ const TopThree = (props) => {
{t("myportal:appeal-type-label")}:{" "} {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + showTopThreeArr[key][ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : showTopThreeArr[key][ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || ""} @@ -396,14 +398,16 @@ const TopThree = (props) => {
{router.locale == "cy" ? "ACLl" : "LPA"}: {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + showTopThreeArr[key][ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : showTopThreeArr[key][ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || ""} diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js index 8ebbbaff..c60f87a1 100644 --- a/components/myportal/topthree_reps.js +++ b/components/myportal/topthree_reps.js @@ -269,42 +269,50 @@ const TopThree = (props) => { {" "} {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + showTopThreeArr[key].representationType + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : showTopThreeArr[key].representationType || ""}
{t("myportal:capacity")}: {" "} {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + showTopThreeArr[key] .representationCapacity + '" ||@.value_cy=="' + showTopThreeArr[key] .representationCapacity + '" )].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.value_cy=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.value_cy=="' + showTopThreeArr[key] .representationCapacity + '")].value', - transLookup - ).length > 0 - ? jsonpath( - '$..[?(@.value_cy=="' + + json: transLookup, + sandbox: {}, + }).length > 0 + ? jsonpath({ + path: + '$..[?(@.value_cy=="' + showTopThreeArr[key] .representationCapacity + '")].value', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : showTopThreeArr[key].representationCapacity}
@@ -317,14 +325,16 @@ const TopThree = (props) => { {" "} {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + showTopThreeArr[key][ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : showTopThreeArr[key][ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] || ""} diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js index 8e353e9e..2cb23571 100644 --- a/components/myportal/viewall.js +++ b/components/myportal/viewall.js @@ -112,8 +112,9 @@ const ViewAllResults = (props) => { let resultsRowArr = []; const buildResultsRowArr = () => { resultsArr.map((item, key) => { - let detailsObj = jsonpath( - "$" + + let detailsObj = jsonpath({ + path: + "$" + (currentView.viewKey == "myRepresentations" ? "" : "..value") + @@ -126,8 +127,9 @@ const ViewAllResults = (props) => { ? item.pinswg_name : item.pinswg_title) + '")]', - searchDetailsObj - ); + json: searchDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0]; //console.log(searchDetailsObj[key]); @@ -476,26 +478,30 @@ const ViewAllResults = (props) => { {currentView.viewKey == "awaitingSubmissionDetails" && _.has(resultsArr[key], "pinswg_lpaname") ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + resultsArr[key].pinswg_lpaname + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : resultsArr[key].pinswg_lpaname || "N/A" : ""} {_.has(resultsArr[key], [ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", ]) ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + resultsArr[key][ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : resultsArr[key][ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" @@ -504,14 +510,16 @@ const ViewAllResults = (props) => { "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue", ]) ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + searchDetailsObj[key].value[0][ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : currentView.viewKey == "myRepresentations" ? searchDetailsObj[key].value : searchDetailsObj[key].value[0][ @@ -522,14 +530,16 @@ const ViewAllResults = (props) => { "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue", ]) ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + resultsArr[key][ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : resultsArr[key][ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] || @@ -538,14 +548,16 @@ const ViewAllResults = (props) => { : "N/A") : currentView.viewKey == "myRepresentations" && router.locale == "cy" && - jsonpath( - '$..[?(@.value=="' + + jsonpath({ + path: + '$..[?(@.value=="' + searchDetailsObj[key][ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - )} + json: transLookup, + sandbox: {}, + })}

@@ -554,26 +566,30 @@ const ViewAllResults = (props) => { {currentView.viewKey == "awaitingSubmissionDetails" ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + getFormCollectionByID( item.pinswg_appealcasetype ).value + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : getFormCollectionByID( item.pinswg_appealcasetype ).value || "N/A" : router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || @@ -583,14 +599,16 @@ const ViewAllResults = (props) => { {currentView.viewKey == "myRepresentations" && (router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + getFormCollectionByID( searchDetailsObj[key].appealType ).value + '")].value_cy', - transLookup - )[0] + json: transLookup, + sandbox: {}, + })[0] : getFormCollectionByID( searchDetailsObj[key].appealType ).value)} @@ -609,21 +627,25 @@ const ViewAllResults = (props) => { {currentView.viewKey == "awaitingSubmissionDetails" ? router.locale == "cy" - ? jsonpath( - '$..[?(@.statuscode=="' + + ? jsonpath({ + path: + '$..[?(@.statuscode=="' + item.statuscode + '")].value_cy', - transLookup - ) - : jsonpath( - '$..[?(@.statuscode=="' + + json: transLookup, + sandbox: {}, + }) + : jsonpath({ + path: + '$..[?(@.statuscode=="' + item.statuscode + '")].value', - transLookup - ) || "N/A" + json: transLookup, + sandbox: {}, + }) || "N/A" : currentView.viewKey == "myRepresentations" ? repRaisedDate(item.repfile_name) // ? router.locale == "cy" - : // ? jsonpath( + : // ? jsonpath({path: // // '$..[?(@.value=="' + // searchDetailsObj[key].value[0][ @@ -635,7 +657,7 @@ const ViewAllResults = (props) => { // "statuscode@OData.Community.Display.V1.FormattedValue" // ] || "N/A" // : router.locale == "cy" - // ? jsonpath( + // ? jsonpath({path: // // '$..[?(@.value=="' + // item[ @@ -645,14 +667,16 @@ const ViewAllResults = (props) => { // ) router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || "N/A"} diff --git a/components/newappeal/buildcheckrow.js b/components/newappeal/buildcheckrow.js index 339da986..374080bc 100644 --- a/components/newappeal/buildcheckrow.js +++ b/components/newappeal/buildcheckrow.js @@ -63,11 +63,19 @@ let BuildCheckRow = (props) => { const { locale } = router; const { appealtypes } = router.query; - let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup); + let formObj = jsonpath({ + path: "$['" + appealtypes + "']", + json: fieldLookup, + sandbox: {}, + }); let labelTrans = router.locale == "cy" - ? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj) + ? jsonpath({ + path: '$..[?(@.value=="' + label + '")].value_cy', + json: formObj, + sandbox: {}, + }) : label; return labelTrans; }; @@ -93,12 +101,14 @@ let BuildCheckRow = (props) => { var rows = xpath.select("//label/@description", doc); var fieldtype = xpath.select("//@classid", doc); var datafieldname = xpath.select("//@datafieldname", doc); - const isRequiredField = jsonpath( - "$..value[?(@.LogicalName=='" + + const isRequiredField = jsonpath({ + path: + "$..value[?(@.LogicalName=='" + datafieldname[0].value + "')]", - mandatoryFieldsData - ); + json: mandatoryFieldsData, + sandbox: {}, + }); var documentTypeCode = xpath.select( "//@ishareDocumentCode", diff --git a/components/newappeal/buildchecksection.js b/components/newappeal/buildchecksection.js index ea5d2c9c..519f5c1e 100644 --- a/components/newappeal/buildchecksection.js +++ b/components/newappeal/buildchecksection.js @@ -127,11 +127,19 @@ let BuildCheckSection = (props) => { const { locale } = router; const { appealtypes } = router.query; - let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup); + let formObj = jsonpath({ + path: "$['" + appealtypes + "']", + json: fieldLookup, + sandbox: {}, + }); let labelTrans = router.locale == "cy" - ? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj) + ? jsonpath({ + path: '$..[?(@.value=="' + label + '")].value_cy', + json: formObj, + sandbox: {}, + }) : label; return labelTrans; }; diff --git a/components/newappeal/buildrow.js b/components/newappeal/buildrow.js index 1919a103..8150df40 100644 --- a/components/newappeal/buildrow.js +++ b/components/newappeal/buildrow.js @@ -110,7 +110,7 @@ export default function BuildRow(props) { dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value; - //const isRequiredField = jsonpath( + //const isRequiredField = jsonpath({path: // "$..value[?(@.LogicalName=='" + // datafieldname[0].value + // "')]", diff --git a/components/newappeal/createCase.js b/components/newappeal/createCase.js index 93d6be68..da9b9aee 100644 --- a/components/newappeal/createCase.js +++ b/components/newappeal/createCase.js @@ -65,12 +65,14 @@ const RenderLPAList = ({ value={optionsObj[key].accountid} > {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + optionsObj[key].name + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : optionsObj[key].name} ); @@ -147,12 +149,14 @@ const RenderAppealTypeList = ({ : _.isEmpty(optionsObj[key].value) ? "" : router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + optionsObj[key].value + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : optionsObj[key].value} ); diff --git a/components/pdftemplates/appealRow_pdf.js b/components/pdftemplates/appealRow_pdf.js index a4671f82..efb4e758 100644 --- a/components/pdftemplates/appealRow_pdf.js +++ b/components/pdftemplates/appealRow_pdf.js @@ -148,7 +148,11 @@ export const AppealRow_pdf = (props) => { const FieldsTranslations = (label) => { const { appealtypes } = router.query; - let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup); + let formObj = jsonpath({ + path: "$['" + appealtypes + "']", + json: fieldLookup, + sandbox: {}, + }); let labelTrans = label; return labelTrans; @@ -390,7 +394,7 @@ export const AppealRow_pdf = (props) => { ); break; case "{16D63FD6-119B-4353-BDCA-18358721C3FE}": - // const blobList = jsonpath( + // const blobList = jsonpath({path: // "$..[?(@.documentType=='" + // documentTypeCode[0].value + // "')]", diff --git a/components/search/addresssearchresults.js b/components/search/addresssearchresults.js index ae86a26f..30918cba 100644 --- a/components/search/addresssearchresults.js +++ b/components/search/addresssearchresults.js @@ -95,10 +95,14 @@ const SearchResults = (props) => { }; const isWatchedCase = (whichIncident) => { - let isWatched = jsonpath( - "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]", - watchedCases - ); + let isWatched = jsonpath({ + path: + "$..value[?(@._pinswg_watchedcase_value=='" + + whichIncident + + "')]", + json: watchedCases, + sandbox: {}, + }); return isWatched; }; @@ -241,12 +245,15 @@ const SearchResults = (props) => { ) : ( resultsArrPaged.map((item, key) => { - let detailsObj = jsonpath( - '$..value[?(@.pinswg_name=="' + + let detailsObj = jsonpath({ + path: + '$..value[?(@.pinswg_name=="' + item.pinswg_name + '")]', - searchDetailsObj - ); + + json: searchDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0]; return (
{ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue", ]) ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" @@ -469,14 +478,16 @@ const SearchResults = (props) => { "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", ]) ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" @@ -490,14 +501,16 @@ const SearchResults = (props) => { : {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "pinswg_appealType" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item["pinswg_appealType"] || "N/A"}
@@ -510,14 +523,16 @@ const SearchResults = (props) => { {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || "N/A"} diff --git a/components/search/advancedsearch.js b/components/search/advancedsearch.js index 546bcb80..3381984d 100644 --- a/components/search/advancedsearch.js +++ b/components/search/advancedsearch.js @@ -126,13 +126,15 @@ const RenderCaseStatusList = ({ : _.isEmpty(optionsObj[key].value) ? "" : router.locale == "cy" - ? jsonpath( - '$..[?(@.statuscode=="' + + ? jsonpath({ + path: + '$..[?(@.statuscode=="' + optionsObj[key] .statuscode + '")].value_cy', - optionsObj - ) + json: optionsObj, + sandbox: {}, + }) : optionsObj[key].value || t( "case:summary-no-date-entered-label" @@ -239,13 +241,15 @@ let AdvancedSearch = (props) => { {/* {optionsObj[key].name} */} {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + optionsObj[key] .name + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : optionsObj[key].name || t( "case:summary-no-date-entered-label" @@ -342,13 +346,15 @@ let AdvancedSearch = (props) => { ) ? "" : router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + optionsObj[key] .value + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : optionsObj[key].value || t( "case:summary-no-date-entered-label" diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index ed4cb11a..7feaedc2 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -168,10 +168,14 @@ const DNSSearchResults = (props) => { }; const isWatchedCase = (whichIncident) => { - let isWatched = jsonpath( - "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]", - watchedCases - ); + let isWatched = jsonpath({ + path: + "$..value[?(@._pinswg_watchedcase_value=='" + + whichIncident + + "')]", + json: watchedCases, + sandbox: {}, + }); return isWatched; }; @@ -293,12 +297,14 @@ const DNSSearchResults = (props) => { ) : ( resultsArr.map((item, key) => { - let detailsObj = jsonpath( - '$..value[?(@.pinswg_name=="' + + let detailsObj = jsonpath({ + path: + '$..value[?(@.pinswg_name=="' + item.title + '")]', - searchDetailsObj - ); + json: searchDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0]; return ( @@ -452,14 +458,16 @@ const DNSSearchResults = (props) => { "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", ]) ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + detailsObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : detailsObj[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" @@ -474,14 +482,16 @@ const DNSSearchResults = (props) => { {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || "N/A"} diff --git a/components/search/searchresults.js b/components/search/searchresults.js index fe0df954..0909da30 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -101,10 +101,15 @@ const SearchResults = (props) => { }; const isWatchedCase = (whichIncident) => { - let isWatched = jsonpath( - "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]", - watchedCases - ); + let isWatched = jsonpath({ + path: + "$..value[?(@._pinswg_watchedcase_value=='" + + whichIncident + + "')]", + + json: watchedCases, + sandbox: {}, + }); return isWatched; }; @@ -237,12 +242,14 @@ const SearchResults = (props) => { ) : ( resultsArr.map((item, key) => { - let detailsObj = jsonpath( - '$..value[?(@.pinswg_name=="' + + let detailsObj = jsonpath({ + path: + '$..value[?(@.pinswg_name=="' + item.title + '")]', - searchDetailsObj - ); + json: searchDetailsObj, + sandbox: {}, + }); detailsObj = detailsObj[0] || {}; return ( @@ -430,14 +437,16 @@ const SearchResults = (props) => { "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", ]) ? router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" ] || "N/A" @@ -451,14 +460,16 @@ const SearchResults = (props) => { : {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" ] || "N/A"} @@ -472,14 +483,16 @@ const SearchResults = (props) => { {router.locale == "cy" - ? jsonpath( - '$..[?(@.value=="' + + ? jsonpath({ + path: + '$..[?(@.value=="' + item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] + '")].value_cy', - transLookup - ) + json: transLookup, + sandbox: {}, + }) : item[ "statuscode@OData.Community.Display.V1.FormattedValue" ] || "N/A"} diff --git a/components/utils/index.js b/components/utils/index.js index f3d07bde..fb846316 100644 --- a/components/utils/index.js +++ b/components/utils/index.js @@ -17,52 +17,67 @@ import xpath from "xpath"; * @param String formtype - string from appeal entity name */ export const getFormCollection = (formtype) => { - const collectionName = jsonpath( - "$..[?(@.LogicalName=='" + formtype + "')]", - data - ); + const collectionName = jsonpath({ + path: "$..[?(@.LogicalName=='" + formtype + "')]", + json: data, + sandbox: {}, + }); return collectionName[0]; }; export const getFormCollectionByID = (appealTypeID) => { - const collectionName = jsonpath( - "$..[?(@.appealTypeID =='" + appealTypeID + "')]", - data - ); + const collectionName = jsonpath({ + path: "$..[?(@.appealTypeID =='" + appealTypeID + "')]", + json: data, + sandbox: {}, + }); return collectionName[0]; }; export const getFormIDByLogicalName = (appealTypeLogicalName) => { - const collectionName = jsonpath( - "$..[?(@.LogicalName =='" + appealTypeLogicalName + "')]", - data - ); + const collectionName = jsonpath({ + path: "$..[?(@.LogicalName =='" + appealTypeLogicalName + "')]", + json: data, + sandbox: {}, + }); return collectionName[0]; }; export const getPickListLabel = (data, picklistType, picklistID) => { - const pickListData = jsonpath( - "$..[?(@.LogicalName=='" + picklistType + "')]", - data - ); + const pickListData = jsonpath({ + path: "$..[?(@.LogicalName=='" + picklistType + "')]", + json: data, + sandbox: {}, + }); - const pickListLabel = jsonpath( - "$..[?(@.Value=='" + picklistID + "')].Label.LocalizedLabels..Label", - pickListData - ); + const pickListLabel = jsonpath({ + path: + "$..[?(@.Value=='" + + picklistID + + "')].Label.LocalizedLabels..Label", + + json: pickListData, + sandbox: {}, + }); return pickListLabel[0]; }; export const getRadioLabel = (data, radiotListName, radioListID) => { - const radioListData = jsonpath( - "$..[?(@.LogicalName=='" + radiotListName + "')]", - data - ); + const radioListData = jsonpath({ + path: "$..[?(@.LogicalName=='" + radiotListName + "')]", + json: data, + sandbox: {}, + }); - const pickListLabel = jsonpath( - "$..[?(@.Value=='" + radioListID + "')].Label.LocalizedLabels..Label", - radioListData - ); + const pickListLabel = jsonpath({ + path: + "$..[?(@.Value=='" + + radioListID + + "')].Label.LocalizedLabels..Label", + + json: radioListData, + sandbox: {}, + }); return pickListLabel[0]; }; @@ -319,12 +334,14 @@ export const getProgressObj = ( dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value; - const isRequiredField = jsonpath( - "$..value[?(@.LogicalName=='" + + const isRequiredField = jsonpath({ + path: + "$..value[?(@.LogicalName=='" + datafieldname[0].value + "')]", - mandatoryFieldsData - ); + json: mandatoryFieldsData, + sandbox: {}, + }); if (datafieldname[0].value.includes("pinswg_fileUpload")) { if (typeof isRequiredField[0] != "undefined") { diff --git a/package.json b/package.json index 25e7f5bd..42fe9764 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "govuk-frontend": "^5.0.0", "history": "^5.3.0", "jsonpath": "^1.1.1", - "jsonpath-plus": "^4.0.0", + "jsonpath-plus": "^10.3.0", "leaflet": "^1.9.4", "leaflet-defaulticon-compatibility": "^0.1.2", "lodash": "^4.17.21", @@ -104,4 +104,4 @@ "eslint-plugin-jsdoc": "^48.2.3", "prisma": "^5.0.0" } -} \ No newline at end of file +} diff --git a/pages/api/endpoint/getbasicsearch_by_address_api copy.js b/pages/api/endpoint/getbasicsearch_by_address_api copy.js index e1486ddf..2fdbab26 100644 --- a/pages/api/endpoint/getbasicsearch_by_address_api copy.js +++ b/pages/api/endpoint/getbasicsearch_by_address_api copy.js @@ -469,7 +469,11 @@ export default async function ApiProxy(req, res) { }) ); - searchResultsObj = jsonpath("$..[?(@ && @.pinswg_name)]", searchResultsObj); + searchResultsObj = jsonpath({ + path: "$..[?(@ && @.pinswg_name)]", + json: searchResultsObj, + sandbox: {}, + }); const getIncidentResultsObj = await Promise.all( searchResultsObj.map(async (key) => { diff --git a/pages/api/endpoint/getbasicsearch_by_address_api.js b/pages/api/endpoint/getbasicsearch_by_address_api.js index e2536d88..6489114f 100644 --- a/pages/api/endpoint/getbasicsearch_by_address_api.js +++ b/pages/api/endpoint/getbasicsearch_by_address_api.js @@ -561,7 +561,11 @@ export default async function ApiProxy(req, res) { }) ); - searchResultsObj = jsonpath("$..[?(@ && @.pinswg_name)]", searchResultsObj); + searchResultsObj = jsonpath({ + path: "$..[?(@ && @.pinswg_name)]", + json: searchResultsObj, + sandbox: {}, + }); searchResultsObj = searchResultsObj.filter((arr) => arr.incidentid != null); diff --git a/pages/api/endpoint/getmylpacases_api.js b/pages/api/endpoint/getmylpacases_api.js index ce7cbe79..92be0ce1 100644 --- a/pages/api/endpoint/getmylpacases_api.js +++ b/pages/api/endpoint/getmylpacases_api.js @@ -48,7 +48,11 @@ export default async function ApiProxy(req, res) { const lpaList = await getLPA(); - const lpaGUID = jsonpath('$..[?(@.name=="' + lpaid + '")]', lpaList); + const lpaGUID = jsonpath({ + path: '$..[?(@.name=="' + lpaid + '")]', + json: lpaList, + sandbox: {}, + }); //console.log( // '$..[?(@.name="' + lpaid + '")]', diff --git a/pages/myportal/[appealtypes].js b/pages/myportal/[appealtypes].js index c4975bb5..74d6d1ee 100644 --- a/pages/myportal/[appealtypes].js +++ b/pages/myportal/[appealtypes].js @@ -76,10 +76,11 @@ let Home = (props) => { let optionsStr = props.appealType.appealTypeOptions.value || {}; - let selectedObj = jsonpath( - "$..[?(@.attributevalue=='" + router.query.apt + "')]", - optionsStr - ); + let selectedObj = jsonpath({ + path: "$..[?(@.attributevalue=='" + router.query.apt + "')]", + json: optionsStr, + sandbox: {}, + }); //let optionsTitleObj = []; diff --git a/pages/newappeal/[appealtypes].js b/pages/newappeal/[appealtypes].js index 4c5945b0..e4be195a 100644 --- a/pages/newappeal/[appealtypes].js +++ b/pages/newappeal/[appealtypes].js @@ -68,10 +68,11 @@ let Home = (props) => { let optionsStr = props.appealType.appealTypeOptions.value; - let selectedObj = jsonpath( - "$..[?(@.attributevalue=='" + router.query.apt + "')]", - optionsStr - ); + let selectedObj = jsonpath({ + path: "$..[?(@.attributevalue=='" + router.query.apt + "')]", + json: optionsStr, + sandbox: {}, + }); //let optionsTitleObj = []; From 352f146952a21908b771762b26279b05ce4a93de Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 15 Apr 2025 12:59:44 +0100 Subject: [PATCH 2/2] tweak to add security headers --- middleware.js | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/middleware.js b/middleware.js index a07e56ce..afd4fc0b 100644 --- a/middleware.js +++ b/middleware.js @@ -40,7 +40,10 @@ export function middleware(request) { .trim(); const requestHeaders = new Headers(request.headers); + // Unique trusted nonce requestHeaders.set("x-nonce", nonce); + + // CSP policy requestHeaders.set( "Content-Security-Policy", contentSecurityPolicyHeaderValue @@ -56,24 +59,29 @@ export function middleware(request) { contentSecurityPolicyHeaderValue ); + // XSS protection (legacy) + response.headers.set("X-XSS-Protection", "1; mode=block"); + + // Prevent MIME type sniffing + response.headers.set("X-Content-Type-Options", "nosniff"); + + // Prevent iframe embedding + response.headers.set("X-Frame-Options", "DENY"); + + // Referrer policy + response.headers.set("Referrer-Policy", "strict-origin-when-cross-origin"); + + // Permissions lockdown + response.headers.set( + "Permissions-Policy", + "geolocation=(), camera=(), microphone=(), fullscreen=(self)" + ); + + // Enforce HTTPS via HSTS + response.headers.set( + "Strict-Transport-Security", + "max-age=63072000; includeSubDomains; preload" + ); + return response; } - -// export const config = { -// matcher: [ -// /* -// * Match all request paths except for the ones starting with: -// * - api (API routes) -// * - _next/static (static files) -// * - _next/image (image optimization files) -// * - favicon.ico (favicon file) -// */ -// { -// source: "/((?!api|_next/static|_next/image|favicon.ico).*)", -// missing: [ -// { type: "header", key: "next-router-prefetch" }, -// { type: "header", key: "purpose", value: "prefetch" }, -// ], -// }, -// ], -// };