updated view all

This commit is contained in:
2023-04-21 10:36:19 +01:00
parent 98ed833a47
commit dc43d7f2b4
7 changed files with 180 additions and 44 deletions
+12 -11
View File
@@ -998,17 +998,18 @@ export const createNewCaseBlob = (
"&contactid=" + "&contactid=" +
contactid + contactid +
"&containername=" + "&containername=" +
containerName + containerName;
hashAPIPath( //+
"/api/file/createcase_api?appealTypeId=" + // hashAPIPath(
appealTypeId + // "/api/file/createcase_api?appealTypeId=" +
"&lpaID=" + // appealTypeId +
lpaID + // "&lpaID=" +
"&contactid=" + // lpaID +
contactid + // "&contactid=" +
"&containername=" + // contactid +
containerName // "&containername=" +
); // containerName
// );
var config = { var config = {
method: "post", method: "post",
+1 -1
View File
@@ -48,7 +48,7 @@ export const getSelectQuery = (appealTypeName) => {
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent"; return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent";
break; break;
case "pinswg_planningappeals78s": case "pinswg_planningappeals78s":
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent"; return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent";
break; break;
case "pinswg_planningconditionss73s79s": case "pinswg_planningconditionss73s79s":
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent"; return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
+2
View File
@@ -278,6 +278,8 @@ let MakeRepresentation = (props) => {
"_" + "_" +
props.props.accountDetails.accountDetails.lastname, props.props.accountDetails.accountDetails.lastname,
"containerID": props.props.accountDetails.containerID, "containerID": props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType,
"incidentID": props.props.currentView.caseReference.incidentid,
}); });
updateBody = JSON.stringify(updateBody); updateBody = JSON.stringify(updateBody);
-1
View File
@@ -19,7 +19,6 @@ const CheckAnswers = (props) => {
id="main-content" id="main-content"
role="main" role="main"
> >
sss
<BuildCheckSection <BuildCheckSection
formXML={formXML} formXML={formXML}
sectionCount={sectionCount} sectionCount={sectionCount}
+157 -28
View File
@@ -35,15 +35,11 @@ const ViewAllResults = (props) => {
return dd + "/" + mm + "/" + yyyy; return dd + "/" + mm + "/" + yyyy;
} }
// console.log(
// currentView.viewKey,
// props[currentView.viewKey],
// props[currentView.viewKey][currentView.viewKey].value
// );
var searchDetailsObj = var searchDetailsObj =
currentView.viewKey == "awaitingSubmissionDetails" currentView.viewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.value ? props["awaitingSubmission"].awaitingSubmissionDetails.value
: currentView.viewKey == "myRepresentations"
? props["myRepresentations"]["myRepresentationsDetails"]
: props[currentView.viewKey][currentView.viewKey + "Details"] || []; : props[currentView.viewKey][currentView.viewKey + "Details"] || [];
let resultsRowArr = []; let resultsRowArr = [];
@@ -54,6 +50,13 @@ const ViewAllResults = (props) => {
); );
detailsObj = detailsObj[0]; detailsObj = detailsObj[0];
//console.log(searchDetailsObj[key]);
// searchDetailsObj[key] =
// currentView.viewKey == "myRepresentations"
// ? searchDetailsObj[key].value[0]
// : searchDetailsObj[key];
resultsRowArr.push( resultsRowArr.push(
<div className="govuk-summary-list__row" key={key}> <div className="govuk-summary-list__row" key={key}>
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2"> <dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
@@ -110,11 +113,13 @@ const ViewAllResults = (props) => {
}} }}
> >
<span className="results-visually-hidden"> <span className="results-visually-hidden">
Case Reference: {t("search:searchresults-case-reference-label")}
:
</span> </span>
{currentView.viewKey != "watchedCases" {currentView.viewKey != "watchedCases"
? resultsArr[key].ticketnumber ? currentView.viewKey == "myRepresentations"
? resultsArr[key].casereference
: resultsArr[key].ticketnumber
: resultsArr[key][ : resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]} ]}
@@ -139,16 +144,23 @@ const ViewAllResults = (props) => {
)[0] )[0]
: "" : ""
: ""} */} : ""} */}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1") _.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline1 ? searchDetailsObj[key].pinswg_siteaddressline1
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1 ? detailsObj.pinswg_siteaddressline1
: ""} : ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline1"
)
? searchDetailsObj[key].value[0].pinswg_siteaddressline1
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline1
: ""}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
@@ -156,15 +168,26 @@ const ViewAllResults = (props) => {
) && ) &&
searchDetailsObj[key].pinswg_siteaddressline1 != searchDetailsObj[key].pinswg_siteaddressline1 !=
null && <br />} null && <br />}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline1"
) &&
searchDetailsObj[key].value[0]
.pinswg_siteaddressline1 != null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline1") && {_.has(detailsObj, "pinswg_siteaddressline1") &&
detailsObj.pinswg_siteaddressline1 != null && <br />} detailsObj.pinswg_siteaddressline1 != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddressline1") _.has(searchDetailsObj[key], "pinswg_siteaddressline1")
? searchDetailsObj[key].pinswg_siteaddressline2 ? searchDetailsObj[key].pinswg_siteaddressline2
: ""} : ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline1"
)
? searchDetailsObj[key].value[0].pinswg_siteaddressline2
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1") {_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline2 ? detailsObj.pinswg_siteaddressline2
: ""} : ""}
@@ -176,18 +199,30 @@ const ViewAllResults = (props) => {
searchDetailsObj[key].pinswg_siteaddressline2 != searchDetailsObj[key].pinswg_siteaddressline2 !=
null && <br />} null && <br />}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline2"
) &&
searchDetailsObj[key].value[0]
.pinswg_siteaddressline2 != null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline2") && {_.has(detailsObj, "pinswg_siteaddressline2") &&
detailsObj.pinswg_siteaddressline2 != null && <br />} detailsObj.pinswg_siteaddressline2 != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresstown") _.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown ? searchDetailsObj[key].pinswg_siteaddresstown
: ""} : ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddresstown"
)
? searchDetailsObj[key].value[0].pinswg_siteaddresstown
: ""}
{_.has(detailsObj, "pinswg_siteaddresstown") {_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown ? detailsObj.pinswg_siteaddresstown
: ""} : ""}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
@@ -196,18 +231,31 @@ const ViewAllResults = (props) => {
searchDetailsObj[key].pinswg_siteaddresstown != searchDetailsObj[key].pinswg_siteaddresstown !=
null && <br />} null && <br />}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddresstown"
) &&
searchDetailsObj[key].value[0].pinswg_siteaddresstown !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown") && {_.has(detailsObj, "pinswg_siteaddresstown") &&
detailsObj.pinswg_siteaddresstown != null && <br />} detailsObj.pinswg_siteaddresstown != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty") _.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty ? searchDetailsObj[key].pinswg_siteaddresscounty
: ""} : ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddresscounty"
)
? searchDetailsObj[key].value[0]
.pinswg_siteaddresscounty
: ""}
{_.has(detailsObj, "pinswg_siteaddresscounty") {_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty ? detailsObj.pinswg_siteaddresscounty
: ""} : ""}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has( _.has(
searchDetailsObj[key], searchDetailsObj[key],
@@ -215,15 +263,12 @@ const ViewAllResults = (props) => {
) && ) &&
searchDetailsObj[key].pinswg_siteaddresscounty != searchDetailsObj[key].pinswg_siteaddresscounty !=
null && <br />} null && <br />}
{_.has(detailsObj, "pinswg_siteaddresscounty") && {_.has(detailsObj, "pinswg_siteaddresscounty") &&
detailsObj.pinswg_siteaddresscounty != null && <br />} detailsObj.pinswg_siteaddresscounty != null && <br />}
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(searchDetailsObj[key], "pinswg_siteaddresspostcode") _.has(searchDetailsObj[key], "pinswg_siteaddresspostcode")
? searchDetailsObj[key].pinswg_siteaddresspostcode ? searchDetailsObj[key].pinswg_siteaddresspostcode
: ""} : ""}
{_.has(detailsObj, "pinswg_siteaddresspostcode") {_.has(detailsObj, "pinswg_siteaddresspostcode")
? detailsObj.pinswg_siteaddresspostcode ? detailsObj.pinswg_siteaddresspostcode
: ""} : ""}
@@ -234,7 +279,6 @@ const ViewAllResults = (props) => {
? t("search:searchresults-created-on-label") ? t("search:searchresults-created-on-label")
: t("search:searchresults-applicant-label")} : t("search:searchresults-applicant-label")}
</span> </span>
{currentView.viewKey == "awaitingSubmissionDetails" {currentView.viewKey == "awaitingSubmissionDetails"
? formatDates(item.createdon) ? formatDates(item.createdon)
: _.has(detailsObj, [ : _.has(detailsObj, [
@@ -243,6 +287,10 @@ const ViewAllResults = (props) => {
? detailsObj[ ? detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
] ]
: currentView.viewKey == "myRepresentations"
? searchDetailsObj[key].value[0][
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
: resultsArr[key][ : resultsArr[key][
"_customerid_value@OData.Community.Display.V1.FormattedValue" "_customerid_value@OData.Community.Display.V1.FormattedValue"
]} ]}
@@ -251,7 +299,6 @@ const ViewAllResults = (props) => {
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{t("search:searchresults-authority-label")}: {t("search:searchresults-authority-label")}:
</span> </span>
{currentView.viewKey == "awaitingSubmissionDetails" && {currentView.viewKey == "awaitingSubmissionDetails" &&
_.has(resultsArr[key], "pinswg_lpaname") _.has(resultsArr[key], "pinswg_lpaname")
? router.locale == "cy" ? router.locale == "cy"
@@ -263,7 +310,6 @@ const ViewAllResults = (props) => {
) )
: resultsArr[key].pinswg_lpaname || "N/A" : resultsArr[key].pinswg_lpaname || "N/A"
: ""} : ""}
{_.has(resultsArr[key], [ {_.has(resultsArr[key], [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue", "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
]) ])
@@ -280,6 +326,51 @@ const ViewAllResults = (props) => {
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue" "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] || "N/A" ] || "N/A"
: ""} : ""}
{_.has(searchDetailsObj[key], [
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
] +
'")].value_cy'
)
: searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: ""}
{_.has(resultsArr[key], [
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
])
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
resultsArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
] +
'")].value_cy'
)
: resultsArr[key][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] ||
(currentView.viewKey == "myRepresentations"
? ""
: "N/A")
: currentView.viewKey == "myRepresentations" &&
router.locale == "cy" &&
jsonpath.query(
transLookup,
'$..[?(@.value=="' +
searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)}
qqq
</dd> </dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
@@ -309,7 +400,32 @@ const ViewAllResults = (props) => {
) )
: item[ : item[
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
] || "N/A"} ] ||
(currentView.viewKey == "myRepresentations"
? ""
: "N/A")}
{currentView.viewKey == "myRepresentations" &&
(router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
getFormCollectionByID(
searchDetailsObj[key].value[0][
"pinswg_procedure"
]
).value +
'")].value_cy'
)[0]
: getFormCollectionByID(
searchDetailsObj[key].value[0][
"pinswg_procedure"
]
).value)}
{_.has(
searchDetailsObj[key],
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
)}
</dd> </dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16"> <dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden"> <span className="results-visually-hidden">
@@ -330,6 +446,19 @@ const ViewAllResults = (props) => {
item.statuscode + item.statuscode +
'")].value' '")].value'
) || "N/A" ) || "N/A"
: currentView.viewKey == "myRepresentations"
? router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
searchDetailsObj[key].value[0][
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: searchDetailsObj[key].value[0][
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"
: router.locale == "cy" : router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
+1 -1
View File
@@ -51,7 +51,7 @@ const WatchedCases = (props) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
setCurrentView: (currentView) => { setCurrentView: (currentView) => {
console.log(currentView); //console.log(currentView);
dispatch(setCurrentView(currentView)); dispatch(setCurrentView(currentView));
}, },
}; };
+7 -2
View File
@@ -219,10 +219,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
myCasesDetails, myCasesDetails,
watchedCasesDetails, watchedCasesDetails,
awaitingSubmissionDetails, awaitingSubmissionDetails,
myRepresentationsDetails,
] = await Promise.all([ ] = await Promise.all([
await getDetails(myCases, "myCases"), await getDetails(myCases, "myCases"),
await getDetails(watchedCases, "myWatchedCases"), await getDetails(watchedCases, "myWatchedCases"),
await getDetails(awaitingSubmission, "awaitingSubmission"), await getDetails(awaitingSubmission, "awaitingSubmission"),
await getDetails(myRepresentations, "myRepresentations"),
]); ]);
store.dispatch(setAccountDetails(accountDetails)); store.dispatch(setAccountDetails(accountDetails));
@@ -230,6 +232,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setMyCases(myCases)); store.dispatch(setMyCases(myCases));
store.dispatch(setMyCasesDetails(myCasesDetails)); store.dispatch(setMyCasesDetails(myCasesDetails));
store.dispatch(setMyRepresentations(myRepresentations)); store.dispatch(setMyRepresentations(myRepresentations));
store.dispatch(
setMyRepresentationsDetails(myRepresentationsDetails)
);
store.dispatch(setWatchedCases(watchedCases)); store.dispatch(setWatchedCases(watchedCases));
store.dispatch(setWatchedCasesDetails(watchedCasesDetails)); store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
@@ -256,11 +261,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
const getDetails = (resultsObj, detailsType) => { const getDetails = (resultsObj, detailsType) => {
let detailsArr = []; let detailsArr = [];
resultsObj = resultsObj.value; resultsObj = resultsObj.value;
if (detailsType == "myRepresentations") { if (detailsType == "myRepresentations") {
const repsObj = resultsObj.map((searchDetail, index) => { const repsObj = resultsObj.map((searchDetail, index) => {
console.log("==== ", searchDetail["_pinswg_case_value"]);
detailsArr.push( detailsArr.push(
getCase(searchDetail["_pinswg_case_value"]).then((data) => { getCase(searchDetail["incidentID"]).then((data) => {
return getPortalModuleDetails( return getPortalModuleDetails(
getFormCollectionByID(data.pinswg_appealcasetype) getFormCollectionByID(data.pinswg_appealcasetype)
.LogicalCollectionName, .LogicalCollectionName,