update jsonpath for csp fix
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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 +
|
||||
// "')]",
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user