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 useTranslation from "next-translate/useTranslation";
|
||||||
import { formatDates } from "../utils";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { getLifecycleStagesForCase } from "../../lib/domain/case-lifecycle";
|
import { getLifecycleStagesForCase } from "../../lib/domain/case-lifecycle";
|
||||||
|
|
||||||
@@ -23,30 +19,20 @@ const statusTextMap = {
|
|||||||
const StatusDetails = (props) => {
|
const StatusDetails = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const specialistProcess =
|
const caseResult = props.searchResultsObj?.value?.[0];
|
||||||
props.searchResultsObj?.searchDetailsObj[0]?.value[0]
|
const caseDetails = props.searchDetailsObj?.[0]?.value?.[0];
|
||||||
?.pinswg_specialistcaseprocess;
|
|
||||||
|
|
||||||
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(
|
const stages = getLifecycleStagesForCase(
|
||||||
props.currentView?.caseReference?.appealType,
|
appealType,
|
||||||
props.currentView?.caseReference?.statuscode,
|
statusCode,
|
||||||
specialistProcess
|
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) {
|
function hasOwnPropertyAndNotNull(obj, property) {
|
||||||
return obj.hasOwnProperty(property) && obj[property] !== null;
|
return obj.hasOwnProperty(property) && obj[property] !== null;
|
||||||
}
|
}
|
||||||
@@ -141,21 +127,4 @@ const StatusDetails = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
export default StatusDetails;
|
||||||
return {
|
|
||||||
...state
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => {
|
|
||||||
return {
|
|
||||||
setEventDetails: (eventsObj) => {
|
|
||||||
dispatch(setEventDetails(eventsObj));
|
|
||||||
},
|
|
||||||
setCurrentPage: (currentPage) => {
|
|
||||||
dispatch(setCurrentPage(currentPage));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(StatusDetails);
|
|
||||||
|
|||||||
@@ -2032,7 +2032,10 @@ const CaseSummary = (props) => {
|
|||||||
}
|
}
|
||||||
id="case-status"
|
id="case-status"
|
||||||
>
|
>
|
||||||
<StatusDetails />
|
<StatusDetails
|
||||||
|
searchResultsObj={props.searchResultsObj}
|
||||||
|
searchDetailsObj={props.searchDetailsObj}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user