update jsonpath for csp fix

This commit is contained in:
2025-04-15 12:59:27 +01:00
parent 1caab59c05
commit 05f791e6a8
57 changed files with 1585 additions and 1041 deletions
+25 -14
View File
@@ -1339,10 +1339,11 @@ const RenderPickList = ({
}) => {
let { t } = useTranslation();
var dropdownObj = jsonpath(
"$..value[?(@.LogicalName=='" + datafieldname + "')]..Options",
picklistData
);
var dropdownObj = jsonpath({
path: "$..value[?(@.LogicalName=='" + datafieldname + "')]..Options",
json: picklistData,
sandbox: {},
});
dropdownObj = dropdownObj[0];
const required = (value) => {
@@ -1716,11 +1717,19 @@ export const FieldsTranslations = (label) => {
const { locale } = router;
const { appealtypes } = router.query;
let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
let formObj = jsonpath({
path: "$['" + appealtypes + "']",
json: fieldLookup,
sandbox: {},
});
let labelTrans =
router.locale == "cy"
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)[0]
? jsonpath({
path: '$..[?(@.value=="' + label + '")].value_cy',
json: formObj,
sandbox: {},
})[0]
: label;
//labelTrans = labelTrans.length > 1 ? labelTrans[0] : labelTrans;
@@ -1735,10 +1744,11 @@ const PickListTranslations = (optionValue) => {
//console.log(optionValue);
let optionTrans =
router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' + optionValue + '")].value_cy',
pickListLookup
)
? jsonpath({
path: '$..[?(@.value=="' + optionValue + '")].value_cy',
json: pickListLookup,
sandbox: {},
})
: optionValue;
//console.log(optionTrans, optionValue);
return optionTrans;
@@ -1934,10 +1944,11 @@ const RenderFileUpload = (field) => {
const filelistObj = field.fileList || {};
const blobList = jsonpath(
"$..[?(@.documentType=='" + field.documentTypeCode + "')]",
filelistObj
);
const blobList = jsonpath({
path: "$..[?(@.documentType=='" + field.documentTypeCode + "')]",
json: filelistObj,
sandbox: {},
});
//const blobList = filelistObj;
const deleteThisBlob = async (