view all updates for reps

This commit is contained in:
2023-11-08 09:03:34 +00:00
parent 08552da757
commit e7afa582ff
7 changed files with 123 additions and 98 deletions
+6
View File
@@ -545,6 +545,12 @@ let MakeRepresentation = (props) => {
detailsObj[
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
],
"_pinswg_localplanningauthority_value":
detailsObj["_pinswg_localplanningauthority_value"],
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue":
detailsObj[
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
],
"representationCapacity": router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.currentView.representationCapacity
+21 -8
View File
@@ -38,9 +38,22 @@ const TopThree = (props) => {
const { locale } = router;
let topthreeRow = [];
let showTopThreeArr = showTopThree.value;
Object.keys(showTopThreeArr).map((key, index) => {
let createdDate = parseInt(
showTopThreeArr[key].repfile_name.split("-")[3]
);
showTopThreeArr[key].createdDate = createdDate;
});
showTopThreeArr.sort(function compare(a, b) {
console.log(a.createdDate, b.createdDate);
var dateA = new Date(a.createdDate);
var dateB = new Date(b.createdDate);
return dateB - dateA;
});
const deleteItem = (caseID, topThreeType) => {
let cookies = parseCookies();
//console.log("sssss", caseID, topThreeType);
@@ -135,13 +148,13 @@ const TopThree = (props) => {
return dateObj.toLocaleString();
};
let topThreeOnlyArr = showTopThreeArr; //.slice(0, 3);
let topThreeOnlyArr = showTopThreeArr.slice(0, 3);
Object.keys(topThreeOnlyArr).map((key, index) => {
topthreeRow.push(
<div className="cardModuleItem" key={index}>
<div className="cardModuleDetails">
<div className="cardModuleReference">
<b>{t("myportal:representation-id")}:</b>{" "}
<b>{t("myportal:case-reference")}:</b>{" "}
<Link
href={{
pathname: "/myportal/representation",
@@ -172,11 +185,6 @@ const TopThree = (props) => {
</a>
</Link>
</div>
<div className="cardModuleReference">
<b>{t("myportal:case-reference")}:</b>
{" "}
{showTopThreeArr[key].caseRef}
</div>
<div className="cardModuleReference">
<b>{t("myportal:representation-type")}:</b>
{" "}
@@ -191,6 +199,11 @@ const TopThree = (props) => {
<b>{t("myportal:date-raised")}:</b>
{" "}
{repRaisedDate(showTopThreeArr[key].repfile_name)}
</div>{" "}
<div className="cardModuleReference">
<b>lpa:</b>
{" "}
{repRaisedDate(showTopThreeArr[key].repfile_name)}
</div>
</div>
</div>
+72 -70
View File
@@ -20,7 +20,10 @@ const ViewAllResults = (props) => {
const router = useRouter();
const { locale } = router;
const repRaisedDate = (datePart) => {
var dateObj = new Date(datePart);
return dateObj.toLocaleString();
};
var resultsArr =
currentView.viewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.case
@@ -39,7 +42,7 @@ const ViewAllResults = (props) => {
currentView.viewKey == "awaitingSubmissionDetails"
? props["awaitingSubmission"].awaitingSubmissionDetails.value
: currentView.viewKey == "myRepresentations"
? props["myRepresentations"]["myRepresentationsDetails"]
? props["myRepresentations"].myRepresentations.value
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
let resultsRowArr = [];
@@ -62,7 +65,16 @@ const ViewAllResults = (props) => {
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
<Link
href={
currentView.viewKey == "awaitingSubmissionDetails"
currentView.viewKey == "myRepresentations"
? {
pathname: "/myportal/representation",
query: {
case: resultsArr[key].caseRef,
state: "edit",
},
}
: currentView.viewKey ==
"awaitingSubmissionDetails"
? router.locale == "cy"
? "/fymhorth/parhauigyflwyno"
: "/myportal" +
@@ -94,7 +106,10 @@ const ViewAllResults = (props) => {
setCurrentReference({
"currentReference":
currentView.viewKey != "watchedCases"
? resultsArr[key].ticketnumber
? currentView.viewKey ==
"myRepresentations"
? resultsArr[key].caseRef
: resultsArr[key].ticketnumber
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
],
@@ -109,6 +124,10 @@ const ViewAllResults = (props) => {
"appealType":
resultsArr[key].pinswg_appealcasetype,
"repDetails":
currentView.viewKey ==
"myRepresentations" &&
resultsArr[key],
});
}}
>
@@ -118,7 +137,7 @@ const ViewAllResults = (props) => {
</span>
{currentView.viewKey != "watchedCases"
? currentView.viewKey == "myRepresentations"
? resultsArr[key].casereference
? resultsArr[key].caseRef
: resultsArr[key].ticketnumber
: resultsArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
@@ -152,10 +171,7 @@ const ViewAllResults = (props) => {
? detailsObj.pinswg_siteaddressline1
: ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline1"
)
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].value[0].pinswg_siteaddressline1
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1")
@@ -169,10 +185,7 @@ const ViewAllResults = (props) => {
searchDetailsObj[key].pinswg_siteaddressline1 !=
null && <br />}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline1"
) &&
_.has(searchDetailsObj[key].pinswg_siteaddressline1) &&
searchDetailsObj[key].value[0]
.pinswg_siteaddressline1 != null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline1") &&
@@ -182,11 +195,8 @@ const ViewAllResults = (props) => {
? searchDetailsObj[key].pinswg_siteaddressline2
: ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline1"
)
? searchDetailsObj[key].value[0].pinswg_siteaddressline2
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
? searchDetailsObj[key].pinswg_siteaddressline2
: ""}
{_.has(detailsObj, "pinswg_siteaddressline1")
? detailsObj.pinswg_siteaddressline2
@@ -200,12 +210,9 @@ const ViewAllResults = (props) => {
null && <br />}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddressline2"
) &&
searchDetailsObj[key].value[0]
.pinswg_siteaddressline2 != null && <br />}
_.has(searchDetailsObj[key].pinswg_siteaddressline2) &&
searchDetailsObj[key].pinswg_siteaddressline1 !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddressline2") &&
detailsObj.pinswg_siteaddressline2 != null && <br />}
@@ -214,11 +221,8 @@ const ViewAllResults = (props) => {
? searchDetailsObj[key].pinswg_siteaddresstown
: ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddresstown"
)
? searchDetailsObj[key].value[0].pinswg_siteaddresstown
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
? searchDetailsObj[key].pinswg_siteaddresstown
: ""}
{_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown
@@ -233,10 +237,10 @@ const ViewAllResults = (props) => {
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
searchDetailsObj[key],
"pinswg_siteaddresstown"
) &&
searchDetailsObj[key].value[0].pinswg_siteaddresstown !=
searchDetailsObj[key].pinswg_siteaddresstown !=
null && <br />}
{_.has(detailsObj, "pinswg_siteaddresstown") &&
@@ -246,12 +250,8 @@ const ViewAllResults = (props) => {
? searchDetailsObj[key].pinswg_siteaddresscounty
: ""}
{currentView.viewKey == "myRepresentations" &&
_.has(
searchDetailsObj[key].value[0],
"pinswg_siteaddresscounty"
)
? searchDetailsObj[key].value[0]
.pinswg_siteaddresscounty
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
? searchDetailsObj[key].pinswg_siteaddresscounty
: ""}
{_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty
@@ -288,7 +288,7 @@ const ViewAllResults = (props) => {
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
: currentView.viewKey == "myRepresentations"
? searchDetailsObj[key].value[0][
? searchDetailsObj[key][
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
: resultsArr[key][
@@ -338,6 +338,8 @@ const ViewAllResults = (props) => {
] +
'")].value_cy'
)
: currentView.viewKey == "myRepresentations"
? searchDetailsObj[key].value
: searchDetailsObj[key].value[0][
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
] || "N/A"
@@ -365,12 +367,11 @@ const ViewAllResults = (props) => {
jsonpath.query(
transLookup,
'$..[?(@.value=="' +
searchDetailsObj[key].value[0][
searchDetailsObj[key][
"_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">
@@ -411,16 +412,12 @@ const ViewAllResults = (props) => {
transLookup,
'$..[?(@.value=="' +
getFormCollectionByID(
searchDetailsObj[key].value[0][
"pinswg_procedure"
]
searchDetailsObj[key].appealType
).value +
'")].value_cy'
)[0]
: getFormCollectionByID(
searchDetailsObj[key].value[0][
"pinswg_procedure"
]
searchDetailsObj[key].appealType
).value)}
{_.has(
searchDetailsObj[key],
@@ -429,7 +426,10 @@ const ViewAllResults = (props) => {
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
<span className="results-visually-hidden">
{t("search:searchresults-status-label")}:
{currentView.viewKey == "myRepresentations"
? "Created"
: t("search:searchresults-status-label")}
:
</span>
{currentView.viewKey == "awaitingSubmissionDetails"
@@ -447,28 +447,28 @@ const ViewAllResults = (props) => {
'")].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,
'$..[?(@.value=="' +
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
)
: item[
? repRaisedDate(item.createdDate) // ? 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,
// '$..[?(@.value=="' +
// item[
// "statuscode@OData.Community.Display.V1.FormattedValue"
// ] +
// '")].value_cy'
// )
item[
"statuscode@OData.Community.Display.V1.FormattedValue"
] || "N/A"}
</dd>
@@ -516,7 +516,9 @@ const ViewAllResults = (props) => {
{t("search:searchresults-case-type-label")}
</dd>
<dd className="govuk-summary-list__key govuk-!-font-size-16">
{t("search:searchresults-status-label")}
{currentView.viewKey == "myRepresentations"
? "Created"
: t("search:searchresults-status-label")}
</dd>
</div>
+8 -8
View File
@@ -98,9 +98,9 @@ let BuildCheckSection = (props) => {
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list">
<div className="govuk-summary-list__row" key={"9999"}>
<dt className="govuk-summary-list__key">
{props.props.appealType.fileList.files.length >
{props.props.appealType.fileList.value.length >
0
? props.props.appealType.fileList.files.map(
? props.props.appealType.fileList.value.map(
(blob, i) => (
<div
key={blob.name + "_" + i}
@@ -108,10 +108,10 @@ let BuildCheckSection = (props) => {
>
<img
src={getThumbnailIconByExtension(
blob.name
blob[i].name
)}
alt={blob.name.slice(
blob.name.indexOf(
alt={blob[i].name.slice(
blob[i].name.indexOf(
"_"
) + 1
)}
@@ -119,14 +119,14 @@ let BuildCheckSection = (props) => {
/>
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{blob.name.slice(
blob.name.indexOf(
{blob[i].name.slice(
blob[i].name.indexOf(
"_"
) + 1
)}
(
{bytesToSize(
blob.contentLength
blob[i].contentLength
)}
)
</span>
+2 -2
View File
@@ -228,8 +228,8 @@ export const getProgressObj = (
"totalFields": formObj[key].fieldsTotal,
"allFieldsComplete":
titleList[key].value == "Upload documents"
? _.has(props.props.appealType.fileList, "files") &&
props.props.appealType.fileList.files.length > 0
? _.has(props.props.appealType.fileList, "value") &&
props.props.appealType.fileList.value.length > 0
: rowCount == formObj[key].fieldsTotal,
};
});
+1 -1
View File
@@ -16,7 +16,7 @@
"add-files-label": "Add your files",
"capacity-para-one": "This form enables you to submit comments on a case to Planning and Environment Decisions Wales.",
"capacity-para-two": "Please note that comments from interested parties need to be made within the timetable. This can be found on the previous &lsquo;Case Summary&lsquo; page. Comments submitted after this date may be considered invalid.",
"capacity-select-your-details": "EiYour details",
"capacity-select-your-details": "Your details",
"capacity-select-what-capacity-label": "In what capacity do you wish to make representations on this case?",
"capacity-options-arr-appellant": "Appellant",
"capacity-options-arr-agent": "Agent",
@@ -13,21 +13,25 @@ ApiProxy.use(middleware);
ApiProxy.get(async (req, res) => {
var containerName = req.query.container;
var tempCaseRef = req.query.tempcaseref;
var checkHash = req.query.hash;
console.log("/////Create Case Message:\n", tempCaseRef, "\n//////////////");
// console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
var checkquerypath =
"/api/file/createappealcompletemessage_api?container=" +
containerName +
"&tempcaseref=" +
tempCaseRef;
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
await createCaseCompleteMessage(containerName, tempCaseRef).then(
(data) => {
return res.status(200).json(data);
}
);
} else {
return res.status(400).json();
}
//http: if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
await createCaseCompleteMessage(containerName, tempCaseRef).then((data) => {
return res.status(200).json(data);
});
// } else {
// return res.status(400).json();
// }
});
export const config = {