update jsonpath for csp fix
This commit is contained in:
@@ -112,8 +112,9 @@ const ViewAllResults = (props) => {
|
||||
let resultsRowArr = [];
|
||||
const buildResultsRowArr = () => {
|
||||
resultsArr.map((item, key) => {
|
||||
let detailsObj = jsonpath(
|
||||
"$" +
|
||||
let detailsObj = jsonpath({
|
||||
path:
|
||||
"$" +
|
||||
(currentView.viewKey == "myRepresentations"
|
||||
? ""
|
||||
: "..value") +
|
||||
@@ -126,8 +127,9 @@ const ViewAllResults = (props) => {
|
||||
? item.pinswg_name
|
||||
: item.pinswg_title) +
|
||||
'")]',
|
||||
searchDetailsObj
|
||||
);
|
||||
json: searchDetailsObj,
|
||||
sandbox: {},
|
||||
});
|
||||
detailsObj = detailsObj[0];
|
||||
|
||||
//console.log(searchDetailsObj[key]);
|
||||
@@ -476,26 +478,30 @@ const ViewAllResults = (props) => {
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(resultsArr[key], "pinswg_lpaname")
|
||||
? router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
resultsArr[key].pinswg_lpaname +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: resultsArr[key].pinswg_lpaname || "N/A"
|
||||
: ""}
|
||||
{_.has(resultsArr[key], [
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
resultsArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: resultsArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"
|
||||
@@ -504,14 +510,16 @@ const ViewAllResults = (props) => {
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
searchDetailsObj[key].value[0][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
? searchDetailsObj[key].value
|
||||
: searchDetailsObj[key].value[0][
|
||||
@@ -522,14 +530,16 @@ const ViewAllResults = (props) => {
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
resultsArr[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: resultsArr[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -538,14 +548,16 @@ const ViewAllResults = (props) => {
|
||||
: "N/A")
|
||||
: currentView.viewKey == "myRepresentations" &&
|
||||
router.locale == "cy" &&
|
||||
jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
searchDetailsObj[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)}
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
@@ -554,26 +566,30 @@ const ViewAllResults = (props) => {
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
getFormCollectionByID(
|
||||
item.pinswg_appealcasetype
|
||||
).value +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: getFormCollectionByID(
|
||||
item.pinswg_appealcasetype
|
||||
).value || "N/A"
|
||||
: router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
item[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: item[
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
@@ -583,14 +599,16 @@ const ViewAllResults = (props) => {
|
||||
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
(router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
getFormCollectionByID(
|
||||
searchDetailsObj[key].appealType
|
||||
).value +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)[0]
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})[0]
|
||||
: getFormCollectionByID(
|
||||
searchDetailsObj[key].appealType
|
||||
).value)}
|
||||
@@ -609,21 +627,25 @@ const ViewAllResults = (props) => {
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.statuscode=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.statuscode=="' +
|
||||
item.statuscode +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: jsonpath(
|
||||
'$..[?(@.statuscode=="' +
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@.statuscode=="' +
|
||||
item.statuscode +
|
||||
'")].value',
|
||||
transLookup
|
||||
) || "N/A"
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
}) || "N/A"
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
||||
: // ? jsonpath(
|
||||
: // ? jsonpath({path:
|
||||
//
|
||||
// '$..[?(@.value=="' +
|
||||
// searchDetailsObj[key].value[0][
|
||||
@@ -635,7 +657,7 @@ const ViewAllResults = (props) => {
|
||||
// "statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
// ] || "N/A"
|
||||
// : router.locale == "cy"
|
||||
// ? jsonpath(
|
||||
// ? jsonpath({path:
|
||||
//
|
||||
// '$..[?(@.value=="' +
|
||||
// item[
|
||||
@@ -645,14 +667,16 @@ const ViewAllResults = (props) => {
|
||||
// )
|
||||
|
||||
router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@.value=="' +
|
||||
item[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
json: transLookup,
|
||||
sandbox: {},
|
||||
})
|
||||
: item[
|
||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"}
|
||||
|
||||
Reference in New Issue
Block a user