Skip to content

Commit

Permalink
renamed lockrecords to userlockedrecords for DB/models
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman-Hundal committed Jul 11, 2024
1 parent 94a9b01 commit 25ef0c8
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ 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)) {
saveRequestObject.lockrecords = null;
saveRequestObject.userlockedrecords = null;
}

//add oipc Data to save request object and sync/validate isoipcreview attribute
Expand Down
6 changes: 3 additions & 3 deletions forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
setIsOIPCReview(false);
}

//Adjust lockRecords value based on requestState if there is no manual user lockrecords value present in requestDetails from DB
//Adjust lockRecords value based on requestState if there is no manual user lockedrecords value present in requestDetails from DB
const updateRecordsTabAccess = () => {
if(requestDetails.lockrecords === null) {
if(requestDetails.userlockedrecords === null) {
return validLockRecordsState(requestDetails.currentState);
} else {
return requestDetails.lockrecords;
return requestDetails.userlockedrecords;
}
}
setLockRecordsTab(updateRecordsTabAccess());
Expand Down
6 changes: 3 additions & 3 deletions request-management-api/migrations/versions/5fdd5df3d642_.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""ADD LOCKRECORDS Column to FOIMinistryRequest
"""ADD userlockedrecords Column to FOIMinistryRequest
Revision ID: 5fdd5df3d642
Revises: e698b39da6bd
Expand All @@ -17,8 +17,8 @@


def upgrade():
op.add_column('FOIMinistryRequests', sa.Column('lockrecords', sa.Boolean(), nullable=True))
op.add_column('FOIMinistryRequests', sa.Column('userlockedrecords', sa.Boolean(), nullable=True))


def downgrade():
op.drop_column('FOIMinistryRequests', 'lockrecords')
op.drop_column('FOIMinistryRequests', 'userlockedrecords')
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class FOIMinistryRequest(db.Model):
identityverified = db.Column(JSON, unique=False, nullable=True)
ministrysignoffapproval = db.Column(JSON, unique=False, nullable=True)
requeststatuslabel = db.Column(db.String(50), nullable=False)
lockrecords = db.Column(db.Boolean, nullable=True)
userlockedrecords = db.Column(db.Boolean, nullable=True)

#ForeignKey References

Expand Down Expand Up @@ -1588,5 +1588,5 @@ class Meta:
'foirequest.receivedmodeid','requeststatus.requeststatusid','requeststatuslabel','requeststatus.name','programarea.bcgovcode',
'programarea.name','foirequest_id','foirequestversion_id','created_at','updated_at','createdby','assignedministryperson',
'assignedministrygroup','cfrduedate','closedate','closereasonid','closereason.name',
'assignee.firstname','assignee.lastname','ministryassignee.firstname','ministryassignee.lastname', 'axisrequestid', 'axissyncdate', 'axispagecount', 'axislanpagecount', 'linkedrequests', 'ministrysignoffapproval', 'identityverified','originalldd','isoipcreview', 'recordspagecount', 'lockrecords')
'assignee.firstname','assignee.lastname','ministryassignee.firstname','ministryassignee.lastname', 'axisrequestid', 'axissyncdate', 'axispagecount', 'axislanpagecount', 'linkedrequests', 'ministrysignoffapproval', 'identityverified','originalldd','isoipcreview', 'recordspagecount', 'userlockedrecords')

Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Meta: # pylint: disable=too-few-public-methods
identityVerified = fields.Str(data_key="identityVerified",allow_none=True)

oipcdetails = fields.Nested(FOIMinistryRequestOIPCSchema, many=True,allow_none=True)
lockrecords = fields.Bool(data_key="lockrecords", allow_none=True)
userlockedrecords = fields.Bool(data_key="userlockedrecords", allow_none=True)

recordspagecount = fields.Int(data_key="recordspagecount",allow_none=True)
axislanpagecount = fields.Int(data_key="axislanpagecount",allow_none=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +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")
foiministryrequest.userlockedrecords = requestschema.get("userlockedrecords")
if requeststatuslabel is not None:
status = self.getstatusname(requeststatuslabel)
if self.isNotBlankorNone(requestschema,"fromDate","main") == True:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __preparebaseinfo(self,request,foiministryrequestid,requestministry,requestm
'isofflinepayment': FOIMinistryRequest.getofflinepaymentflag(foiministryrequestid),
'linkedRequests' : linkedministryrequests,
'identityVerified':requestministry['identityverified'],
'lockrecords': requestministry['lockrecords'],
'userlockedrecords': requestministry['userlockedrecords'],

}
if requestministry['cfrduedate'] is not None:
Expand Down

0 comments on commit 25ef0c8

Please sign in to comment.