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
+49 -32
View File
@@ -17,52 +17,67 @@ import xpath from "xpath";
* @param String formtype - string from appeal entity name
*/
export const getFormCollection = (formtype) => {
const collectionName = jsonpath(
"$..[?(@.LogicalName=='" + formtype + "')]",
data
);
const collectionName = jsonpath({
path: "$..[?(@.LogicalName=='" + formtype + "')]",
json: data,
sandbox: {},
});
return collectionName[0];
};
export const getFormCollectionByID = (appealTypeID) => {
const collectionName = jsonpath(
"$..[?(@.appealTypeID =='" + appealTypeID + "')]",
data
);
const collectionName = jsonpath({
path: "$..[?(@.appealTypeID =='" + appealTypeID + "')]",
json: data,
sandbox: {},
});
return collectionName[0];
};
export const getFormIDByLogicalName = (appealTypeLogicalName) => {
const collectionName = jsonpath(
"$..[?(@.LogicalName =='" + appealTypeLogicalName + "')]",
data
);
const collectionName = jsonpath({
path: "$..[?(@.LogicalName =='" + appealTypeLogicalName + "')]",
json: data,
sandbox: {},
});
return collectionName[0];
};
export const getPickListLabel = (data, picklistType, picklistID) => {
const pickListData = jsonpath(
"$..[?(@.LogicalName=='" + picklistType + "')]",
data
);
const pickListData = jsonpath({
path: "$..[?(@.LogicalName=='" + picklistType + "')]",
json: data,
sandbox: {},
});
const pickListLabel = jsonpath(
"$..[?(@.Value=='" + picklistID + "')].Label.LocalizedLabels..Label",
pickListData
);
const pickListLabel = jsonpath({
path:
"$..[?(@.Value=='" +
picklistID +
"')].Label.LocalizedLabels..Label",
json: pickListData,
sandbox: {},
});
return pickListLabel[0];
};
export const getRadioLabel = (data, radiotListName, radioListID) => {
const radioListData = jsonpath(
"$..[?(@.LogicalName=='" + radiotListName + "')]",
data
);
const radioListData = jsonpath({
path: "$..[?(@.LogicalName=='" + radiotListName + "')]",
json: data,
sandbox: {},
});
const pickListLabel = jsonpath(
"$..[?(@.Value=='" + radioListID + "')].Label.LocalizedLabels..Label",
radioListData
);
const pickListLabel = jsonpath({
path:
"$..[?(@.Value=='" +
radioListID +
"')].Label.LocalizedLabels..Label",
json: radioListData,
sandbox: {},
});
return pickListLabel[0];
};
@@ -319,12 +334,14 @@ export const getProgressObj = (
dateEnd = !_.isEmpty(dateEnd) && dateEnd[0].value;
const isRequiredField = jsonpath(
"$..value[?(@.LogicalName=='" +
const isRequiredField = jsonpath({
path:
"$..value[?(@.LogicalName=='" +
datafieldname[0].value +
"')]",
mandatoryFieldsData
);
json: mandatoryFieldsData,
sandbox: {},
});
if (datafieldname[0].value.includes("pinswg_fileUpload")) {
if (typeof isRequiredField[0] != "undefined") {