Skip to content

Commit

Permalink
Merge pull request #4875 from bcgov/dev-rook-ST-4776
Browse files Browse the repository at this point in the history
Dev rook st 4776
  • Loading branch information
sumathi-thirumani authored Dec 12, 2023
2 parents dc490a0 + d6bed4c commit 1df3059
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

.foi-eye-container {
width: auto;
width: 100px;
height: 40px;
background-color: #00336652;
border-radius: 40px 0px 0px 40px;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.request-flag {

padding-top: 50px;

.request-flag-dropdown-all {
padding-top: 10px;
Expand All @@ -27,7 +26,7 @@
}

.request-flag-select{
border: 1px solid #a0192f;
border: 1px solid #fa7c16;
//padding-top: 8px;
//width:40px;
height: 40px;
Expand Down
26 changes: 14 additions & 12 deletions request-management-api/request_api/models/FOIMinistryRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1319,6 +1313,14 @@ 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 = []
for keyword in params['keywords']:
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']:
Expand Down
10 changes: 9 additions & 1 deletion request-management-api/request_api/models/FOIRequestOIPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ 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:
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')
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def createfoiministryrequestfromobject(self, ministryschema, requestschema, user
foiministryrequest.closedate = requestdict['closedate']
foiministryrequest.closereasonid = requestdict['closereasonid']
foiministryrequest.isoipcreview = ministryschema["isoipcreview"]
foiministryrequest.oipcreviews = self.createfoirequestoipcs(foiministryrequest.isoipcreview, ministryschema["foirequest_id"], ministryschema["version"], userid, usertype)
foiministryrequest.oipcreviews = self.createfoirequestoipcs(foiministryrequest.isoipcreview, ministryschema["foirequest_id"], ministryschema["version"])
return foiministryrequest

def __createministrydivisions(self, requestschema, foiministryrequestid, foiministryrequestversion, userid):
Expand Down Expand Up @@ -313,7 +313,7 @@ def createfoirequestdivision(self, requestschema, requestid, version, userid):
def createfoiassigneefromobject(self, username, firstname, middlename, lastname):
return FOIAssignee.saveassignee(username, firstname, middlename, lastname)

def createfoirequestoipcs(self, isoipcreview, requestid, version, userid, usertype):
def createfoirequestoipcs(self, isoipcreview, requestid, version):
current_oipcs = FOIRequestOIPC.getoipc(requestid, version)
if (isoipcreview == True):
updated_oipcs = []
Expand All @@ -326,19 +326,16 @@ def createfoirequestoipcs(self, isoipcreview, requestid, version, userid, userty
oipcreview.reasonid = oipc["reasonid"]
oipcreview.statusid = oipc["statusid"]
oipcreview.outcomeid = oipc["outcomeid"]
oipcreview.investigator = oipc["investigator"] if oipc["investigator"] not in (None, "") else None
oipcreview.investigator = oipc["investigator"]
oipcreview.isinquiry = oipc["isinquiry"]
oipcreview.isjudicialreview = oipc["isjudicialreview"]
oipcreview.issubsequentappeal = oipc["issubsequentappeal"]
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 = oipc["createdby"] if usertype == "ministry" else userid
oipcreview.created_at= oipc["created_at"] if usertype == "ministry" else datetime2.now().isoformat()

oipcreview.receiveddate = oipc["receiveddate"]
oipcreview.closeddate = oipc["closeddate"]
oipcreview.inquiryattributes = oipc["inquiryattributes"]
oipcreview.createdby=oipc["createdby"]
oipcreview.created_at= oipc["created_at"]
updated_oipcs.append(oipcreview)
return updated_oipcs
return []

0 comments on commit 1df3059

Please sign in to comment.