diff --git a/components/account/registerComplete.js b/components/account/registerComplete.js
index a0c42acb..508d64f2 100644
--- a/components/account/registerComplete.js
+++ b/components/account/registerComplete.js
@@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import {
Field,
reduxForm,
diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js
index b09a0db4..3c9d11b6 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -1,5 +1,5 @@
import Link from "next/link";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import { useState } from "react";
import { useRouter } from "next/router";
@@ -20,9 +20,9 @@ const Breadcrumbs = (props) => {
if (_.isEmpty(courseContent)) {
return null;
} else {
- var sectionObj = jsonpath.query(
- courseContent,
- '$..sections[?(@.path=="/' + coursePageURL + '")]'
+ var sectionObj = jsonpath(
+ '$..sections[?(@.path=="/' + coursePageURL + '")]',
+ courseContent
);
var breadcrumb = sectionObj[0].chapter.title; //sectionObj[0].chapter
return (
diff --git a/components/case/documents.js b/components/case/documents.js
index 5ef38e8b..0fe3cb5c 100644
--- a/components/case/documents.js
+++ b/components/case/documents.js
@@ -1,4 +1,4 @@
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -73,9 +73,9 @@ const DocumentDetails = (props) => {
>
@@ -88,11 +88,11 @@ const DocumentDetails = (props) => {
}
>
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
item.pinswg_isharedocumentlocationsLabel +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: item.pinswg_isharedocumentlocationsLabel ||
t(
@@ -216,11 +216,11 @@ const DocumentDetails = (props) => {
) : (
documentDetailsArr.map((item, key) => {
- let detailsObj = jsonpath.query(
- item,
+ let detailsObj = jsonpath(
"$..[?(@._pinswg_documentids_value=='" +
incidentid +
- "')]"
+ "')]",
+ item
);
detailsObj = item;
return (
@@ -268,13 +268,13 @@ const DocumentDetails = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
diff --git a/components/case/representation/index.js b/components/case/representation/index.js
index eeaaac86..2303938d 100644
--- a/components/case/representation/index.js
+++ b/components/case/representation/index.js
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useState, useEffect } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath, { value } from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _, { property } from "lodash";
import {
Field,
@@ -85,13 +85,13 @@ let MakeRepresentation = (props) => {
: false;
currentType == "searchResultsObj"
- ? (casesObj = jsonpath.query(
- setCaseQueryObj,
- '$..[?(@.title=="' + caseReference + '")]'
+ ? (casesObj = jsonpath(
+ '$..[?(@.title=="' + caseReference + '")]',
+ setCaseQueryObj
))
- : (casesObj = jsonpath.query(
- setCaseQueryObj,
- '$..[?(@.reference=="' + caseReference + '")]'
+ : (casesObj = jsonpath(
+ '$..[?(@.reference=="' + caseReference + '")]',
+ setCaseQueryObj
));
casesObj = Object.assign({}, ...casesObj);
@@ -114,7 +114,7 @@ let MakeRepresentation = (props) => {
var detailsObj = {};
- detailsObj = jsonpath.query(
+ detailsObj = jsonpath(
setCaseDetailsObj,
'$..[?(@.pinswg_name=="' +
currentView.caseReference.currentReference +
@@ -497,9 +497,9 @@ let MakeRepresentation = (props) => {
var detailsObj = {};
- detailsObj = jsonpath.query(
- setCaseDetailsObj,
- '$..[?(@.pinswg_name=="' + caseReference + '")]'
+ detailsObj = jsonpath(
+ '$..[?(@.pinswg_name=="' + caseReference + '")]',
+ setCaseDetailsObj
);
detailsObj = detailsObj[0];
diff --git a/components/case/representation/representationDetails.js b/components/case/representation/representationDetails.js
index 5eaee068..51912d4d 100644
--- a/components/case/representation/representationDetails.js
+++ b/components/case/representation/representationDetails.js
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { Field, reduxForm } from "redux-form";
import { RenderPickList, RenderTextfield } from "./representationElements";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
const RepDetails = (props) => {
let { t } = useTranslation();
@@ -31,9 +31,9 @@ const RepDetails = (props) => {
: caseReference
: caseReference;
- detailsObj = jsonpath.query(
- setCaseDetailsObj,
- '$..[?(@.pinswg_name=="' + caseReference + '")]'
+ detailsObj = jsonpath(
+ '$..[?(@.pinswg_name=="' + caseReference + '")]',
+ setCaseDetailsObj
);
detailsObj = detailsObj[0];
diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js
index cc55e3b1..d532bc95 100644
--- a/components/case/representation/representationElements.js
+++ b/components/case/representation/representationElements.js
@@ -2,7 +2,7 @@ import { Field, Fields, reduxForm } from "redux-form";
import router from "next/router";
import React, { useState, useMemo } from "react";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import Dropzone, { useDropzone } from "react-dropzone";
import Link from "next/link";
import dynamic from "next/dynamic";
@@ -963,9 +963,9 @@ export const RenderFileUpload = (field) => {
const filelistObj = field.fileList || {};
- const blobList = jsonpath.query(
- filelistObj,
- "$..[?(@.documentType=='" + field.documentTypeCode + "')]"
+ const blobList = jsonpath(
+ "$..[?(@.documentType=='" + field.documentTypeCode + "')]",
+ filelistObj
);
const deleteThisBlob = async (
diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js
index 390bf040..2589851a 100644
--- a/components/case/representation/representationLPA.js
+++ b/components/case/representation/representationLPA.js
@@ -21,7 +21,7 @@ import {
} from "../../../store/currentView/action";
import { useDropzone } from "react-dropzone";
import { select } from "xpath";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { useState } from "react";
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
import S78_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78";
@@ -199,11 +199,11 @@ let RepLPA = (props) => {
var detailsObj = {};
- detailsObj = jsonpath.query(
- setCaseDetailsObj,
+ detailsObj = jsonpath(
'$..[?(@.pinswg_name=="' +
currentView.caseReference.currentReference +
- '")]'
+ '")]',
+ setCaseDetailsObj
);
let setCaseResultssObj = router.query.hasOwnProperty("state")
@@ -216,11 +216,11 @@ let RepLPA = (props) => {
var resultsObj = {};
- resultsObj = jsonpath.query(
- setCaseResultssObj,
+ resultsObj = jsonpath(
'$..[?(@.pinswg_name=="' +
currentView.caseReference.currentReference +
- '")]'
+ '")]',
+ setCaseResultssObj
);
resultsObj = resultsObj[0];
@@ -239,11 +239,11 @@ let RepLPA = (props) => {
: "Representation"}{" "}
{locale == "cy" ? "o ACLI am a" : "from an LPA for a"}{" "}
{locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.attributevalue=="' +
currentView.caseReference.appealType +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: getFormCollectionByID(
currentView.caseReference.appealType
diff --git a/components/case/representation/representationLPADetails.js b/components/case/representation/representationLPADetails.js
index dbfbf3e0..0deb0581 100644
--- a/components/case/representation/representationLPADetails.js
+++ b/components/case/representation/representationLPADetails.js
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { Field, reduxForm } from "redux-form";
import { RenderPickList, RenderTextfield } from "./representationElements";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
const RepLPADetails = (props) => {
let { t } = useTranslation();
@@ -23,9 +23,9 @@ const RepLPADetails = (props) => {
var detailsObj = {};
- detailsObj = jsonpath.query(
- setCaseDetailsObj,
- '$..[?(@.pinswg_name=="' + caseReference + '")]'
+ detailsObj = jsonpath(
+ '$..[?(@.pinswg_name=="' + caseReference + '")]',
+ setCaseDetailsObj
);
detailsObj = detailsObj[0];
diff --git a/components/case/representation/representationProgress/representationProgress_enforcement.js b/components/case/representation/representationProgress/representationProgress_enforcement.js
index bc9d7f8f..8dbc0dc3 100644
--- a/components/case/representation/representationProgress/representationProgress_enforcement.js
+++ b/components/case/representation/representationProgress/representationProgress_enforcement.js
@@ -20,7 +20,7 @@ import {
} from "../../../../store/currentView/action";
import { useDropzone } from "react-dropzone";
import { select } from "xpath";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
const RepresentationProgress_enforcement = (props) => {
let { t } = useTranslation();
diff --git a/components/case/representation/representationProgress/representationProgress_s78.js b/components/case/representation/representationProgress/representationProgress_s78.js
index 9ecd4fbb..53d72f05 100644
--- a/components/case/representation/representationProgress/representationProgress_s78.js
+++ b/components/case/representation/representationProgress/representationProgress_s78.js
@@ -20,7 +20,7 @@ import {
} from "../../../../store/currentView/action";
import { useDropzone } from "react-dropzone";
import { select } from "xpath";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
const RepresentationProgress_s78 = (props) => {
let { t } = useTranslation();
diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
index 646b1a3e..7a45f855 100644
--- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
+++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js
@@ -20,7 +20,7 @@ import {
} from "../../../../store/currentView/action";
import { useDropzone } from "react-dropzone";
import { select } from "xpath";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
let Enforcement_Questionnaire = (props) => {
let { t } = useTranslation();
@@ -53,11 +53,11 @@ let Enforcement_Questionnaire = (props) => {
var detailsObj = {};
- detailsObj = jsonpath.query(
- setCaseDetailsObj,
+ detailsObj = jsonpath(
'$..[?(@.pinswg_name=="' +
currentView.caseReference.currentReference +
- '")]'
+ '")]',
+ setCaseDetailsObj
);
let setCaseResultssObj = router.query.hasOwnProperty("state")
@@ -70,11 +70,11 @@ let Enforcement_Questionnaire = (props) => {
var resultsObj = {};
- resultsObj = jsonpath.query(
- setCaseResultssObj,
+ resultsObj = jsonpath(
'$..[?(@.ticketnumber=="' +
currentView.caseReference.currentReference +
- '")]'
+ '")]',
+ setCaseResultssObj
);
resultsObj = resultsObj[0];
diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
index 5270dce2..a4c8fdd6 100644
--- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
+++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js
@@ -20,7 +20,7 @@ import {
} from "../../../../store/currentView/action";
import { useDropzone } from "react-dropzone";
import { select } from "xpath";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { getFormCollectionByID } from "../../../../components/utils";
let S78_Questionnaire = (props) => {
@@ -56,11 +56,11 @@ let S78_Questionnaire = (props) => {
var detailsObj = {};
- detailsObj = jsonpath.query(
- setCaseDetailsObj,
+ detailsObj = jsonpath(
'$..[?(@.pinswg_name=="' +
currentView.caseReference.currentReference +
- '")]'
+ '")]',
+ setCaseDetailsObj
);
let setCaseResultssObj = router.query.hasOwnProperty("state")
@@ -73,8 +73,7 @@ let S78_Questionnaire = (props) => {
var resultsObj = {};
- resultsObj = jsonpath.query(
- setCaseResultssObj,
+ resultsObj = jsonpath(
"$..[?(@." +
(router.query.hasOwnProperty("state")
? router.query.state == "edit"
@@ -83,7 +82,8 @@ let S78_Questionnaire = (props) => {
: "ticketnumber") +
'=="' +
currentView.caseReference.currentReference +
- '")]'
+ '")]',
+ setCaseResultssObj
);
resultsObj = resultsObj[0];
diff --git a/components/case/representationList.js b/components/case/representationList.js
index 2059054e..16092d7f 100644
--- a/components/case/representationList.js
+++ b/components/case/representationList.js
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import { useState, useEffect, useRef } from "react";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
@@ -61,11 +61,11 @@ const RepresentationList = (props) => {
{representationsArr.map((item, key) => {
- let detailsObj = jsonpath.query(
- item,
+ let detailsObj = jsonpath(
"$..[?(@.pinswg_representationsid=='" +
incidentid +
- "')]"
+ "')]",
+ item
);
detailsObj = item;
@@ -91,13 +91,13 @@ const RepresentationList = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
diff --git a/components/case/summary.js b/components/case/summary.js
index d2f54962..6a5b3550 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import { useState, useEffect, useRef } from "react";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
@@ -137,9 +137,9 @@ const CaseSummary = (props) => {
};
const isWatchedCase = (whichIncident) => {
- let isWatched = jsonpath.query(
- watchedCases,
- "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]"
+ let isWatched = jsonpath(
+ "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]",
+ watchedCases
);
return isWatched;
@@ -168,23 +168,23 @@ const CaseSummary = (props) => {
var casesObj = {};
currentType == "searchResultsObj"
- ? (casesObj = jsonpath.query(
- searchResultsObj,
- '$..[?(@.title=="' + caseReference + '")]'
+ ? (casesObj = jsonpath(
+ '$..[?(@.title=="' + caseReference + '")]',
+ searchResultsObj
))
: currentType == "watchedCases"
- ? (casesObj = jsonpath.query(
- setCaseQueryObj,
- '$..[?(@.pinswg_title=="' + caseReference + '")]'
+ ? (casesObj = jsonpath(
+ '$..[?(@.pinswg_title=="' + caseReference + '")]',
+ setCaseQueryObj
))
: currentType == "myCases"
- ? (casesObj = jsonpath.query(
- setCaseQueryObj,
- '$..[?(@.pinswg_title=="' + caseReference + '")]'
+ ? (casesObj = jsonpath(
+ '$..[?(@.pinswg_title=="' + caseReference + '")]',
+ setCaseQueryObj
))
- : (casesObj = jsonpath.query(
- setCaseQueryObj,
- '$..[?(@.reference=="' + caseReference + '")]'
+ : (casesObj = jsonpath(
+ '$..[?(@.reference=="' + caseReference + '")]',
+ setCaseQueryObj
));
casesObj = Object.assign({}, ...casesObj);
@@ -192,13 +192,13 @@ const CaseSummary = (props) => {
var detailsObj = {};
currentType == "searchResultsObj"
- ? (detailsObj = jsonpath.query(
- searchDetailsObj,
- '$..[?(@.pinswg_name=="' + caseReference + '")]'
+ ? (detailsObj = jsonpath(
+ '$..[?(@.pinswg_name=="' + caseReference + '")]',
+ searchDetailsObj
))
- : (detailsObj = jsonpath.query(
- setCaseDetailsObj,
- '$..[?(@.pinswg_name=="' + caseReference + '")]'
+ : (detailsObj = jsonpath(
+ '$..[?(@.pinswg_name=="' + caseReference + '")]',
+ setCaseDetailsObj
));
detailsObj = detailsObj[0];
@@ -366,7 +366,7 @@ const CaseSummary = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
+ ? jsonpath(
transLookup,
'$..[?(@.value=="' +
detailsObj[
diff --git a/components/case/summaryTypes/pinswg_advertsid.js b/components/case/summaryTypes/pinswg_advertsid.js
index 926dc9a6..2c83515e 100644
--- a/components/case/summaryTypes/pinswg_advertsid.js
+++ b/components/case/summaryTypes/pinswg_advertsid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_advertsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 01ce3709..0c491a96 100644
--- a/components/case/summaryTypes/pinswg_callinss77id.js
+++ b/components/case/summaryTypes/pinswg_callinss77id.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_callinss77id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 148fd790..a4bfb24b 100644
--- a/components/case/summaryTypes/pinswg_commonlandid.js
+++ b/components/case/summaryTypes/pinswg_commonlandid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -217,17 +217,17 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value'
+ '")].value',
+ transLookup
) ||
t(
"case:summary-no-date-entered-label"
diff --git a/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js b/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js
index 7ac431f8..773fe4f6 100644
--- a/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js
+++ b/components/case/summaryTypes/pinswg_communityinfrastructurelevyid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 86357cbf..5c76f681 100644
--- a/components/case/summaryTypes/pinswg_compulsorypurchaseordersid.js
+++ b/components/case/summaryTypes/pinswg_compulsorypurchaseordersid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -65,13 +65,13 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -84,13 +84,13 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -103,13 +103,13 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -125,13 +125,13 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -199,17 +199,17 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value'
+ '")].value',
+ transLookup
) ||
t(
"case:summary-no-date-entered-label"
diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js
index 1e7a5d38..4e173999 100644
--- a/components/case/summaryTypes/pinswg_dnsid.js
+++ b/components/case/summaryTypes/pinswg_dnsid.js
@@ -3,7 +3,7 @@ import Head from "next/head";
import { useEffect, useRef, ReactElement } from "react";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _, { round } from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -125,13 +125,13 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -151,11 +151,11 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: (
{
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -206,13 +206,13 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
@@ -228,13 +228,13 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
+
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -267,13 +267,13 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -334,13 +334,13 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -433,11 +433,12 @@ const Pinswg_dnsid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_recommendation +
- '")].value_cy'
+ '")].value_cy',
+ transLookup,
+
)
: detailsObj.pinswg_recommendation}
diff --git a/components/case/summaryTypes/pinswg_electricityactid.js b/components/case/summaryTypes/pinswg_electricityactid.js
index c11fd219..fd0ca0f6 100644
--- a/components/case/summaryTypes/pinswg_electricityactid.js
+++ b/components/case/summaryTypes/pinswg_electricityactid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -65,13 +65,13 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -87,13 +87,13 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -123,13 +123,13 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -144,13 +144,13 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -163,13 +163,13 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -185,13 +185,13 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -259,11 +259,11 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_recommendation +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj.pinswg_recommendation ||
t(
@@ -280,11 +280,11 @@ const Pinswg_electricityactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj.pinswg_webaddress ||
t(
diff --git a/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js b/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js
index 9dcc726c..64fc7073 100644
--- a/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js
+++ b/components/case/summaryTypes/pinswg_enforcementlistedbuildingconseid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 5d18f2e9..8238756f 100644
--- a/components/case/summaryTypes/pinswg_enforcementnoticeappeals174id.js
+++ b/components/case/summaryTypes/pinswg_enforcementnoticeappeals174id.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 49c27e26..408f0bbd 100644
--- a/components/case/summaryTypes/pinswg_environmentalpermittingid.js
+++ b/components/case/summaryTypes/pinswg_environmentalpermittingid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -217,17 +217,17 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value'
+ '")].value',
+ transLookup
) ||
t(
"case:summary-no-date-entered-label"
diff --git a/components/case/summaryTypes/pinswg_harbourrevisionorderid.js b/components/case/summaryTypes/pinswg_harbourrevisionorderid.js
index 3e963283..e93df561 100644
--- a/components/case/summaryTypes/pinswg_harbourrevisionorderid.js
+++ b/components/case/summaryTypes/pinswg_harbourrevisionorderid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -65,13 +65,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -87,13 +87,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -123,13 +123,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -142,13 +142,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -164,13 +164,13 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -238,11 +238,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_recommendation +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj.pinswg_recommendation ||
t(
@@ -259,11 +259,11 @@ const Pinswg_harbourrevisionorderid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj.pinswg_webaddress ||
t(
diff --git a/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js b/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js
index d677f870..9cd41081 100644
--- a/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js
+++ b/components/case/summaryTypes/pinswg_hedgeshedgerowstreepreservatioid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -217,17 +217,17 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value'
+ '")].value',
+ transLookup
) ||
t(
"case:summary-no-date-entered-label"
diff --git a/components/case/summaryTypes/pinswg_householderappealhasid.js b/components/case/summaryTypes/pinswg_householderappealhasid.js
index cc9648b3..c8ee4ddc 100644
--- a/components/case/summaryTypes/pinswg_householderappealhasid.js
+++ b/components/case/summaryTypes/pinswg_householderappealhasid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -124,13 +124,13 @@ const Pinswg_householderappealhasid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 cbdfd2d3..9faa8bb5 100644
--- a/components/case/summaryTypes/pinswg_lawfuldevelopmentcertificatappid.js
+++ b/components/case/summaryTypes/pinswg_lawfuldevelopmentcertificatappid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 6deacc72..c3441441 100644
--- a/components/case/summaryTypes/pinswg_ldpid.js
+++ b/components/case/summaryTypes/pinswg_ldpid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_ldpid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 aa109969..50340bfb 100644
--- a/components/case/summaryTypes/pinswg_listedbuildingandconservationrid.js
+++ b/components/case/summaryTypes/pinswg_listedbuildingandconservationrid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 8a7ab195..659646de 100644
--- a/components/case/summaryTypes/pinswg_maintenanceoflands217id.js
+++ b/components/case/summaryTypes/pinswg_maintenanceoflands217id.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_maintenanceoflands217id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 a53adc98..eb2fc2bf 100644
--- a/components/case/summaryTypes/pinswg_miscellaneouscasewordid.js
+++ b/components/case/summaryTypes/pinswg_miscellaneouscasewordid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -217,17 +217,17 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value'
+ '")].value',
+ transLookup
) ||
t(
"case:summary-no-date-entered-label"
diff --git a/components/case/summaryTypes/pinswg_nonvalidationid.js b/components/case/summaryTypes/pinswg_nonvalidationid.js
index 84d515af..c7381cec 100644
--- a/components/case/summaryTypes/pinswg_nonvalidationid.js
+++ b/components/case/summaryTypes/pinswg_nonvalidationid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -124,13 +124,13 @@ const Pinswg_nonvalidationid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 2cd68fcb..72e62146 100644
--- a/components/case/summaryTypes/pinswg_planningappeals78id.js
+++ b/components/case/summaryTypes/pinswg_planningappeals78id.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_planningappeals78id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 e1b3f4cd..fbf0d703 100644
--- a/components/case/summaryTypes/pinswg_planningconditionss73s79id.js
+++ b/components/case/summaryTypes/pinswg_planningconditionss73s79id.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_planningconditionss73s79id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 d5f43f6a..b2db53c9 100644
--- a/components/case/summaryTypes/pinswg_planningobligationappeals106id.js
+++ b/components/case/summaryTypes/pinswg_planningobligationappeals106id.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_planningobligationappeals106id = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 80cbbea1..4ef0e34f 100644
--- a/components/case/summaryTypes/pinswg_rowid.js
+++ b/components/case/summaryTypes/pinswg_rowid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -217,17 +217,17 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value'
+ '")].value',
+ transLookup
) ||
t(
"case:summary-no-date-entered-label"
diff --git a/components/case/summaryTypes/pinswg_transportandworkactid.js b/components/case/summaryTypes/pinswg_transportandworkactid.js
index 0f38e6e1..1f2c1e72 100644
--- a/components/case/summaryTypes/pinswg_transportandworkactid.js
+++ b/components/case/summaryTypes/pinswg_transportandworkactid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -65,13 +65,13 @@ const Pinswg_transportandworkactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -90,11 +90,11 @@ const Pinswg_transportandworkactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_recommendation +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj.pinswg_recommendation ||
t(
@@ -111,11 +111,11 @@ const Pinswg_transportandworkactid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj.pinswg_webaddress +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj.pinswg_webaddress ||
t(
diff --git a/components/case/summaryTypes/pinswg_wayleaveid.js b/components/case/summaryTypes/pinswg_wayleaveid.js
index bc29d184..98c1bdb4 100644
--- a/components/case/summaryTypes/pinswg_wayleaveid.js
+++ b/components/case/summaryTypes/pinswg_wayleaveid.js
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
@@ -27,13 +27,13 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -49,13 +49,13 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -83,13 +83,13 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
@@ -102,13 +102,13 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
@@ -121,13 +121,13 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: casesObj[
"statuscode@OData.Community.Display.V1.FormattedValue"
@@ -143,13 +143,13 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
@@ -217,17 +217,17 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
- '")].value'
+ '")].value',
+ transLookup
) ||
t(
"case:summary-no-date-entered-label"
diff --git a/components/elements/index.js b/components/elements/index.js
index 2e77c966..4c05952c 100644
--- a/components/elements/index.js
+++ b/components/elements/index.js
@@ -4,7 +4,7 @@ import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import "react-datepicker/dist/react-datepicker.css";
import moment from "moment";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
import pickListLookup from "../../data/picklistLookups.json";
import useTranslation from "next-translate/useTranslation";
@@ -1157,9 +1157,9 @@ const RenderPickList = ({
}) => {
let { t } = useTranslation();
- var dropdownObj = jsonpath.query(
- picklistData,
- "$..value[?(@.LogicalName=='" + datafieldname + "')]..Options"
+ var dropdownObj = jsonpath(
+ "$..value[?(@.LogicalName=='" + datafieldname + "')]..Options",
+ picklistData
);
dropdownObj = dropdownObj[0];
return (
@@ -1379,14 +1379,11 @@ export const FieldsTranslations = (label) => {
const { locale } = router;
const { appealtypes } = router.query;
- let formObj = jsonpath.query(fieldLookup, "$['" + appealtypes + "']");
+ let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
let labelTrans =
router.locale == "cy"
- ? jsonpath.query(
- formObj,
- "$..[?(@.value=='" + label + "')].value_cy"
- )
+ ? jsonpath("$..[?(@.value=='" + label + "')].value_cy", formObj)
: label;
return labelTrans;
};
@@ -1398,9 +1395,9 @@ const PickListTranslations = (optionValue) => {
//console.log(optionValue);
let optionTrans =
router.locale == "cy"
- ? jsonpath.query(
- pickListLookup,
- '$..[?(@.value=="' + optionValue + '")].value_cy'
+ ? jsonpath(
+ '$..[?(@.value=="' + optionValue + '")].value_cy',
+ pickListLookup
)
: optionValue;
//console.log(optionTrans, optionValue);
@@ -1573,9 +1570,9 @@ const RenderFileUpload = (field) => {
const filelistObj = field.fileList || {};
- const blobList = jsonpath.query(
- filelistObj,
- "$..[?(@.documentType=='" + field.documentTypeCode + "')]"
+ const blobList = jsonpath(
+ "$..[?(@.documentType=='" + field.documentTypeCode + "')]",
+ filelistObj
);
const deleteThisBlob = async (
diff --git a/components/myportal/advancedsearch.js b/components/myportal/advancedsearch.js
index 49c57496..e49a3b0d 100644
--- a/components/myportal/advancedsearch.js
+++ b/components/myportal/advancedsearch.js
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import data from "../../data/collections.json";
import transLookup from "../../data/lookuptranslations.json";
@@ -149,12 +149,12 @@ let AdvancedSearch = (props) => {
{/* {optionsObj[key].name} */}
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
optionsObj[key]
.name +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: optionsObj[key].name ||
t(
@@ -179,96 +179,98 @@ let AdvancedSearch = (props) => {
label,
errormsg,
}) => {
- return <>
-
-
- {touched && error && (
-
-
- Error:
- {" "}
- {errormsg}
-
- )}
-
-
- >;
+ >
+ );
};
// const [showSpinnerState, setShowSpinnerState] = useState(false);
diff --git a/components/myportal/awaitingsubmissionfromblob.js b/components/myportal/awaitingsubmissionfromblob.js
index 1f0e52d7..afc93001 100644
--- a/components/myportal/awaitingsubmissionfromblob.js
+++ b/components/myportal/awaitingsubmissionfromblob.js
@@ -7,7 +7,7 @@ import {
setCurrentView,
setCurrentReference,
} from "../../store/currentView/action";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../../data/lookuptranslations.json";
import {
deleteAwaitingSubmissionsFromBlob,
@@ -168,11 +168,11 @@ const AwaitingSubmissionFromBlob = (props) => {
)}
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
showTopThreeArrDets[key]["pinswg_lpaname"] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: showTopThreeArrDets[key]["pinswg_lpaname"] || ""}
diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js
index 70e6d9c5..e3ce7246 100644
--- a/components/myportal/topthree.js
+++ b/components/myportal/topthree.js
@@ -12,7 +12,7 @@ import {
deleteAwaitingSubmissions,
getAwaitingSubmissionProxy,
} from "../../actions";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../../data/lookuptranslations.json";
import {
setWatchedCases,
@@ -283,13 +283,13 @@ const TopThree = (props) => {
)}
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
showTopThreeArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: 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 70ed771f..020423eb 100644
--- a/components/myportal/topthree_reps.js
+++ b/components/myportal/topthree_reps.js
@@ -20,7 +20,7 @@ import {
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import { getFormCollectionByID } from "../utils";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../../data/lookuptranslations.json";
const TopThree = (props) => {
@@ -204,13 +204,13 @@ const TopThree = (props) => {
{" "}
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
showTopThreeArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: showTopThreeArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js
index d082b91c..c6f98cc5 100644
--- a/components/myportal/viewall.js
+++ b/components/myportal/viewall.js
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { setCurrentReference } from "../../store/currentView/action";
import { connect } from "react-redux";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../../data/lookuptranslations.json";
import { getFormCollectionByID } from "../../components/utils";
@@ -47,9 +47,9 @@ const ViewAllResults = (props) => {
let resultsRowArr = [];
resultsArr.map((item, key) => {
- let detailsObj = jsonpath.query(
- searchDetailsObj,
- '$..value[?(@.pinswg_name=="' + item.pinswg_title + '")]'
+ let detailsObj = jsonpath(
+ '$..value[?(@.pinswg_name=="' + item.pinswg_title + '")]',
+ searchDetailsObj
);
detailsObj = detailsObj[0];
@@ -297,11 +297,11 @@ const ViewAllResults = (props) => {
{currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(resultsArr[key], "pinswg_lpaname")
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
resultsArr[key].pinswg_lpaname +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: resultsArr[key].pinswg_lpaname || "N/A"
: ""}
@@ -309,13 +309,13 @@ const ViewAllResults = (props) => {
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
resultsArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: resultsArr[key][
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -325,13 +325,13 @@ const ViewAllResults = (props) => {
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: currentView.viewKey == "myRepresentations"
? searchDetailsObj[key].value
@@ -343,13 +343,13 @@ const ViewAllResults = (props) => {
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
resultsArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: resultsArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
@@ -359,13 +359,13 @@ const ViewAllResults = (props) => {
: "N/A")
: currentView.viewKey == "myRepresentations" &&
router.locale == "cy" &&
- jsonpath.query(
- transLookup,
+ jsonpath(
'$..[?(@.value=="' +
searchDetailsObj[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)}
@@ -375,24 +375,24 @@ const ViewAllResults = (props) => {
{currentView.viewKey == "awaitingSubmissionDetails"
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
getFormCollectionByID(
item.pinswg_appealcasetype
).value +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: getFormCollectionByID(item.pinswg_appealcasetype)
.value || "N/A"
: router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -403,13 +403,13 @@ const ViewAllResults = (props) => {
{currentView.viewKey == "myRepresentations" &&
(router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
getFormCollectionByID(
searchDetailsObj[key].appealType
).value +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)[0]
: getFormCollectionByID(
searchDetailsObj[key].appealType
@@ -429,39 +429,39 @@ const ViewAllResults = (props) => {
{currentView.viewKey == "awaitingSubmissionDetails"
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.statuscode=="' +
item.statuscode +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
- : jsonpath.query(
- transLookup,
+ : jsonpath(
'$..[?(@.statuscode=="' +
item.statuscode +
- '")].value'
+ '")].value',
+ transLookup
) || "N/A"
: currentView.viewKey == "myRepresentations"
? repRaisedDate(item.createdDate) // ? router.locale == "cy"
- : // ? jsonpath.query(
- // transLookup,
+ : // ? jsonpath(
+ //
// '$..[?(@.value=="' +
// searchDetailsObj[key].value[0][
// "statuscode@OData.Community.Display.V1.FormattedValue"
// ] +
- // '")].value_cy'
+ // '")].value_cy',transLookup,
// )
// : searchDetailsObj[key].value[0][
// "statuscode@OData.Community.Display.V1.FormattedValue"
// ] || "N/A"
// : router.locale == "cy"
- // ? jsonpath.query(
- // transLookup,
+ // ? jsonpath(
+ //
// '$..[?(@.value=="' +
// item[
// "statuscode@OData.Community.Display.V1.FormattedValue"
// ] +
- // '")].value_cy'
+ // '")].value_cy',transLookup,
// )
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
diff --git a/components/newappeal/buildcheckrow.js b/components/newappeal/buildcheckrow.js
index 41723f6d..87f92555 100644
--- a/components/newappeal/buildcheckrow.js
+++ b/components/newappeal/buildcheckrow.js
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import xpath from "xpath";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import BuildCheckField from "./buildCheckfield";
import { useSelector, shallowEqual, connect } from "react-redux";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
@@ -63,14 +63,11 @@ let BuildCheckRow = (props) => {
const { locale } = router;
const { appealtypes } = router.query;
- let formObj = jsonpath.query(fieldLookup, "$['" + appealtypes + "']");
+ let formObj = jsonpath(fieldLookup, "$['" + appealtypes + "']");
let labelTrans =
router.locale == "cy"
- ? jsonpath.query(
- formObj,
- "$..[?(@.value=='" + label + "')].value_cy"
- )
+ ? jsonpath("$..[?(@.value=='" + label + "')].value_cy", formObj)
: label;
return labelTrans;
};
@@ -88,11 +85,11 @@ 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.query(
- mandatoryFieldsData,
+ const isRequiredField = jsonpath(
"$..value[?(@.LogicalName=='" +
datafieldname[0].value +
- "')]"
+ "')]",
+ mandatoryFieldsData
);
// if (datafieldname[0].value.indexOf("fileUpload") > 0) {
diff --git a/components/newappeal/buildprogress.js b/components/newappeal/buildprogress.js
index 10e60be6..5732b2d8 100644
--- a/components/newappeal/buildprogress.js
+++ b/components/newappeal/buildprogress.js
@@ -1,4 +1,4 @@
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
diff --git a/components/newappeal/buildrow.js b/components/newappeal/buildrow.js
index 71a11819..bc55c284 100644
--- a/components/newappeal/buildrow.js
+++ b/components/newappeal/buildrow.js
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import xpath from "xpath";
import BuildField from "./buildfield";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import FileUpload from "./fileupload";
export default function BuildRow(props) {
@@ -104,11 +104,11 @@ export default function BuildRow(props) {
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
- const isRequiredField = jsonpath.query(
- mandatoryFieldsData,
+ const isRequiredField = jsonpath(
"$..value[?(@.LogicalName=='" +
datafieldname[0].value +
- "')]"
+ "')]",
+ mandatoryFieldsData
);
if (datafieldname[0].value == "pinswg_fileUpload") {
diff --git a/components/newappeal/buildsection.js b/components/newappeal/buildsection.js
index c6c15de4..a182b897 100644
--- a/components/newappeal/buildsection.js
+++ b/components/newappeal/buildsection.js
@@ -24,7 +24,7 @@ import {
} from "../../actions";
import { FieldsTranslations } from "../elements";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import BuildProgress from "./buildprogress";
let BuildSection = (props) => {
diff --git a/components/newappeal/createCase.js b/components/newappeal/createCase.js
index 9ea60bbd..669ad80b 100644
--- a/components/newappeal/createCase.js
+++ b/components/newappeal/createCase.js
@@ -1,4 +1,4 @@
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
@@ -101,12 +101,12 @@ let CreateCase = (props) => {
value={optionsObj[key].accountid}
>
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
optionsObj[key]
.name +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: optionsObj[key].name}
@@ -192,12 +192,12 @@ let CreateCase = (props) => {
)
? ""
: router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
optionsObj[key]
.value +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: optionsObj[key].value}
diff --git a/components/newappeal/fileupload.js b/components/newappeal/fileupload.js
index e7eb09e8..7bb09a62 100644
--- a/components/newappeal/fileupload.js
+++ b/components/newappeal/fileupload.js
@@ -3,7 +3,7 @@
// import { useState, useEffect } from "react";
// import { useRouter } from "next/router";
// import useTranslation from "next-translate/useTranslation";
-// import jsonpath from "jsonpath";
+// import { JSONPath as jsonpath } from "jsonpath-plus";
// import _ from "lodash";
// const FileUpload = () => {
diff --git a/components/pdftemplates/appealRow_pdf.js b/components/pdftemplates/appealRow_pdf.js
index 68e134c8..49b46e02 100644
--- a/components/pdftemplates/appealRow_pdf.js
+++ b/components/pdftemplates/appealRow_pdf.js
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import xpath from "xpath";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { useSelector, shallowEqual, connect } from "react-redux";
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
import {
@@ -145,7 +145,7 @@ export const AppealRow_pdf = (props) => {
const FieldsTranslations = (label) => {
const { appealtypes } = router.query;
- let formObj = jsonpath.query(fieldLookup, "$['" + appealtypes + "']");
+ let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
let labelTrans = label;
return labelTrans;
@@ -371,11 +371,11 @@ export const AppealRow_pdf = (props) => {
);
break;
case "{16D63FD6-119B-4353-BDCA-18358721C3FE}":
- const blobList = jsonpath.query(
- props.filesList,
+ const blobList = jsonpath(
"$..[?(@.documentType=='" +
documentTypeCode[0].value +
- "')]"
+ "')]",
+ props.filesList
);
return (
{
let jsonQuery = `$.${key}`;
diff --git a/components/search/advancedsearch.js b/components/search/advancedsearch.js
index f746bc0c..e6eacd30 100644
--- a/components/search/advancedsearch.js
+++ b/components/search/advancedsearch.js
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import data from "../../data/collections.json";
import transLookup from "../../data/lookuptranslations.json";
@@ -132,12 +132,12 @@ const RenderCaseStatusList = ({
: _.isEmpty(optionsObj[key].value)
? ""
: router.locale == "cy"
- ? jsonpath.query(
- optionsObj,
+ ? jsonpath(
'$..[?(@.statuscode=="' +
optionsObj[key]
.statuscode +
- '")].value_cy'
+ '")].value_cy',
+ optionsObj
)
: optionsObj[key].value ||
t(
@@ -245,12 +245,12 @@ let AdvancedSearch = (props) => {
{/* {optionsObj[key].name} */}
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
optionsObj[key]
.name +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: optionsObj[key].name ||
t(
@@ -275,96 +275,98 @@ let AdvancedSearch = (props) => {
label,
errormsg,
}) => {
- return <>
-
-
- {touched && error && (
-
-
- Error:
- {" "}
- {errormsg}
-
- )}
-
-
- >;
+ >
+ );
};
// const [showSpinnerState, setShowSpinnerState] = useState(false);
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js
index bfefb804..4d09d69f 100644
--- a/components/search/dnssearchresults.js
+++ b/components/search/dnssearchresults.js
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
@@ -174,9 +174,9 @@ const DNSSearchResults = (props) => {
};
const isWatchedCase = (whichIncident) => {
- let isWatched = jsonpath.query(
- watchedCases,
- "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]"
+ let isWatched = jsonpath(
+ "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]",
+ watchedCases
);
return isWatched;
@@ -330,11 +330,11 @@ const DNSSearchResults = (props) => {
) : (
resultsArr.map((item, key) => {
- let detailsObj = jsonpath.query(
- searchDetailsObj,
+ let detailsObj = jsonpath(
'$..value[?(@.pinswg_name=="' +
item.title +
- '")]'
+ '")]',
+ searchDetailsObj
);
detailsObj = detailsObj[0];
@@ -487,13 +487,13 @@ const DNSSearchResults = (props) => {
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: detailsObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -509,13 +509,13 @@ const DNSSearchResults = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
diff --git a/components/search/searchresults.js b/components/search/searchresults.js
index b1fb477d..92afa10f 100644
--- a/components/search/searchresults.js
+++ b/components/search/searchresults.js
@@ -7,7 +7,7 @@ import {
setCurrentPage,
} from "../../store/currentView/action";
import { connect } from "react-redux";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
import {
@@ -108,9 +108,9 @@ const SearchResults = (props) => {
};
const isWatchedCase = (whichIncident) => {
- let isWatched = jsonpath.query(
- watchedCases,
- "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]"
+ let isWatched = jsonpath(
+ "$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]",
+ watchedCases
);
return isWatched;
@@ -275,11 +275,11 @@ const SearchResults = (props) => {
) : (
resultsArr.map((item, key) => {
- let detailsObj = jsonpath.query(
- searchDetailsObj,
+ let detailsObj = jsonpath(
'$..value[?(@.pinswg_name=="' +
item.title +
- '")]'
+ '")]',
+ searchDetailsObj
);
detailsObj = detailsObj[0];
return (
@@ -437,13 +437,13 @@ const SearchResults = (props) => {
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: item[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
@@ -458,13 +458,13 @@ const SearchResults = (props) => {
:
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
@@ -479,13 +479,13 @@ const SearchResults = (props) => {
{router.locale == "cy"
- ? jsonpath.query(
- transLookup,
+ ? jsonpath(
'$..[?(@.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
- '")].value_cy'
+ '")].value_cy',
+ transLookup
)
: item[
"statuscode@OData.Community.Display.V1.FormattedValue"
diff --git a/components/utils/index.js b/components/utils/index.js
index bc6e7818..085cbde8 100644
--- a/components/utils/index.js
+++ b/components/utils/index.js
@@ -1,4 +1,4 @@
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { v4 as uuidv4 } from "uuid";
import data from "../../data/collections.json";
import {
@@ -14,43 +14,43 @@ import xpath from "xpath";
* @param String formtype - string from appeal entity name
*/
export const getFormCollection = (formtype) => {
- const collectionName = jsonpath.query(
- data,
- "$..[?(@.LogicalName=='" + formtype + "')]"
+ const collectionName = jsonpath(
+ "$..[?(@.LogicalName=='" + formtype + "')]",
+ data
);
return collectionName[0];
};
export const getFormCollectionByID = (appealTypeID) => {
- const collectionName = jsonpath.query(
- data,
- "$..[?(@.appealTypeID =='" + appealTypeID + "')]"
+ const collectionName = jsonpath(
+ "$..[?(@.appealTypeID =='" + appealTypeID + "')]",
+ data
);
return collectionName[0];
};
export const getPickListLabel = (data, picklistType, picklistID) => {
- const pickListData = jsonpath.query(
- data,
- "$..[?(@.LogicalName=='" + picklistType + "')]"
+ const pickListData = jsonpath(
+ "$..[?(@.LogicalName=='" + picklistType + "')]",
+ data
);
- const pickListLabel = jsonpath.query(
- pickListData,
- "$..[?(@.Value=='" + picklistID + "')].Label.LocalizedLabels..Label"
+ const pickListLabel = jsonpath(
+ "$..[?(@.Value=='" + picklistID + "')].Label.LocalizedLabels..Label",
+ pickListData
);
return pickListLabel[0];
};
export const getRadioLabel = (data, radiotListName, radioListID) => {
- const radioListData = jsonpath.query(
- data,
- "$..[?(@.LogicalName=='" + radiotListName + "')]"
+ const radioListData = jsonpath(
+ "$..[?(@.LogicalName=='" + radiotListName + "')]",
+ data
);
- const pickListLabel = jsonpath.query(
- radioListData,
- "$..[?(@.Value=='" + radioListID + "')].Label.LocalizedLabels..Label"
+ const pickListLabel = jsonpath(
+ "$..[?(@.Value=='" + radioListID + "')].Label.LocalizedLabels..Label",
+ radioListData
);
return pickListLabel[0];
};
@@ -294,11 +294,11 @@ export const getProgressObj = (
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
- const isRequiredField = jsonpath.query(
- mandatoryFieldsData,
+ const isRequiredField = jsonpath(
"$..value[?(@.LogicalName=='" +
datafieldname[0].value +
- "')]"
+ "')]",
+ mandatoryFieldsData
);
if (datafieldname[0].value == "pinswg_fileUpload") {
diff --git a/next-env.d.ts b/next-env.d.ts
index fd36f949..4f11a03d 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,6 +1,5 @@
///
///
-///
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/package.json b/package.json
index 0d0af7c9..5b40edc4 100644
--- a/package.json
+++ b/package.json
@@ -35,6 +35,7 @@
"google-map-react": "^2.2.1",
"govuk-frontend": "^5.0.0",
"jsonpath": "^1.1.1",
+ "jsonpath-plus": "^8.0.0",
"leaflet": "^1.9.4",
"leaflet-defaulticon-compatibility": "^0.1.2",
"lodash": "^4.17.21",
@@ -89,4 +90,4 @@
"next-translate-plugin": "^2.6.2",
"prisma": "^5.0.0"
}
-}
\ No newline at end of file
+}
diff --git a/pages/account/changepassword.js b/pages/account/changepassword.js
index f09f3d96..16395062 100644
--- a/pages/account/changepassword.js
+++ b/pages/account/changepassword.js
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
import { useRouter } from "next/router";
import { useState } from "react";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { reduxForm, formValueSelector } from "redux-form";
import ChangePassword from "../../components/account/changepassword";
diff --git a/pages/account/forgottenpassword.js b/pages/account/forgottenpassword.js
index dd9cbaeb..565c39f5 100644
--- a/pages/account/forgottenpassword.js
+++ b/pages/account/forgottenpassword.js
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
import { useRouter } from "next/router";
import { useState } from "react";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { reduxForm, formValueSelector } from "redux-form";
import RegisterForm from "../../components/account/registerform";
diff --git a/pages/account/forgottenuser.js b/pages/account/forgottenuser.js
index 4a6c252d..d0983a32 100644
--- a/pages/account/forgottenuser.js
+++ b/pages/account/forgottenuser.js
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
import { useRouter } from "next/router";
import { useState } from "react";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { reduxForm, formValueSelector } from "redux-form";
import { getSession, useSession } from "next-auth/react";
import NoSessionWarning from "../../components/nosession";
diff --git a/pages/account/personaldetails.js b/pages/account/personaldetails.js
index 38a47487..49dc9acd 100644
--- a/pages/account/personaldetails.js
+++ b/pages/account/personaldetails.js
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
import { useRouter } from "next/router";
import { useState } from "react";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { reduxForm, formValueSelector } from "redux-form";
import PersonalDetails from "../../components/account/personaldetails";
diff --git a/pages/account/register.js b/pages/account/register.js
index 65f7e748..08944d35 100644
--- a/pages/account/register.js
+++ b/pages/account/register.js
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
import { useRouter } from "next/router";
import { useState } from "react";
import useTranslation from "next-translate/useTranslation";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import { reduxForm, formValueSelector } from "redux-form";
import RegisterForm from "../../components/account/registerform";
diff --git a/pages/api/endpoint/getmylpacases_api.js b/pages/api/endpoint/getmylpacases_api.js
index a461c978..371f5610 100644
--- a/pages/api/endpoint/getmylpacases_api.js
+++ b/pages/api/endpoint/getmylpacases_api.js
@@ -25,7 +25,7 @@ import {
consoleLogger,
getLPA,
} from "../../../actions";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
const WORDKEY = process.env.HASHKEY;
@@ -48,7 +48,7 @@ export default async function ApiProxy(req, res) {
const lpaList = await getLPA();
- const lpaGUID = jsonpath.query(lpaList, '$..[?(@.name=="' + lpaid + '")]');
+ const lpaGUID = jsonpath('$..[?(@.name=="' + lpaid + '")]', lpaList);
console.log(
'$..[?(@.name="' + lpaid + '")]',
diff --git a/pages/myportal/[appealtypes].js b/pages/myportal/[appealtypes].js
index df2241b7..4dee54c8 100644
--- a/pages/myportal/[appealtypes].js
+++ b/pages/myportal/[appealtypes].js
@@ -1,5 +1,5 @@
import fs from "fs";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { useRouter } from "next/router";
@@ -69,11 +69,9 @@ let Home = (props) => {
let optionsStr = props.appealType.appealTypeOptions.value || {};
- // let selectedObj = jsonpath.query(optionsStr, "$..value");
-
- let selectedObj = jsonpath.query(
- optionsStr,
- "$..[?(@.attributevalue=='" + router.query.apt + "')]"
+ let selectedObj = jsonpath(
+ "$..[?(@.attributevalue=='" + router.query.apt + "')]",
+ optionsStr
);
//let optionsTitleObj = [];
diff --git a/pages/newappeal/[appealtypes].js b/pages/newappeal/[appealtypes].js
index ed383ef3..8bcc8073 100644
--- a/pages/newappeal/[appealtypes].js
+++ b/pages/newappeal/[appealtypes].js
@@ -1,5 +1,5 @@
import fs from "fs";
-import jsonpath from "jsonpath";
+import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { useRouter } from "next/router";
@@ -69,11 +69,9 @@ let Home = (props) => {
let optionsStr = props.appealType.appealTypeOptions.value;
- // let selectedObj = jsonpath.query(optionsStr, "$..value");
-
- let selectedObj = jsonpath.query(
- optionsStr,
- "$..[?(@.attributevalue=='" + router.query.apt + "')]"
+ let selectedObj = jsonpath(
+ "$..[?(@.attributevalue=='" + router.query.apt + "')]",
+ optionsStr
);
//let optionsTitleObj = [];