update jsonpath for csp fix
This commit is contained in:
+49
-32
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user