update jsonpath library

This commit is contained in:
2024-02-08 14:28:40 +00:00
parent f034f4be3d
commit 2af463fbe9
67 changed files with 961 additions and 966 deletions
+16 -16
View File
@@ -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) => {
</div>
) : (
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) => {
:
</span>
{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) => {
</span>
{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"