From 94a9b0130cb05aa6407e9f0010ce37e2edc2d95e Mon Sep 17 00:00:00 2001 From: Aman-Hundal Date: Thu, 11 Jul 2024 14:16:28 -0700 Subject: [PATCH] IAO Workflow for state lock records completed. WIP manual lock records for IAO --- .../src/components/FOI/FOIRequest/BottomButtonGroup/index.js | 5 +---- forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js | 4 +++- .../request_api/services/foirequest/requestservicebuilder.py | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/forms-flow-web/src/components/FOI/FOIRequest/BottomButtonGroup/index.js b/forms-flow-web/src/components/FOI/FOIRequest/BottomButtonGroup/index.js index 38221aab5..5d1f0d991 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/BottomButtonGroup/index.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/BottomButtonGroup/index.js @@ -123,12 +123,9 @@ const BottomButtonGroup = React.memo( //Logic to change lock records to null (and have FE useEffect in FOIRequest.js/MinistryView.js logic takeover) if request goes back to open, cfr, harms, fee estimate, dedup if (!validLockRecordsState(currentSelectedStatus)) { - console.log("GOT YA") - saveRequestObject.lockrecords = true; + saveRequestObject.lockrecords = null; } - console.log("SAVE PBJ", saveRequestObject) - //add oipc Data to save request object and sync/validate isoipcreview attribute if (requestState.toLowerCase() !== StateEnum.intakeinprogress.name.toLowerCase() && requestState.toLowerCase() !== StateEnum.unopened.name.toLowerCase()) { saveRequestObject.oipcdetails = oipcData ? oipcData : []; diff --git a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js index a241fc4b5..4c41534f8 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js @@ -395,7 +395,9 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => { //Adjust lockRecords value based on requestState if there is no manual user lockrecords value present in requestDetails from DB const updateRecordsTabAccess = () => { if(requestDetails.lockrecords === null) { - return validLockRecordsState(requestDetails.currentState) + return validLockRecordsState(requestDetails.currentState); + } else { + return requestDetails.lockrecords; } } setLockRecordsTab(updateRecordsTabAccess()); diff --git a/request-management-api/request_api/services/foirequest/requestservicebuilder.py b/request-management-api/request_api/services/foirequest/requestservicebuilder.py index 31dca5387..2da57d7bd 100644 --- a/request-management-api/request_api/services/foirequest/requestservicebuilder.py +++ b/request-management-api/request_api/services/foirequest/requestservicebuilder.py @@ -54,6 +54,7 @@ def createministry(self, requestschema, ministry, activeversion, userid, filenum foiministryrequest.startdate = startdate foiministryrequest.createdby = userid requeststatuslabel = self.getpropertyvaluefromschema(requestschema, 'requeststatuslabel') + foiministryrequest.lockrecords = requestschema.get("lockrecords") if requeststatuslabel is not None: status = self.getstatusname(requeststatuslabel) if self.isNotBlankorNone(requestschema,"fromDate","main") == True: