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
+16 -6
View File
@@ -63,11 +63,19 @@ let BuildCheckRow = (props) => {
const { locale } = router;
const { appealtypes } = router.query;
let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
let formObj = jsonpath({
path: "$['" + appealtypes + "']",
json: fieldLookup,
sandbox: {},
});
let labelTrans =
router.locale == "cy"
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)
? jsonpath({
path: '$..[?(@.value=="' + label + '")].value_cy',
json: formObj,
sandbox: {},
})
: label;
return labelTrans;
};
@@ -93,12 +101,14 @@ let BuildCheckRow = (props) => {
var rows = xpath.select("//label/@description", doc);
var fieldtype = xpath.select("//@classid", doc);
var datafieldname = xpath.select("//@datafieldname", doc);
const isRequiredField = jsonpath(
"$..value[?(@.LogicalName=='" +
const isRequiredField = jsonpath({
path:
"$..value[?(@.LogicalName=='" +
datafieldname[0].value +
"')]",
mandatoryFieldsData
);
json: mandatoryFieldsData,
sandbox: {},
});
var documentTypeCode = xpath.select(
"//@ishareDocumentCode",
+10 -2
View File
@@ -127,11 +127,19 @@ let BuildCheckSection = (props) => {
const { locale } = router;
const { appealtypes } = router.query;
let formObj = jsonpath("$['" + appealtypes + "']", fieldLookup);
let formObj = jsonpath({
path: "$['" + appealtypes + "']",
json: fieldLookup,
sandbox: {},
});
let labelTrans =
router.locale == "cy"
? jsonpath('$..[?(@.value=="' + label + '")].value_cy', formObj)
? jsonpath({
path: '$..[?(@.value=="' + label + '")].value_cy',
json: formObj,
sandbox: {},
})
: label;
return labelTrans;
};
+1 -1
View File
@@ -110,7 +110,7 @@ export default function BuildRow(props) {
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
//const isRequiredField = jsonpath(
//const isRequiredField = jsonpath({path:
// "$..value[?(@.LogicalName=='" +
// datafieldname[0].value +
// "')]",
+12 -8
View File
@@ -65,12 +65,14 @@ const RenderLPAList = ({
value={optionsObj[key].accountid}
>
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
? jsonpath({
path:
'$..[?(@.value=="' +
optionsObj[key].name +
'")].value_cy',
transLookup
)
json: transLookup,
sandbox: {},
})
: optionsObj[key].name}
</option>
);
@@ -147,12 +149,14 @@ const RenderAppealTypeList = ({
: _.isEmpty(optionsObj[key].value)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
? jsonpath({
path:
'$..[?(@.value=="' +
optionsObj[key].value +
'")].value_cy',
transLookup
)
json: transLookup,
sandbox: {},
})
: optionsObj[key].value}
</option>
);