Merged PR 2480: update status from page load not state
update status from page load not state Related work items: #24297
This commit is contained in:
@@ -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) => {
|
||||
<div>{item.pinswg_name}</div>;
|
||||
});
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -2032,7 +2032,10 @@ const CaseSummary = (props) => {
|
||||
}
|
||||
id="case-status"
|
||||
>
|
||||
<StatusDetails />
|
||||
<StatusDetails
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
searchDetailsObj={props.searchDetailsObj}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user