From 1da557598c287d3c01bb0e89c95bcbb0533de144 Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Fri, 1 Dec 2023 15:38:18 -0800 Subject: [PATCH 1/9] Add filter for closed requests with OIPC flag --- .../request_api/models/FOIMinistryRequests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/request-management-api/request_api/models/FOIMinistryRequests.py b/request-management-api/request_api/models/FOIMinistryRequests.py index 8abc19dc7..7ac646528 100644 --- a/request-management-api/request_api/models/FOIMinistryRequests.py +++ b/request-management-api/request_api/models/FOIMinistryRequests.py @@ -562,7 +562,7 @@ def getrequestssubquery(cls, groups, filterfields, keyword, additionalfilter, us SubjectCode, SubjectCode.subjectcodeid == FOIMinistryRequestSubjectCode.subjectcodeid, isouter=True - ).filter(FOIMinistryRequest.requeststatusid != 3) + ).filter(or_(FOIMinistryRequest.requeststatusid != 3, and_(FOIMinistryRequest.isoipcreview == True, FOIMinistryRequest.requeststatusid == 3))) if(additionalfilter == 'watchingRequests'): #watchby From 4b7c8c903f4d09615af0e0323d156e98dd9d6b45 Mon Sep 17 00:00:00 2001 From: "sumathi.thirumani" Date: Fri, 8 Dec 2023 22:01:29 -0800 Subject: [PATCH 2/9] Changes to fix the duplicates in advanced search. --- .../request_api/models/FOIMinistryRequests.py | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/request-management-api/request_api/models/FOIMinistryRequests.py b/request-management-api/request_api/models/FOIMinistryRequests.py index 89f7039e7..57eed14db 100644 --- a/request-management-api/request_api/models/FOIMinistryRequests.py +++ b/request-management-api/request_api/models/FOIMinistryRequests.py @@ -493,7 +493,7 @@ def getrequestssubquery(cls, groups, filterfields, keyword, additionalfilter, us ministry_restricted_requests.isrestricted.label('isministryrestricted'), SubjectCode.name.label('subjectcode'), FOIMinistryRequest.isoipcreview.label('isoipcreview'), - FOIRequestOIPC.oipcno.label('oipc_number') + literal(None).label('oipc_number'), ] basequery = _session.query( @@ -564,11 +564,9 @@ def getrequestssubquery(cls, groups, filterfields, keyword, additionalfilter, us SubjectCode, SubjectCode.subjectcodeid == FOIMinistryRequestSubjectCode.subjectcodeid, isouter=True - ).join( - FOIRequestOIPC, - and_(FOIRequestOIPC.foiministryrequest_id == FOIMinistryRequest.foiministryrequestid, FOIRequestOIPC.foiministryrequestversion_id == FOIMinistryRequest.version), - isouter=True ).filter(or_(FOIMinistryRequest.requeststatusid != 3, and_(FOIMinistryRequest.isoipcreview == True, FOIMinistryRequest.requeststatusid == 3))) + + if(additionalfilter == 'watchingRequests'): #watchby @@ -675,8 +673,7 @@ def findfield(cls, x, iaoassignee, ministryassignee): 'requestPageCount': FOIMinistryRequest.requestpagecount, 'closedate': FOIMinistryRequest.closedate, 'subjectcode': SubjectCode.name, - 'isoipcreview': FOIMinistryRequest.isoipcreview, - 'oipc_number': FOIRequestOIPC.oipcno + 'isoipcreview': FOIMinistryRequest.isoipcreview }.get(x, FOIMinistryRequest.axisrequestid) @classmethod @@ -1047,7 +1044,7 @@ def getbasequery(cls, iaoassignee, ministryassignee, userid=None, requestby='IAO ministry_restricted_requests.isrestricted.label('isministryrestricted'), SubjectCode.name.label('subjectcode'), FOIMinistryRequest.isoipcreview.label('isoipcreview'), - FOIRequestOIPC.oipcno.label('oipc_number') + literal(None).label('oipc_number') ] basequery = _session.query( @@ -1118,11 +1115,8 @@ def getbasequery(cls, iaoassignee, ministryassignee, userid=None, requestby='IAO SubjectCode, SubjectCode.subjectcodeid == FOIMinistryRequestSubjectCode.subjectcodeid, isouter=True - ).join( - FOIRequestOIPC, - and_(FOIRequestOIPC.foiministryrequest_id == FOIMinistryRequest.foiministryrequestid, FOIRequestOIPC.foiministryrequestversion_id == FOIMinistryRequest.version), - isouter=True ) + if(isiaorestrictedfilemanager == True or isministryrestrictedfilemanager == True): dbquery = basequery.filter(ministryfilter) @@ -1319,6 +1313,15 @@ def getfilterforsearch(cls, params, iaoassignee, ministryassignee): searchcondition1.append(FOIMinistryRequest.findfield('assignedministrypersonFirstName', iaoassignee, ministryassignee).ilike('%'+keyword+'%')) searchcondition2.append(FOIMinistryRequest.findfield('assignedministrypersonLastName', iaoassignee, ministryassignee).ilike('%'+keyword+'%')) return or_(and_(*searchcondition1), and_(*searchcondition2)) + elif(params['search'] == 'oipc_number'): + searchcondition1 = [] + searchcondition2 = [] + searchcondition3 = [] + for keyword in params['keywords']: + searchcondition1.append(FOIRequestOIPC.foiministryrequest_id == FOIMinistryRequest.foiministryrequestid) + searchcondition2.append(FOIRequestOIPC.foiministryrequestversion_id == FOIMinistryRequest.version) + searchcondition3.append(FOIRequestOIPC.oipcno.ilike('%'+keyword+'%')) + return and_(and_(*searchcondition1), and_(*searchcondition2), and_(*searchcondition3)) else: searchcondition = [] for keyword in params['keywords']: From e66e553998aad44ae81f4d95ff853d67adbb5ed0 Mon Sep 17 00:00:00 2001 From: "sumathi.thirumani" Date: Fri, 8 Dec 2023 23:52:54 -0800 Subject: [PATCH 3/9] Changes to return extact match --- .../request_api/models/FOIMinistryRequests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/request-management-api/request_api/models/FOIMinistryRequests.py b/request-management-api/request_api/models/FOIMinistryRequests.py index 57eed14db..320affb59 100644 --- a/request-management-api/request_api/models/FOIMinistryRequests.py +++ b/request-management-api/request_api/models/FOIMinistryRequests.py @@ -1320,7 +1320,7 @@ def getfilterforsearch(cls, params, iaoassignee, ministryassignee): for keyword in params['keywords']: searchcondition1.append(FOIRequestOIPC.foiministryrequest_id == FOIMinistryRequest.foiministryrequestid) searchcondition2.append(FOIRequestOIPC.foiministryrequestversion_id == FOIMinistryRequest.version) - searchcondition3.append(FOIRequestOIPC.oipcno.ilike('%'+keyword+'%')) + searchcondition3.append(FOIRequestOIPC.oipcno==keyword) return and_(and_(*searchcondition1), and_(*searchcondition2), and_(*searchcondition3)) else: searchcondition = [] From 41eaaec0ad61209b7c82432ff7162b2bc306cee7 Mon Sep 17 00:00:00 2001 From: "sumathi.thirumani" Date: Sat, 9 Dec 2023 00:42:11 -0800 Subject: [PATCH 4/9] Changes to fix the duplicates in advanced search. --- .../request_api/models/FOIMinistryRequests.py | 9 ++++----- .../request_api/models/FOIRequestOIPC.py | 8 ++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/request-management-api/request_api/models/FOIMinistryRequests.py b/request-management-api/request_api/models/FOIMinistryRequests.py index 320affb59..dc25bc8ac 100644 --- a/request-management-api/request_api/models/FOIMinistryRequests.py +++ b/request-management-api/request_api/models/FOIMinistryRequests.py @@ -1316,12 +1316,11 @@ def getfilterforsearch(cls, params, iaoassignee, ministryassignee): elif(params['search'] == 'oipc_number'): searchcondition1 = [] searchcondition2 = [] - searchcondition3 = [] for keyword in params['keywords']: - searchcondition1.append(FOIRequestOIPC.foiministryrequest_id == FOIMinistryRequest.foiministryrequestid) - searchcondition2.append(FOIRequestOIPC.foiministryrequestversion_id == FOIMinistryRequest.version) - searchcondition3.append(FOIRequestOIPC.oipcno==keyword) - return and_(and_(*searchcondition1), and_(*searchcondition2), and_(*searchcondition3)) + oipccondition = FOIRequestOIPC.getrequestidsbyoipcno(keyword) + searchcondition1.append(oipccondition.c.foiministryrequest_id == FOIMinistryRequest.foiministryrequestid) + searchcondition2.append(oipccondition.c.foiministryrequestversion_id == FOIMinistryRequest.version) + return and_(and_(*searchcondition1), and_(*searchcondition2)) else: searchcondition = [] for keyword in params['keywords']: diff --git a/request-management-api/request_api/models/FOIRequestOIPC.py b/request-management-api/request_api/models/FOIRequestOIPC.py index a68407b9f..7add3afcd 100644 --- a/request-management-api/request_api/models/FOIRequestOIPC.py +++ b/request-management-api/request_api/models/FOIRequestOIPC.py @@ -47,6 +47,14 @@ def getoipc(cls,ministryrequestid,ministryrequestversion): divisioninfos = oipc_schema.dump(_oipclist) return divisioninfos + + @classmethod + def getrequestidsbyoipcno(cls, oipcno): + return db.session.query( + FOIRequestOIPC.foiministryrequest_id, + FOIRequestOIPC.foiministryrequestversion_id + ).filter(FOIRequestOIPC.oipcno.ilike('%'+oipcno+'%')).group_by(FOIRequestOIPC.foiministryrequest_id, FOIRequestOIPC.foiministryrequestversion_id).subquery() + class FOIRequestOIPCSchema(ma.Schema): class Meta: From df4a59706c1461e48904621b760e2f63ddaf09b1 Mon Sep 17 00:00:00 2001 From: Aman-Hundal Date: Mon, 11 Dec 2023 11:47:56 -0800 Subject: [PATCH 5/9] Bug fix for Jackie UX comments. adding a new oipc now does not trigger a reload of the page --- .../src/components/FOI/FOIRequest/OIPCDetails/Index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/Index.jsx b/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/Index.jsx index 2d02e79e8..25248d58b 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/Index.jsx +++ b/forms-flow-web/src/components/FOI/FOIRequest/OIPCDetails/Index.jsx @@ -33,7 +33,10 @@ const OIPCDetails = (props) => {
-

