update jsonpath library
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user