Skip to content

Commit

Permalink
Merge pull request #5035 from bcgov/dev-rook-MD-4931
Browse files Browse the repository at this point in the history
4931 - Records Ready for Review State
  • Loading branch information
milosdes authored Feb 12, 2024
2 parents 6dfbe75 + d333116 commit fef96ac
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ const BottomButtonGroup = React.memo(
case StateEnum.peerreview.name:
case StateEnum.section5pending.name:
case StateEnum.appfeeowing.name:
case StateEnum.recordsreadyforreview.name:
const status = Object.values(StateEnum).find(
(statusValue) => statusValue.name === currentSelectedStatus
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ const BottomButtonGroup = React.memo(
saveMinistryRequestObject.requeststatuslabel =
StateEnum.callforrecords.label;
break;
case StateEnum.recordsreadyforreview.name.toLowerCase():
saveMinistryRequestObject.requeststatuslabel = StateEnum.recordsreadyforreview.label;
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
background-color: #04596C;
}

.foitabheaderRecordsReadyForReviewBG{
background-color: #04596C;
}

.foitabheaderFeeBG{
background-color: #721121;
}
Expand Down
2 changes: 2 additions & 0 deletions forms-flow-web/src/components/FOI/FOIRequest/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ export const getTabBG = (_tabStatus, _requestState) => {
return "foitabheadercollection foitabheaderSection5Pending";
case StateEnum.appfeeowing.name:
return "foitabheadercollection foitabheaderAppFeeOwingBG";
case StateEnum.recordsreadyforreview.name:
return "foitabheadercollection foitabheaderRecordsReadyForReviewBG";

default:
return "foitabheadercollection foitabheaderdefaultBG";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ import { getFullnameList } from "../../../../helper/FOI/helper";
return {title: "Changing the state", body: `Are you sure you want to change Request #${_requestNumber} to ${StateEnum.section5pending.name}?`};
case StateEnum.callforrecords.name.toLowerCase():
return {title: "Changing the state", body: `Are you sure you want to change Request #${_requestNumber} to ${StateEnum.callforrecords.name}?`};
case StateEnum.recordsreadyforreview.name.toLowerCase():
return {title: "Changing the state", body: `Are you sure you want to change Request #${_requestNumber} to ${StateEnum.recordsreadyforreview.name}?`};
case StateEnum.review.name.toLowerCase():
if(!allowStateChange)
return {title: "Changing the state", body: `Unable to change state until fee estimate actuals have been completed.`};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const StateDropDown = ({
(state) => state.foiRequests.foiRequestDetail
);

const userDetail = useSelector(state=> state.user.userDetail);
const isCFDMinistryCoordinator = userDetail.groups.some(group => group.toLowerCase().includes('mcf ministry team'))

React.useEffect(() => {
if (requestState && requestState !== status) {
setStatus(requestState);
Expand Down Expand Up @@ -114,6 +117,9 @@ const StateDropDown = ({
return _stateList.intakeinprogress;
}
case StateEnum.peerreview.name.toLowerCase():
if (isCFDMinistryCoordinator) {
return _stateList.peerreviewcfd;
}
if (!isMinistryCoordinator) {
//const currentStatusVersion = stateTransition[0]?.version;
if (previousState === StateEnum.intakeinprogress.name) {
Expand All @@ -138,8 +144,14 @@ const StateDropDown = ({
case StateEnum.redirect.name.toLowerCase():
return _stateList.redirect;
case StateEnum.callforrecords.name.toLowerCase():
if (isCFDMinistryCoordinator && personalRequest) {
return _stateList.callforrecordsforcfdpersonal;
}
if (_isMinistryCoordinator && personalRequest)
return _stateList.callforrecordsforpersonal;
if (isCFDMinistryCoordinator) {
return _stateList.callforrecordscfd;
}
if (
personalIAO &&
(requestDetails.bcgovcode.toLowerCase() === "mcf" ||
Expand All @@ -148,9 +160,17 @@ const StateDropDown = ({
return _stateList.callforrecordscfdmsdpersonal;
return _stateList.callforrecords;
case StateEnum.tagging.name.toLowerCase():
if (isCFDMinistryCoordinator) {
return _stateList.taggingcfd;
}
return _stateList.tagging;
case StateEnum.readytoscan.name.toLowerCase():
if (isCFDMinistryCoordinator) {
return _stateList.readytoscancfd;
}
return _stateList.readytoscan;
case StateEnum.recordsreadyforreview.name.toLowerCase():
return _stateList.recordsreadyforreview;
case StateEnum.review.name.toLowerCase():
if (
personalIAO &&
Expand All @@ -175,13 +195,19 @@ const StateDropDown = ({
}
return _stateList.onhold;
case StateEnum.consult.name.toLowerCase():
if (isCFDMinistryCoordinator) {
return _stateList.consultcfd;
}
return _stateList.consult;
case StateEnum.signoff.name.toLowerCase():
return _stateList.signoff;
case StateEnum.feeassessed.name.toLowerCase():
if (personalIAO) return _stateList.feeassessedforpersonal;
return _stateList.feeassessed;
case StateEnum.deduplication.name.toLowerCase():
if (isCFDMinistryCoordinator) {
return _stateList.deduplicationcfd;
}
return _stateList.deduplication;
case StateEnum.harms.name.toLowerCase():
return _stateList.harms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
background-color: #4B296B;
}

.recordsreadyforreview {
background-color: #04596C;
}

.recordsreview {
background-color: #04596C;
}
Expand Down
60 changes: 59 additions & 1 deletion forms-flow-web/src/constants/FOI/statusEnum.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,30 @@ const StateList = Object.freeze({
callforrecords: [
{ status: "Call For Records", isSelected: false },
{ status: "Open", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Closed", isSelected: false },
],
callforrecordscfdmsdpersonal: [
{ status: "Call For Records", isSelected: false },
{ status: "Open", isSelected: false },
{ status: "Tagging", isSelected: false },
{ status: "Ready to Scan", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Closed", isSelected: false },
],
tagging: [
{ status: "Tagging", isSelected: true },
{ status: "Call For Records", isSelected: false },
{ status: "Ready to Scan", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Closed", isSelected: false },
],
readytoscan: [
{ status: "Ready to Scan", isSelected: true },
{ status: "Call For Records", isSelected: false },
{ status: "Tagging", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Closed", isSelected: false },
],
Expand All @@ -76,6 +80,7 @@ const StateList = Object.freeze({
deduplication: [
{ status: "Deduplication", isSelected: false },
{ status: "Harms Assessment", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Closed", isSelected: false },
],
Expand All @@ -85,6 +90,7 @@ const StateList = Object.freeze({
],
consult: [
{ status: "Consult", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Ministry Sign Off", isSelected: false },
{ status: "Peer Review", isSelected: false },
Expand Down Expand Up @@ -127,7 +133,10 @@ const StateList = Object.freeze({
{ status: "Closed", isSelected: false },
],
//peerreview: [{status:"Peer Review", isSelected: false},{status:"Intake in Progress", isSelected: false}, {status: "Open", isSelected: false},{status: "Records Review", isSelected: false},{status: "Consult", isSelected: false},{status: "Response", isSelected: false}],
peerreview: [{ status: "Peer Review", isSelected: false }],
peerreview: [
{ status: "Peer Review", isSelected: false },
{ status: "Records Ready for Review", isSelected: false }
],
section5pending: [
{ status: "Section 5 Pending", isSelected: false },
{ status: "Open", isSelected: false },
Expand All @@ -142,6 +151,17 @@ const StateList = Object.freeze({
{ status: "Redirect", isSelected: false },
{ status: "Closed", isSelected: false },
],
recordsreadyforreview: [
{ status: "Records Ready for Review", isSelected: false },
{ status: "Call For Records", isSelected: false },
{ status: "Tagging", isSelected: false },
{ status: "Consult", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Peer Review", isSelected: false },
{ status: "Ministry Sign Off", isSelected: false },
{ status: "Response", isSelected: false },
{ status: "Closed", isSelected: false }
],
});

const MinistryStateList = Object.freeze({
Expand All @@ -157,22 +177,47 @@ const MinistryStateList = Object.freeze({
{ status: "Records Review", isSelected: false },
{ status: "Ministry Sign Off", isSelected: false },
],
callforrecordscfd: [
{ status: "Call For Records", isSelected: false },
{ status: "Fee Estimate", isSelected: false },
{ status: "Harms Assessment", isSelected: false },
{ status: "Deduplication", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Ministry Sign Off", isSelected: false },
],
callforrecordsforpersonal: [
{ status: "Call For Records", isSelected: false },
{ status: "Harms Assessment", isSelected: false },
{ status: "Deduplication", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Ministry Sign Off", isSelected: false },
],
callforrecordsforcfdpersonal: [
{ status: "Call For Records", isSelected: false },
{ status: "Harms Assessment", isSelected: false },
{ status: "Deduplication", isSelected: false },
{ status: "Records Ready for Review", isSelected: false },
{ status: "Records Review", isSelected: false },
{ status: "Ministry Sign Off", isSelected: false },
],
feeassessed: [{ status: "Fee Estimate", isSelected: false }],
onhold: [{ status: "On Hold", isSelected: false }],
deduplication: [{ status: "Deduplication", isSelected: false }],
deduplicationcfd: [
{ status: "Deduplication", isSelected: false },
{ status: "Records Ready for Review", isSelected: false }
],
harms: [
{ status: "Harms Assessment", isSelected: false },
{ status: "Call For Records", isSelected: false },
{ status: "Records Review", isSelected: false },
],
consult: [{ status: "Consult", isSelected: false }],
consultcfd: [
{ status: "Consult", isSelected: false },
{ status: "Records Ready for Review", isSelected: false }
],
review: [{ status: "Records Review", isSelected: false }],
signoff: [
{ status: "Ministry Sign Off", isSelected: false },
Expand All @@ -182,8 +227,20 @@ const MinistryStateList = Object.freeze({
response: [{ status: "Response", isSelected: false }],
closed: [{ status: "Closed", isSelected: false }],
peerreview: [{ status: "Peer Review", isSelected: false }],
peerreviewcfd: [
{ status: "Peer Review", isSelected: false },
{ status: "Records Ready for Review", isSelected: false }
],
tagging: [{ status: "Tagging", isSelected: true }],
taggingcfd: [
{ status: "Tagging", isSelected: true },
{ status: "Records Ready for Review", isSelected: false }
],
readytoscan: [{ status: "Ready to Scan", isSelected: true }],
readytoscancfd: [
{ status: "Ready to Scan", isSelected: true },
{ status: "Records Ready for Review", isSelected: false }
],
});

// This corresponds to rows in the FOIRequestStatuses table on the backend
Expand All @@ -209,6 +266,7 @@ const StateEnum = Object.freeze({
readytoscan: { name: "Ready to Scan", label: "readytoscan" },
appfeeowing: { name: "App Fee Owing", label: "appfeeowing" },
section5pending: { name: "Section 5 Pending", label: "section5pending" },
recordsreadyforreview: { name: "Records Ready for Review", label: "recordsreadyforreview" },
});

const StateTransitionCategories = Object.freeze({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Add Records Ready for Review State
Revision ID: 6646acda32fe
Revises: b4da31675bd0
Create Date: 2024-01-23 10:16:22.141034
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6646acda32fe'
down_revision = 'b4da31675bd0'
branch_labels = None
depends_on = None


def upgrade():
sql = '''INSERT INTO "FOIRequestStatuses" (name, description, isactive, statuslabel) VALUES ('Records Ready for Review', 'Records Ready for Review', true, 'recordsreadyforreview')'''
op.execute(sql)

def downgrade():
sql = '''DELETE FROM "FOIRequestStatuses" WHERE name = 'Records Ready for Review';'''
op.execute(sql)

0 comments on commit fef96ac

Please sign in to comment.