Add Additional OIPC Complaint

From 04b95a4df3aa30bb224322f219857c9688a97d99 Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Mon, 11 Dec 2023 13:22:26 -0800 Subject: [PATCH 6/9] Change OIPC flag outline color and requestflag layout --- .../src/components/FOI/FOIRequest/FOIRequestHeader/index.js | 1 - .../src/components/FOI/customComponents/requestflag.scss | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js index 69c3ed18f..bfd71381a 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js @@ -288,7 +288,6 @@ const FOIRequestHeader = React.memo( }
-
Date: Mon, 11 Dec 2023 13:25:38 -0800 Subject: [PATCH 7/9] Remove closing div tag --- .../src/components/FOI/FOIRequest/FOIRequestHeader/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js index bfd71381a..85eb075a9 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js @@ -302,7 +302,6 @@ const FOIRequestHeader = React.memo( isActive={requestDetails.isphasedrelease} handleSelect={handleOipcReviewFlagChange} /> */} -
{showMinistryAssignedTo && ( From e473e2ca0c8eda04a206df8417f74537172c063e Mon Sep 17 00:00:00 2001 From: Milos Despotovic Date: Mon, 11 Dec 2023 16:45:46 -0800 Subject: [PATCH 8/9] Add responsiveness and update ministry view --- .../FOI/FOIRequest/FOIRequestHeader/index.js | 80 +++++++++++-------- .../MinistryReview/RequestHeader.js | 39 +++++---- .../FOI/customComponents/Watcher.scss | 5 +- 3 files changed, 70 insertions(+), 54 deletions(-) diff --git a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js index 85eb075a9..c6e46aa8f 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/FOIRequestHeader/index.js @@ -23,6 +23,7 @@ import _ from 'lodash'; import RequestRestriction from "../../customComponents/RequestRestriction"; import ConfirmModal from "../../customComponents/ConfirmModal"; import RequestFlag from '../../customComponents/RequestFlag'; +import { Grid } from '@material-ui/core'; const useStyles = makeStyles((theme) => ({ formControl: { @@ -265,43 +266,52 @@ const FOIRequestHeader = React.memo(
-
- {window.location.href.indexOf(FOI_COMPONENT_CONSTANTS.ADDREQUEST) === - -1 && ( - + + +
+ {window.location.href.indexOf(FOI_COMPONENT_CONSTANTS.ADDREQUEST) === + -1 && ( + + )} + {!isAddRequest && status.toLowerCase() !== StateEnum.unopened.name.toLowerCase() && (isIAORestrictedFileManager() || + (isLoaded && isRequestWatcherOrAssignee(requestWatchers,assigneeObj,userDetail?.preferred_username))) && + + + } +
+
+ +
+ - )} - {!isAddRequest && status.toLowerCase() !== StateEnum.unopened.name.toLowerCase() && (isIAORestrictedFileManager() || - (isLoaded && isRequestWatcherOrAssignee(requestWatchers,assigneeObj,userDetail?.preferred_username))) && - - - } + {/* */} +
+
+
-
- - {/* */}
{showMinistryAssignedTo && ( diff --git a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/RequestHeader.js b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/RequestHeader.js index 325d7007b..6bf01c04b 100644 --- a/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/RequestHeader.js +++ b/forms-flow-web/src/components/FOI/FOIRequest/MinistryReview/RequestHeader.js @@ -1,5 +1,5 @@ import React, {useEffect, useState} from 'react'; -import { InputLabel } from '@material-ui/core'; +import { Grid, InputLabel } from '@material-ui/core'; import Link from '@material-ui/core/Link'; import TextField from '@material-ui/core/TextField'; import MinistryAssignToDropdown from '../MinistryAssignToDropdown'; @@ -108,6 +108,7 @@ const RequestHeader = React.memo(({ type="oipcreview" requestDetails={requestDetails} isActive={requestDetails.isoipcreview} + isDisabled={true} /> {/*
-
- {watcherBox} - { - (isLoaded && (isRequestWatcherOrMinistryAssignee(requestWatchers,ministryAssigneeValue,userDetail?.preferred_username) || - isMinistryRestrictedFileManager())) && - - } -
-
-
- {requestFlagsBox} -
+
+ + + {watcherBox} + { + (isLoaded && (isRequestWatcherOrMinistryAssignee(requestWatchers,ministryAssigneeValue,userDetail?.preferred_username) || + isMinistryRestrictedFileManager())) && + + } + + +
+ {requestFlagsBox} +
+
+
diff --git a/forms-flow-web/src/components/FOI/customComponents/Watcher.scss b/forms-flow-web/src/components/FOI/customComponents/Watcher.scss index 975751b07..9f674e35a 100644 --- a/forms-flow-web/src/components/FOI/customComponents/Watcher.scss +++ b/forms-flow-web/src/components/FOI/customComponents/Watcher.scss @@ -27,7 +27,7 @@ } .foi-eye-container { - width: auto; + width: 100px; height: 40px; background-color: #00336652; border-radius: 40px 0px 0px 40px; @@ -38,11 +38,12 @@ .foi-watcher-all { padding-top: 10px; display: flex; + width: 188px; } .foi-watcher-select { padding-top: 8px; - width: 80px; + width: 100px; height: 40px; background-color:#003366; color: white; From d6bed4cef0c81d24a55f23fe77b26af16635939c Mon Sep 17 00:00:00 2001 From: "sumathi.thirumani" Date: Mon, 11 Dec 2023 17:45:52 -0800 Subject: [PATCH 9/9] Remove reduntant property --- request-management-api/request_api/models/FOIRequestOIPC.py | 2 +- .../request_api/services/foirequest/requestservicebuilder.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/request-management-api/request_api/models/FOIRequestOIPC.py b/request-management-api/request_api/models/FOIRequestOIPC.py index 7add3afcd..2931a304a 100644 --- a/request-management-api/request_api/models/FOIRequestOIPC.py +++ b/request-management-api/request_api/models/FOIRequestOIPC.py @@ -59,5 +59,5 @@ def getrequestidsbyoipcno(cls, oipcno): class FOIRequestOIPCSchema(ma.Schema): class Meta: fields = ('oipcid', 'version', 'ministryrequestid', 'investigator','ministryversion','oipcno','reviewtypeid','reasonid','statusid','outcomeid','isinquiry','inquiryattributes','isjudicialreview', - 'issubsequentappeal','isactive','receiveddate','closeddate','created_at','createdby','updated_at','updatedby', + 'issubsequentappeal','receiveddate','closeddate','created_at','createdby','updated_at','updatedby', 'reviewtype.name', 'reason.name', 'status.name', 'outcome.name') \ No newline at end of file diff --git a/request-management-api/request_api/services/foirequest/requestservicebuilder.py b/request-management-api/request_api/services/foirequest/requestservicebuilder.py index b6315671b..dd1a0516b 100644 --- a/request-management-api/request_api/services/foirequest/requestservicebuilder.py +++ b/request-management-api/request_api/services/foirequest/requestservicebuilder.py @@ -151,7 +151,6 @@ def prepareoipc(self, requestschema, ministryrequestid, version, userid): oipcreview.issubsequentappeal = oipc["issubsequentappeal"] oipcreview.receiveddate = oipc["receiveddate"] if oipc["receiveddate"] not in (None, "") else None oipcreview.closeddate = oipc["closeddate"] if oipc["closeddate"] not in (None, "") else None - oipcreview.isactive = True if oipc["isinquiry"] == True: oipcreview.inquiryattributes = oipc["inquiryattributes"] oipcreview.createdby=userid