From e2897e511f9eba022dbfbe60c21593291f9f9553 Mon Sep 17 00:00:00 2001 From: Robert Bond Date: Wed, 15 Jul 2026 16:43:43 +0000 Subject: [PATCH] Merged PR 2480: update status from page load not state update status from page load not state Related work items: #24297 --- components/case/status.js | 49 +++++++------------------------------- components/case/summary.js | 5 +++- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/components/case/status.js b/components/case/status.js index e681316b..f073f097 100644 --- a/components/case/status.js +++ b/components/case/status.js @@ -1,8 +1,4 @@ -import { setEventDetails } from "../../store/searchOutput/action"; -import { setCurrentPage } from "../../store/currentView/action"; -import { connect } from "react-redux"; import useTranslation from "next-translate/useTranslation"; -import { formatDates } from "../utils"; import { useState } from "react"; import { getLifecycleStagesForCase } from "../../lib/domain/case-lifecycle"; @@ -23,30 +19,20 @@ const statusTextMap = { const StatusDetails = (props) => { let { t } = useTranslation(); - const specialistProcess = - props.searchResultsObj?.searchDetailsObj[0]?.value[0] - ?.pinswg_specialistcaseprocess; + const caseResult = props.searchResultsObj?.value?.[0]; + const caseDetails = props.searchDetailsObj?.[0]?.value?.[0]; - console.log(props.currentView?.caseReference?.statuscode); + const statusCode = Number(caseResult?.statuscode); + const appealType = Number(caseResult?.pinswg_appealcasetype); + + const specialistProcess = caseDetails?.pinswg_specialistcaseprocess; const stages = getLifecycleStagesForCase( - props.currentView?.caseReference?.appealType, - props.currentView?.caseReference?.statuscode, + appealType, + statusCode, specialistProcess ); - const EventView = (eventsArr) => { - eventsArr = eventsArr.value; - - return eventsArr.map((item, key) => { -
{item.pinswg_name}
; - }); - }; - - const eventsArr = props.eventsObj?.value || []; - - // event publishiing flag set to true displa - function hasOwnPropertyAndNotNull(obj, property) { return obj.hasOwnProperty(property) && obj[property] !== null; } @@ -141,21 +127,4 @@ const StatusDetails = (props) => { ); }; -const mapStateToProps = (state) => { - return { - ...state - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - setEventDetails: (eventsObj) => { - dispatch(setEventDetails(eventsObj)); - }, - setCurrentPage: (currentPage) => { - dispatch(setCurrentPage(currentPage)); - } - }; -}; - -export default connect(mapStateToProps, mapDispatchToProps)(StatusDetails); +export default StatusDetails; diff --git a/components/case/summary.js b/components/case/summary.js index 32bbd1e3..41a5622b 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -2032,7 +2032,10 @@ const CaseSummary = (props) => { } id="case-status" > - +