diff --git a/components/case/representation/index.js b/components/case/representation/index.js index 192b589a..8d85a1e0 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -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 diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js index 6d2aa981..dad94159 100644 --- a/components/myportal/topthree_reps.js +++ b/components/myportal/topthree_reps.js @@ -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(