updated view all
This commit is contained in:
+12
-11
@@ -998,17 +998,18 @@ export const createNewCaseBlob = (
|
||||
"&contactid=" +
|
||||
contactid +
|
||||
"&containername=" +
|
||||
containerName +
|
||||
hashAPIPath(
|
||||
"/api/file/createcase_api?appealTypeId=" +
|
||||
appealTypeId +
|
||||
"&lpaID=" +
|
||||
lpaID +
|
||||
"&contactid=" +
|
||||
contactid +
|
||||
"&containername=" +
|
||||
containerName
|
||||
);
|
||||
containerName;
|
||||
//+
|
||||
// hashAPIPath(
|
||||
// "/api/file/createcase_api?appealTypeId=" +
|
||||
// appealTypeId +
|
||||
// "&lpaID=" +
|
||||
// lpaID +
|
||||
// "&contactid=" +
|
||||
// contactid +
|
||||
// "&containername=" +
|
||||
// containerName
|
||||
// );
|
||||
|
||||
var config = {
|
||||
method: "post",
|
||||
|
||||
@@ -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";
|
||||
break;
|
||||
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;
|
||||
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";
|
||||
|
||||
@@ -278,6 +278,8 @@ let MakeRepresentation = (props) => {
|
||||
"_" +
|
||||
props.props.accountDetails.accountDetails.lastname,
|
||||
"containerID": props.props.accountDetails.containerID,
|
||||
"appealType": props.props.currentView.caseReference.appealType,
|
||||
"incidentID": props.props.currentView.caseReference.incidentid,
|
||||
});
|
||||
|
||||
updateBody = JSON.stringify(updateBody);
|
||||
|
||||
@@ -19,7 +19,6 @@ const CheckAnswers = (props) => {
|
||||
id="main-content"
|
||||
role="main"
|
||||
>
|
||||
sss
|
||||
<BuildCheckSection
|
||||
formXML={formXML}
|
||||
sectionCount={sectionCount}
|
||||
|
||||
+157
-28
@@ -35,15 +35,11 @@ const ViewAllResults = (props) => {
|
||||
return dd + "/" + mm + "/" + yyyy;
|
||||
}
|
||||
|
||||
// console.log(
|
||||
// currentView.viewKey,
|
||||
// props[currentView.viewKey],
|
||||
// props[currentView.viewKey][currentView.viewKey].value
|
||||
// );
|
||||
|
||||
var searchDetailsObj =
|
||||
currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
||||
: currentView.viewKey == "myRepresentations"
|
||||
? props["myRepresentations"]["myRepresentationsDetails"]
|
||||
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
|
||||
|
||||
let resultsRowArr = [];
|
||||
@@ -54,6 +50,13 @@ const ViewAllResults = (props) => {
|
||||
);
|
||||
detailsObj = detailsObj[0];
|
||||
|
||||
//console.log(searchDetailsObj[key]);
|
||||
|
||||
// searchDetailsObj[key] =
|
||||
// currentView.viewKey == "myRepresentations"
|
||||
// ? searchDetailsObj[key].value[0]
|
||||
// : searchDetailsObj[key];
|
||||
|
||||
resultsRowArr.push(
|
||||
<div className="govuk-summary-list__row" key={key}>
|
||||
<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">
|
||||
Case Reference:
|
||||
{t("search:searchresults-case-reference-label")}
|
||||
:
|
||||
</span>
|
||||
|
||||
{currentView.viewKey != "watchedCases"
|
||||
? resultsArr[key].ticketnumber
|
||||
? currentView.viewKey == "myRepresentations"
|
||||
? resultsArr[key].casereference
|
||||
: resultsArr[key].ticketnumber
|
||||
: resultsArr[key][
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]}
|
||||
@@ -139,16 +144,23 @@ const ViewAllResults = (props) => {
|
||||
)[0]
|
||||
: ""
|
||||
: ""} */}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline1
|
||||
: ""}
|
||||
|
||||
{_.has(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" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
@@ -156,15 +168,26 @@ const ViewAllResults = (props) => {
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].value[0],
|
||||
"pinswg_siteaddressline1"
|
||||
) &&
|
||||
searchDetailsObj[key].value[0]
|
||||
.pinswg_siteaddressline1 != null && <br />}
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
||||
detailsObj.pinswg_siteaddressline1 != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||
: ""}
|
||||
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].value[0],
|
||||
"pinswg_siteaddressline1"
|
||||
)
|
||||
? searchDetailsObj[key].value[0].pinswg_siteaddressline2
|
||||
: ""}
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
@@ -176,18 +199,30 @@ const ViewAllResults = (props) => {
|
||||
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
||||
null && <br />}
|
||||
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].value[0],
|
||||
"pinswg_siteaddressline2"
|
||||
) &&
|
||||
searchDetailsObj[key].value[0]
|
||||
.pinswg_siteaddressline2 != null && <br />}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
||||
detailsObj.pinswg_siteaddressline2 != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(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")
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
@@ -196,18 +231,31 @@ const ViewAllResults = (props) => {
|
||||
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
_.has(
|
||||
searchDetailsObj[key].value[0],
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
searchDetailsObj[key].value[0].pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(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")
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
@@ -215,15 +263,12 @@ const ViewAllResults = (props) => {
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddresscounty !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresscounty") &&
|
||||
detailsObj.pinswg_siteaddresscounty != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresspostcode")
|
||||
? searchDetailsObj[key].pinswg_siteaddresspostcode
|
||||
: ""}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
||||
? detailsObj.pinswg_siteaddresspostcode
|
||||
: ""}
|
||||
@@ -234,7 +279,6 @@ const ViewAllResults = (props) => {
|
||||
? t("search:searchresults-created-on-label")
|
||||
: t("search:searchresults-applicant-label")}
|
||||
</span>
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? formatDates(item.createdon)
|
||||
: _.has(detailsObj, [
|
||||
@@ -243,6 +287,10 @@ const ViewAllResults = (props) => {
|
||||
? detailsObj[
|
||||
"_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][
|
||||
"_customerid_value@OData.Community.Display.V1.FormattedValue"
|
||||
]}
|
||||
@@ -251,7 +299,6 @@ const ViewAllResults = (props) => {
|
||||
<span className="results-visually-hidden">
|
||||
{t("search:searchresults-authority-label")}:
|
||||
</span>
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(resultsArr[key], "pinswg_lpaname")
|
||||
? router.locale == "cy"
|
||||
@@ -263,7 +310,6 @@ const ViewAllResults = (props) => {
|
||||
)
|
||||
: resultsArr[key].pinswg_lpaname || "N/A"
|
||||
: ""}
|
||||
|
||||
{_.has(resultsArr[key], [
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
@@ -280,6 +326,51 @@ const ViewAllResults = (props) => {
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || "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 className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
@@ -309,7 +400,32 @@ const ViewAllResults = (props) => {
|
||||
)
|
||||
: item[
|
||||
"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 className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
@@ -330,6 +446,19 @@ const ViewAllResults = (props) => {
|
||||
item.statuscode +
|
||||
'")].value'
|
||||
) || "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"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
|
||||
@@ -51,7 +51,7 @@ const WatchedCases = (props) => {
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentView: (currentView) => {
|
||||
console.log(currentView);
|
||||
//console.log(currentView);
|
||||
dispatch(setCurrentView(currentView));
|
||||
},
|
||||
};
|
||||
|
||||
@@ -219,10 +219,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
myCasesDetails,
|
||||
watchedCasesDetails,
|
||||
awaitingSubmissionDetails,
|
||||
myRepresentationsDetails,
|
||||
] = await Promise.all([
|
||||
await getDetails(myCases, "myCases"),
|
||||
await getDetails(watchedCases, "myWatchedCases"),
|
||||
await getDetails(awaitingSubmission, "awaitingSubmission"),
|
||||
await getDetails(myRepresentations, "myRepresentations"),
|
||||
]);
|
||||
|
||||
store.dispatch(setAccountDetails(accountDetails));
|
||||
@@ -230,6 +232,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
store.dispatch(setMyCases(myCases));
|
||||
store.dispatch(setMyCasesDetails(myCasesDetails));
|
||||
store.dispatch(setMyRepresentations(myRepresentations));
|
||||
store.dispatch(
|
||||
setMyRepresentationsDetails(myRepresentationsDetails)
|
||||
);
|
||||
|
||||
store.dispatch(setWatchedCases(watchedCases));
|
||||
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||
@@ -256,11 +261,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
const getDetails = (resultsObj, detailsType) => {
|
||||
let detailsArr = [];
|
||||
resultsObj = resultsObj.value;
|
||||
|
||||
if (detailsType == "myRepresentations") {
|
||||
const repsObj = resultsObj.map((searchDetail, index) => {
|
||||
console.log("==== ", searchDetail["_pinswg_case_value"]);
|
||||
detailsArr.push(
|
||||
getCase(searchDetail["_pinswg_case_value"]).then((data) => {
|
||||
getCase(searchDetail["incidentID"]).then((data) => {
|
||||
return getPortalModuleDetails(
|
||||
getFormCollectionByID(data.pinswg_appealcasetype)
|
||||
.LogicalCollectionName,
|
||||
|
||||
Reference in New Issue
Block a user