added props and included generic copy of state

This commit is contained in:
2024-06-05 13:39:35 +01:00
parent 557d81110a
commit 8f08ce35df
3 changed files with 40 additions and 32 deletions
+1
View File
@@ -22,6 +22,7 @@ const MyCases = (props) => {
showTopThree={props.myCases.myCases} showTopThree={props.myCases.myCases}
showDetails={props.myCases.myCasesDetails} showDetails={props.myCases.myCasesDetails}
topThreeType={"myCases"} topThreeType={"myCases"}
props={props}
/> />
</div> </div>
{props.myCases.myCases["@odata.count"] > 3 && ( {props.myCases.myCases["@odata.count"] > 3 && (
+1
View File
@@ -25,6 +25,7 @@ const MyRepresentations = (props) => {
props.myRepresentations.myRepresentationsDetails props.myRepresentations.myRepresentationsDetails
} }
topThreeType={"myRepresentations"} topThreeType={"myRepresentations"}
props={props}
/> />
</div> </div>
+38 -32
View File
@@ -199,46 +199,52 @@ const TopThree = (props) => {
showTopThreeArr[key].incidentid showTopThreeArr[key].incidentid
: router.locale == "cy" : router.locale == "cy"
? "/fymhorth/achos/" + ? "/fymhorth/achos/" +
showTopThreeArr[key].pinswg_title showTopThreeArr[key].pinswg_title +
"?key=" +
topThreeType
: "/myportal/case/" + : "/myportal/case/" +
showTopThreeArr[key].pinswg_title showTopThreeArr[key].pinswg_title +
"?key=" +
topThreeType
} }
className="govuk-link--no-underline" className="govuk-link--no-underline"
data-id={index} data-id={index}
onClick={() => { onClick={() => {
setSearchResults( setSearchResults(
props.props.watchedCases.watchedCases props.props[topThreeType][topThreeType]
); ),
setSearchDetails( setSearchDetails(
props.props.watchedCases props.props[topThreeType][
.watchedCasesDetails topThreeType + "Details"
); ]
setCurrentReference({
"ticketnumber":
showTopThreeArr[key].ticketnumber,
"currentReference":
topThreeType != "watchedCases"
? topThreeType !=
"myRepresentations"
? showTopThreeArr[key]
.ticketnumber
: showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
]
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
],
"currentType": topThreeType,
"incidentid": getIncidentId(
topThreeType,
showTopThreeArr[key]
), ),
setCurrentReference({
"ticketnumber":
showTopThreeArr[key]
.ticketnumber,
"currentReference":
topThreeType != "watchedCases"
? topThreeType !=
"myRepresentations"
? showTopThreeArr[key]
.ticketnumber
: showTopThreeArr[key][
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
]
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
],
"currentType": topThreeType,
"appealType": "incidentid": getIncidentId(
showTopThreeArr[key] topThreeType,
.pinswg_appealcasetype, showTopThreeArr[key]
}); ),
"appealType":
showTopThreeArr[key]
.pinswg_appealcasetype,
});
}} }}
> >
{topThreeType != "watchedCases" {topThreeType != "watchedCases"