diff --git a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js index 8e8cc00c1..bb181645c 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js @@ -18,10 +18,6 @@ import { import { fetchFOIMinistryAssignedToList, fetchFOIPersonalDivisionsAndSections, - fetchOIPCInquiryoutcomes, - fetchOIPCOutcomes, - fetchOIPCReviewtypes, - fetchOIPCStatuses, } from "../../../../apiManager/services/FOI/foiMasterDataServices"; import { fetchFOIRequestAttachmentsList } from "../../../../apiManager/services/FOI/foiAttachmentServices"; @@ -66,8 +62,6 @@ import { UnsavedModal } from "../../customComponents"; import { DISABLE_GATHERINGRECORDS_TAB } from "../../../../constants/constants"; import _ from "lodash"; import { MinistryNeedsScanning } from "../../../../constants/FOI/enum"; -import OIPCDetails from "../OIPCDetails/Index"; -import useOIPCHook from "../OIPCDetails/oipcHook"; const useStyles = makeStyles((theme) => ({ root: { @@ -114,7 +108,6 @@ const MinistryReview = React.memo(({ userDetail }) => { const [_currentrequestStatus, setcurrentrequestStatus] = React.useState(""); const [_tabStatus, settabStatus] = React.useState(requestState); - const {oipcData, addOIPC, removeOIPC, updateOIPC, isOIPCReview, setIsOIPCReview} = useOIPCHook(); //gets the request detail from the store const IsDivisionalCoordinator = () => { @@ -218,12 +211,6 @@ const MinistryReview = React.memo(({ userDetail }) => { dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId)); dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId)); dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId)); - - dispatch(fetchOIPCOutcomes()); - dispatch(fetchOIPCStatuses()); - dispatch(fetchOIPCReviewtypes()); - dispatch(fetchOIPCInquiryoutcomes()); - fetchCFRForm(ministryId, dispatch); if (bcgovcode) dispatch(fetchFOIMinistryAssignedToList(bcgovcode)); } @@ -332,11 +319,6 @@ const MinistryReview = React.memo(({ userDetail }) => { hasincompleteDivstage || !hasReceivedDate; - const isOipcReviewValidationError = (oipcData?.length > 0 && requestDetails.isoipcreview && oipcData?.some((oipc) => { - return oipc.oipcno === "" || oipc.receiveddate === null || oipc.receiveddate === "" || oipc.reviewtypeid === null || oipc.reasonid === null || oipc.statusid === null || - oipc.inquiryattributes?.orderno === "" || oipc.inquiryattributes?.inquiryoutcome === null || oipc.inquiryattributes?.inquirydate === null || oipc.inquiryattributes?.inquirydate === ""; - })) - const createMinistrySaveRequestObject = (_propName, _value, _value2) => { const requestObject = { ...saveMinistryRequestObject }; setUnSavedRequest(true); @@ -601,19 +583,6 @@ const MinistryReview = React.memo(({ userDetail }) => { (state) => state.foiRequests.showEventQueue ); - const oipcSectionRef = React.useRef(null); - const handleOipcReviewFlagChange = (isSelected) => { - setIsOIPCReview(isSelected); - requestDetails.isoipcreview = isSelected; - oipcSectionRef.current.scrollIntoView(); - //timeout to allow react state to update after setState call - if (isSelected) { - setTimeout(() => { - oipcSectionRef.current.scrollIntoView(); - }, (10)); - } - } - return !isLoading && requestDetails && Object.keys(requestDetails).length !== 0 && @@ -784,7 +753,6 @@ const MinistryReview = React.memo(({ userDetail }) => { setSaveMinistryRequestObject } ministryAssigneeValue={ministryAssignedToValue} - handleOipcReviewFlagChange={handleOipcReviewFlagChange} /> @@ -800,20 +768,11 @@ const MinistryReview = React.memo(({ userDetail }) => { /> {divisionsBox} {/* */} -
- {isOIPCReview && requestState && requestState.toLowerCase() !== StateEnum.intakeinprogress.name.toLowerCase() && requestState.toLowerCase() !== StateEnum.unopened.name.toLowerCase() && ( - - )} { const { requestId, ministryId } = useParams(); const _requestDetails = requestDetails; @@ -109,7 +108,6 @@ const RequestHeader = React.memo(({ type="oipcreview" requestDetails={requestDetails} isActive={requestDetails.isoipcreview} - handleSelect={handleOipcReviewFlagChange} /> {/* { const [modalMessage, setModalMessage] = useState(""); const [modalDescription, setModalDescription] = useState(""); - const { requestId, ministryId } = useParams(); - - const dispatch = useDispatch(); + useEffect(() => { + setIsSelected(isActive); + }, [isActive]) // These need to be set for each type let options;