From a554b03f7f1e6b6fa53465db76d3dd1d8dad8023 Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Wed, 29 Nov 2023 14:28:01 -0800 Subject: [PATCH 1/8] Remove OIPC from ministry view --- .../MinistryReview/MinistryReview.js | 26 ------------------- .../MinistryReview/RequestHeader.js | 5 +--- 2 files changed, 1 insertion(+), 30 deletions(-) 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 ee57d2c08..bb181645c 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/MinistryReview.js @@ -62,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: { @@ -110,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 = () => { @@ -586,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 && @@ -769,7 +753,6 @@ const MinistryReview = React.memo(({ userDetail }) => { setSaveMinistryRequestObject } ministryAssigneeValue={ministryAssignedToValue} - handleOipcReviewFlagChange={handleOipcReviewFlagChange} /> @@ -785,15 +768,6 @@ 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,13 +108,11 @@ const RequestHeader = React.memo(({ type="oipcreview" requestDetails={requestDetails} isActive={requestDetails.isoipcreview} - handleSelect={handleOipcReviewFlagChange} /> console.log('selected')} /> ); From 59bf1eb7ed0a9dac3f76f51d63eb613e4667f90e Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Wed, 29 Nov 2023 17:06:39 -0800 Subject: [PATCH 2/8] Add useEffect to sync flag to state --- .../src/components/FOI/customComponents/RequestFlag.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js b/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js index 1109fe8b4..dc1ab85dc 100644 --- a/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js +++ b/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import "./requestflag.scss"; import OutlinedInput from "@material-ui/core/OutlinedInput"; import MenuItem from "@material-ui/core/MenuItem"; @@ -28,6 +28,10 @@ const RequestFlag = ({ isActive, type, handleSelect, showFlag = true }) => { const { requestId, ministryId } = useParams(); + useEffect(() => { + setIsSelected(isActive); + }, [isActive]) + const dispatch = useDispatch(); // These need to be set for each type From 2c036198cea660b5e678e5801cdda485702e5fb7 Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Thu, 30 Nov 2023 09:23:42 -0800 Subject: [PATCH 3/8] Remove OIPC from ministryreview --- .../FOIRequest/MinistryReview/MinistryReview.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) 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 f620c7b60..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"; @@ -215,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)); } @@ -329,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); @@ -787,7 +772,7 @@ const MinistryReview = React.memo(({ userDetail }) => { requestState={requestState} stateChanged={stateChanged} attachmentsArray={requestAttachments} - isValidationError={isValidationError || isOipcReviewValidationError} + isValidationError={isValidationError} saveMinistryRequestObject={saveMinistryRequestObject} unSavedRequest={unSavedRequest} recordsUploading={recordsUploading} From 9ca5ccdae5926081d5ce57a5e151c36bd49174d8 Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Thu, 30 Nov 2023 09:27:50 -0800 Subject: [PATCH 4/8] Remove unused imports --- .../src/components/FOI/customComponents/RequestFlag.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js b/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js index dc1ab85dc..9bfd6cbaa 100644 --- a/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js +++ b/forms-flow-web/src/components/FOI/customComponents/RequestFlag.js @@ -13,8 +13,6 @@ import DialogTitle from "@material-ui/core/DialogTitle"; import CloseIcon from "@material-ui/icons/Close"; import IconButton from "@material-ui/core/IconButton"; import TextField from "@mui/material/TextField"; -import { useParams } from "react-router-dom"; -import { useDispatch } from "react-redux"; //Types are: //oipcreview @@ -26,14 +24,10 @@ const RequestFlag = ({ isActive, type, handleSelect, showFlag = true }) => { const [modalMessage, setModalMessage] = useState(""); const [modalDescription, setModalDescription] = useState(""); - const { requestId, ministryId } = useParams(); - useEffect(() => { setIsSelected(isActive); }, [isActive]) - const dispatch = useDispatch(); - // These need to be set for each type let options; let id; From b4424c575e7f78990305802657688e3b48f777fb Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Thu, 30 Nov 2023 09:47:56 -0800 Subject: [PATCH 5/8] Undo accidental commit --- .../services/external/keycloakadminservice.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/request-management-api/request_api/services/external/keycloakadminservice.py b/request-management-api/request_api/services/external/keycloakadminservice.py index 3a632d34b..57fe4536d 100644 --- a/request-management-api/request_api/services/external/keycloakadminservice.py +++ b/request-management-api/request_api/services/external/keycloakadminservice.py @@ -24,8 +24,8 @@ class KeycloakAdminService: def get_token(self): _accesstoken=None try: - #cache_client = redis.from_url(self.cache_redis_url,decode_responses=True) - _accesstoken = None #cache_client.get("foi:kcsrcacnttoken") + cache_client = redis.from_url(self.cache_redis_url,decode_responses=True) + _accesstoken = cache_client.get("foi:kcsrcacnttoken") if _accesstoken is None: url = '{0}/auth/realms/{1}/protocol/openid-connect/token'.format(self.keycloakhost,self.keycloakrealm) params = { @@ -38,11 +38,11 @@ def get_token(self): } x = requests.post(url, params, verify=True).content.decode('utf-8') _accesstoken = str(ast.literal_eval(x)['access_token']) - #cache_client.set("foi:kcsrcacnttoken",_accesstoken,ex=int(self.kctokenexpiry)) + cache_client.set("foi:kcsrcacnttoken",_accesstoken,ex=int(self.kctokenexpiry)) except BusinessException as exception: print("Error happened while accessing token on KeycloakAdminService {0}".format(exception.message)) - # finally: - # cache_client = None + finally: + cache_client = None return _accesstoken From 05f40331f652a5beffb35f37737303b14f282339 Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Thu, 30 Nov 2023 09:49:48 -0800 Subject: [PATCH 6/8] Match origin/main --- .../request_api/services/external/keycloakadminservice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/request-management-api/request_api/services/external/keycloakadminservice.py b/request-management-api/request_api/services/external/keycloakadminservice.py index 57fe4536d..5b33b04ef 100644 --- a/request-management-api/request_api/services/external/keycloakadminservice.py +++ b/request-management-api/request_api/services/external/keycloakadminservice.py @@ -25,7 +25,7 @@ def get_token(self): _accesstoken=None try: cache_client = redis.from_url(self.cache_redis_url,decode_responses=True) - _accesstoken = cache_client.get("foi:kcsrcacnttoken") + _accesstoken = cache_client.get("foi:kcsrcacnttoken") if _accesstoken is None: url = '{0}/auth/realms/{1}/protocol/openid-connect/token'.format(self.keycloakhost,self.keycloakrealm) params = { @@ -42,7 +42,7 @@ def get_token(self): except BusinessException as exception: print("Error happened while accessing token on KeycloakAdminService {0}".format(exception.message)) finally: - cache_client = None + cache_client = None return _accesstoken From 3b83933e68f52560c48cef416cdeb0cb2ee5105d Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Thu, 30 Nov 2023 09:52:01 -0800 Subject: [PATCH 7/8] Add spaces to match main --- .../request_api/services/external/keycloakadminservice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/request-management-api/request_api/services/external/keycloakadminservice.py b/request-management-api/request_api/services/external/keycloakadminservice.py index 5b33b04ef..f11fa992f 100644 --- a/request-management-api/request_api/services/external/keycloakadminservice.py +++ b/request-management-api/request_api/services/external/keycloakadminservice.py @@ -25,7 +25,7 @@ def get_token(self): _accesstoken=None try: cache_client = redis.from_url(self.cache_redis_url,decode_responses=True) - _accesstoken = cache_client.get("foi:kcsrcacnttoken") + _accesstoken = cache_client.get("foi:kcsrcacnttoken") if _accesstoken is None: url = '{0}/auth/realms/{1}/protocol/openid-connect/token'.format(self.keycloakhost,self.keycloakrealm) params = { @@ -42,7 +42,7 @@ def get_token(self): except BusinessException as exception: print("Error happened while accessing token on KeycloakAdminService {0}".format(exception.message)) finally: - cache_client = None + cache_client = None return _accesstoken From ba3f9b5b07157c24735e039b7099d7770e7a47ae Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Thu, 30 Nov 2023 09:53:01 -0800 Subject: [PATCH 8/8] Add white space --- .../request_api/services/external/keycloakadminservice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/request-management-api/request_api/services/external/keycloakadminservice.py b/request-management-api/request_api/services/external/keycloakadminservice.py index f11fa992f..5ec6af21e 100644 --- a/request-management-api/request_api/services/external/keycloakadminservice.py +++ b/request-management-api/request_api/services/external/keycloakadminservice.py @@ -25,7 +25,7 @@ def get_token(self): _accesstoken=None try: cache_client = redis.from_url(self.cache_redis_url,decode_responses=True) - _accesstoken = cache_client.get("foi:kcsrcacnttoken") + _accesstoken = cache_client.get("foi:kcsrcacnttoken") if _accesstoken is None: url = '{0}/auth/realms/{1}/protocol/openid-connect/token'.format(self.keycloakhost,self.keycloakrealm) params = {