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 -36
View File
@@ -132,10 +132,14 @@ const CaseSummary = (props) => {
};
const isWatchedCase = (whichIncident) => {
let isWatched = jsonpath(
"$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]",
watchedCases
);
let isWatched = jsonpath({
path:
"$..value[?(@._pinswg_watchedcase_value=='" +
whichIncident +
"')]",
json: watchedCases,
sandbox: {},
});
return isWatched;
};
@@ -171,45 +175,52 @@ const CaseSummary = (props) => {
var casesObj = {};
currentType == "searchResultsObj"
? (casesObj = jsonpath(
'$..[?(@.title=="' + caseReference + '")]',
searchResultsObj
))
? (casesObj = jsonpath({
path: '$..[?(@.title=="' + caseReference + '")]',
json: searchResultsObj,
sandbox: {},
}))
: currentType == "watchedCases"
? (casesObj = jsonpath(
'$..[?(@.pinswg_title=="' + caseReference + '")]',
setCaseQueryObj
))
? (casesObj = jsonpath({
path: '$..[?(@.pinswg_title=="' + caseReference + '")]',
json: setCaseQueryObj,
sandbox: {},
}))
: currentType == "myCases"
? (casesObj = jsonpath(
'$..[?(@.pinswg_title=="' + caseReference + '")]',
setCaseQueryObj
))
? (casesObj = jsonpath({
path: '$..[?(@.pinswg_title=="' + caseReference + '")]',
json: setCaseQueryObj,
sandbox: {},
}))
: currentType == "directResultsObj"
? (casesObj = jsonpath(
'$..[?(@.ticketnumber=="' + caseReference + '")]',
setCaseQueryObj
))
: (casesObj = jsonpath(
'$..[?(@.reference=="' + caseReference + '")]',
setCaseQueryObj
));
? (casesObj = jsonpath({
path: '$..[?(@.ticketnumber=="' + caseReference + '")]',
json: setCaseQueryObj,
sandbox: {},
}))
: (casesObj = jsonpath({
path: '$..[?(@.reference=="' + caseReference + '")]',
json: setCaseQueryObj,
sandbox: {},
}));
casesObj = Object.assign({}, ...casesObj);
var detailsObj = {};
currentType == "searchResultsObj"
? (detailsObj = jsonpath(
'$..[?(@.pinswg_name=="' + caseReference + '")]',
searchDetailsObj
))
? (detailsObj = jsonpath({
path: '$..[?(@.pinswg_name=="' + caseReference + '")]',
json: searchDetailsObj,
sandbox: {},
}))
: currentType == "directResultsObj"
? (detailsObj = setCaseDetailsObj[0].value[0])
: (detailsObj = jsonpath(
'$..[?(@.pinswg_name=="' + caseReference + '")]',
setCaseDetailsObj
));
: (detailsObj = jsonpath({
path: '$..[?(@.pinswg_name=="' + caseReference + '")]',
jsopn: setCaseDetailsObj,
sandbox: {},
}));
detailsObj = typeof detailsObj == "object" ? detailsObj : detailsObj[0];
@@ -386,14 +397,16 @@ const CaseSummary = (props) => {
</dt>
<dd className="govuk-summary-list__value">
{router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
? jsonpath({
path:
'$..[?(@.value=="' +
detailsObj[
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy',
transLookup
)
json: transLookup,
sandbox: {},
})
: detailsObj[
"pinswg_casestage@OData.Community.Display.V1.FormattedValue"
] ||