Skip to content

Commit

Permalink
Merge pull request #5473 from bcgov/test-rook
Browse files Browse the repository at this point in the history
Release 11.3 to dev
  • Loading branch information
nkan-aot2 authored Dec 6, 2024
2 parents 2a71e1c + 5cf034b commit c025fbb
Show file tree
Hide file tree
Showing 40 changed files with 237 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ const AdvancedSearch = ({ userDetail }) => {
[StateEnum.review.label]: false,
[StateEnum.signoff.label]: false,
[StateEnum.closed.label]: false,
[StateEnum.callforrecordsoverdue.label]: false
[StateEnum.callforrecordsoverdue.label]: false,
[StateEnum.onholdother.label]: false
};

const [requestState, setRequestState] = useState(() => {
Expand Down Expand Up @@ -672,7 +673,7 @@ const AdvancedSearch = ({ userDetail }) => {
return <em>All</em>;
}

return selected.map(value => StateEnum[value].name).join(", ");
return selected.map(value => Object.values(StateEnum).find(state => state.label === value).name).join(", ");
}}
>
<MenuItem disabled value="" key="request-state-all">
Expand All @@ -681,11 +682,11 @@ const AdvancedSearch = ({ userDetail }) => {
{Object.entries(StateEnum).filter(([key, value]) => key !== 'callforrecordsoverdue').map(([key, value]) => (
<MenuItem
key={`request-state-type-${key}`}
value={key}
value={value.label}
>
<Checkbox
checked={
requestState.indexOf(key) > -1
requestState.indexOf(value.label) > -1
}
color="success"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ const AdvancedSearch = ({ userDetail }) => {
[StateEnum.review.label]: false,
[StateEnum.signoff.label]: false,
[StateEnum.closed.label]: false,
[StateEnum.callforrecordsoverdue.label]: false
[StateEnum.callforrecordsoverdue.label]: false,
[StateEnum.onholdother.label]: false
};
const [requestState, setRequestState] = useState(() => {
if (Object.keys(advancedSearchParams).length > 0 && advancedSearchParams.requestState.length > 0) {
Expand Down Expand Up @@ -622,7 +623,7 @@ const AdvancedSearch = ({ userDetail }) => {
return <em>All</em>;
}

return selected.map(value => StateEnum[value].name).join(", ");
return selected.map(value => Object.values(StateEnum).find(state => state.label === value).name).join(", ");
}}
>
<MenuItem disabled value="" key="request-state-all">
Expand All @@ -633,11 +634,11 @@ const AdvancedSearch = ({ userDetail }) => {
].includes(key)).map(([key, value]) => (
<MenuItem
key={`request-state-type-${key}`}
value={key}
value={value.label}
>
<Checkbox
checked={
requestState.indexOf(key) > -1
requestState.indexOf(value.label) > -1
}
color="success"
/>
Expand Down
4 changes: 2 additions & 2 deletions forms-flow-web/src/components/FOI/Dashboard/Ministry/Queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Queue = ({ userDetail, tableInfo }) => {
function getRecordsDue(params) {
let receivedDateString = params.row.cfrduedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.onholdother.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand All @@ -102,7 +102,7 @@ const Queue = ({ userDetail, tableInfo }) => {
function getLDD(params) {
let receivedDateString = params.row.duedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.onholdother.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand Down
6 changes: 3 additions & 3 deletions forms-flow-web/src/components/FOI/Dashboard/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const onBehalfFullName = (params) => {
export const getRecordsDue = (params) => {
let receivedDateString = params.row.cfrduedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.onholdother.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand All @@ -145,7 +145,7 @@ export const getRecordsDue = (params) => {
export const getLDD = (params) => {
let receivedDateString = params.row.duedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()||currentStatus.toLowerCase() === StateEnum.onholdother.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand All @@ -158,7 +158,7 @@ export const getDaysLeft = (params) => {
const receivedDateString = params.row.duedate;

if (
[StateEnum.onhold.name.toLowerCase(), StateEnum.closed.name.toLowerCase()].includes(params.row.currentState.toLowerCase())
[StateEnum.onhold.name.toLowerCase(), StateEnum.closed.name.toLowerCase(), StateEnum.onholdother.name.toLowerCase()].includes(params.row.currentState.toLowerCase())
) {
return "N/A";
} else if(!receivedDateString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,13 @@ const BottomButtonGroup = React.memo(
case StateEnum.peerreview.name:
case StateEnum.section5pending.name:
case StateEnum.appfeeowing.name:
case StateEnum.onholdother.name:
case StateEnum.recordsreadyforreview.name:
const status = Object.values(StateEnum).find(
(statusValue) => statusValue.name === currentSelectedStatus
);
saveRequestObject.requeststatuslabel = status.label;
if (currentSelectedStatus === StateEnum.onhold.name && !saveRequestObject.paymentExpiryDate) {
if ((currentSelectedStatus === StateEnum.onhold.name || currentSelectedStatus === StateEnum.onholdother.name) && !saveRequestObject.paymentExpiryDate) {
saveRequestObject.paymentExpiryDate = dueDateCalculation(new Date(), PAYMENT_EXPIRY_DAYS);
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const ExtensionDetailsBox = React.memo(() => {
setExtensionId(null);
}}
disabled={pendingExtensionExists || requestState?.toLowerCase() === StateEnum.onhold.name.toLowerCase() ||
requestState?.toLowerCase() === StateEnum.closed.name.toLowerCase()}
requestState?.toLowerCase() === StateEnum.onholdother.name.toLowerCase() || requestState?.toLowerCase() === StateEnum.closed.name.toLowerCase()}
>
New Extension
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const ExtensionsTable = ({ showActions = true }) => {
disabled={
(index > 0 &&
extension.extensionstatus !== extensionStatusId.pending) || requestState?.toLowerCase() === StateEnum.onhold.name.toLowerCase() ||
requestState?.toLowerCase() === StateEnum.closed.name.toLowerCase()
requestState?.toLowerCase() === StateEnum.onholdother.name.toLowerCase() || requestState?.toLowerCase() === StateEnum.closed.name.toLowerCase()
}
>
<MoreHorizIcon />
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
currentState === StateEnum.peerreview.name ||
currentState === StateEnum.signoff.name ||
currentState === StateEnum.response.name ||
currentState === StateEnum.onholdother.name ||
currentState === StateEnum.closed.name
);
}
Expand Down Expand Up @@ -893,7 +894,6 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {

const handleSaveRequest = (_state, _unSaved, id) => {
setHeader(_state);

if (!_unSaved) {
setUnSavedRequest(_unSaved);
dispatch(fetchFOIRequestDetailsWrapper(id || requestId, ministryId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ const FOIRequestHeader = React.memo(
status.toLowerCase() === StateEnum.onhold.name.toLowerCase() ||
status.toLowerCase() === StateEnum.response.name.toLowerCase() ||
status.toLowerCase() === StateEnum.recordsreadyforreview.name.toLowerCase() ||
status.toLowerCase() === StateEnum.onholdother.name.toLowerCase() ||
(ministryId && status.toLowerCase() === StateEnum.peerreview.name.toLowerCase());

const getMinistryAssignedTo = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ const MinistryReview = React.memo(({ userDetail }) => {
currentState === StateEnum.peerreview.name ||
currentState === StateEnum.signoff.name ||
currentState === StateEnum.response.name ||
currentState === StateEnum.onholdother.name ||
currentState === StateEnum.closed.name
);
}
Expand Down Expand Up @@ -328,6 +329,7 @@ const MinistryReview = React.memo(({ userDetail }) => {
const [CFRUnsaved, setCFRUnsaved] = React.useState(false);
const hideBottomText = [
StateEnum.onhold.name.toLowerCase(),
StateEnum.onholdother.name.toLowerCase(),
StateEnum.closed.name.toLowerCase(),
];

Expand Down Expand Up @@ -489,6 +491,9 @@ const MinistryReview = React.memo(({ userDetail }) => {
break;
case StateEnum.recordsreadyforreview.name:
foitabheaderBG = "foitabheadercollection foitabheaderRecordsReadyForReviewBG";
break;
case StateEnum.onholdother.name:
foitabheaderBG = "foitabheadercollection foitabheaderOnHoldOtherBG";
break;
default:
foitabheaderBG = "foitabheadercollection foitabheaderdefaultBG";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@
.foitabheaderPeerreviewBG{
background-color: #096DD1;
}

.foitabheaderOnHoldOtherBG{
background-color: #595959;
}
.foileftpanelheader
{
padding-left: 12%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ const RequestDetails = React.memo((requestDetails) => {
<b>Records Due Date</b>
</span>
<span className="foi-rowtoppadding">
{_requestDetails?.currentState?.toLowerCase() !==
StateEnum.onhold.name.toLowerCase()
{(_requestDetails?.currentState?.toLowerCase() !==
StateEnum.onhold.name.toLowerCase() && _requestDetails?.currentState?.toLowerCase() !==
StateEnum.onholdother.name.toLowerCase())
? formatDate(
_requestDetails.cfrDueDate,
"MMM dd yyyy"
Expand All @@ -71,8 +72,9 @@ const RequestDetails = React.memo((requestDetails) => {
<b>Legislated Due Date</b>
</span>
<span className="foi-rowtoppadding">
{_requestDetails?.currentState?.toLowerCase() !==
StateEnum.onhold.name.toLowerCase()
{(_requestDetails?.currentState?.toLowerCase() !==
StateEnum.onhold.name.toLowerCase() && _requestDetails?.currentState?.toLowerCase() !==
StateEnum.onholdother.name.toLowerCase())
? formatDate(
_requestDetails.dueDate,
"MMM dd yyyy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ const RequestDetails = React.memo(
<TextField
id="dueDate"
label="Legislated Due Date"
type={requestDetails?.currentState?.toLowerCase() === StateEnum.onhold.name.toLowerCase() ? "text" : "date"}
value={requestDetails?.currentState?.toLowerCase() === StateEnum.onhold.name.toLowerCase() ? 'N/A' : (dueDateText || '')}
type={(requestDetails?.currentState?.toLowerCase() === StateEnum.onhold.name.toLowerCase() || requestDetails?.currentState?.toLowerCase() === StateEnum.onholdother.name.toLowerCase()) ? "text" : "date"}
value={(requestDetails?.currentState?.toLowerCase() === StateEnum.onhold.name.toLowerCase() || requestDetails?.currentState?.toLowerCase() === StateEnum.onholdother.name.toLowerCase()) ? 'N/A' : (dueDateText || '')}
inputProps={{ "aria-labelledby": "dueDate-label"}}
InputLabelProps={{
shrink: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
.foitabheaderReadytoScanBG{
background-color: #A2096C;
}
.foitabheaderOnholdOtherBG{
background-color: #595959;
}

.foileftpanelheader
{
Expand Down
4 changes: 3 additions & 1 deletion forms-flow-web/src/components/FOI/FOIRequest/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const getTabBottomText = ({
StateEnum.closed.name,
StateEnum.intakeinprogress.name,
StateEnum.redirect.name,
StateEnum.onholdother.name,
];

if (!statusesToNotAppearIn.includes(_status)) {
Expand Down Expand Up @@ -143,7 +144,8 @@ export const getTabBG = (_tabStatus, _requestState) => {
return "foitabheadercollection foitabheaderAppFeeOwingBG";
case StateEnum.recordsreadyforreview.name:
return "foitabheadercollection foitabheaderRecordsReadyForReviewBG";

case StateEnum.onholdother.name:
return "foitabheadercollection foitabheaderOnholdOtherBG";
default:
return "foitabheadercollection foitabheaderdefaultBG";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,14 @@ export const CFRForm = ({
if(requestState === StateEnum.peerreview.name){
return true;
}
if (formHistory.length > 0 && [StateEnum.feeassessed.name, StateEnum.onhold.name, StateEnum.callforrecords.name].includes(requestState)) {
if (formHistory.length > 0 && [StateEnum.feeassessed.name, StateEnum.onhold.name, StateEnum.callforrecords.name, StateEnum.onholdother.name].includes(requestState)) {
if (isMinistry) {
return ['review', 'approved'].includes(initialFormData.formStatus) || isNewCFRForm;
} else {
return initialFormData.formStatus !== 'review';
}
}
if (formData.balanceRemaining > 0 && [StateEnum.feeassessed.name, StateEnum.onhold.name].includes(requestState)) {
if (formData.balanceRemaining > 0 && [StateEnum.feeassessed.name, StateEnum.onhold.name, StateEnum.onholdother.name].includes(requestState)) {
if (isMinistry) {
return !['clarification', 'init'].includes(initialFormData.formStatus);
} else {
Expand Down Expand Up @@ -523,7 +523,8 @@ export const CFRForm = ({

const disableNewCfrFormBtn = () => {
return(formData?.formStatus !== 'approved' || requestState === StateEnum.peerreview.name || (requestState !== StateEnum.callforrecords.name &&
requestState !== StateEnum.feeassessed.name && requestState !== StateEnum.onhold.name) || (requestState === StateEnum.onhold.name && formData?.actualTotalDue > 0));
requestState !== StateEnum.feeassessed.name && requestState !== StateEnum.onhold.name) || (requestState === StateEnum.onhold.name && formData?.actualTotalDue > 0) ||
(requestState === StateEnum.onholdother.name && formData?.actualTotalDue > 0));
}

const disableAmountPaid = () => {
Expand All @@ -544,7 +545,7 @@ export const CFRForm = ({
}

const isFeeWaiverDisabled = () => {
if(isMinistry || requestState === StateEnum.peerreview.name || (!isMinistry && (requestState !== StateEnum.onhold.name || formData?.formStatus !== 'approved')))
if(isMinistry || requestState === StateEnum.peerreview.name || (!isMinistry && (requestState !== StateEnum.onhold.name || requestState !== StateEnum.onholdother.name || formData?.formStatus !== 'approved')))
return true;
else
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export default function ConfirmationModal({requestId, openModal, handleModal, st
else if (saveRequestObject.requeststatuslabel === StateEnum.signoff.label
&& state.toLowerCase() === StateEnum.review.name.toLowerCase())
fileStatusTransition = StateTransitionCategories.signoffreview.name;

fileInfoList = files.map(file => {
return {
ministrycode: requestNumber.split("-")[0],
Expand All @@ -186,15 +185,17 @@ export default function ConfirmationModal({requestId, openModal, handleModal, st
const attchmentFileNameList = attachmentsArray?.map(_file => _file.filename);

const getDaysRemaining = () => {
if (currentState?.toLowerCase() === StateEnum.closed.name.toLowerCase() && state.toLowerCase() !== StateEnum.closed.name.toLowerCase() && state.toLowerCase() !== StateEnum.onhold.name.toLowerCase()) {
if (currentState?.toLowerCase() === StateEnum.closed.name.toLowerCase() && state.toLowerCase() !== StateEnum.closed.name.toLowerCase() && state.toLowerCase() !== StateEnum.onhold.name.toLowerCase() && state.toLowerCase() !== StateEnum.onholdother.name.toLowerCase()) {
return (
<span> <b> {daysRemainingLDD} DAYS REMAINING </b> </span>
);
}
}

const addorUpdateConfirmationModal = () => {
if (state.toLowerCase() === StateEnum.closed.name.toLowerCase() &&
if(currentState?.toLowerCase() === StateEnum.onholdother.name.toLowerCase())
return null;
else if (state.toLowerCase() === StateEnum.closed.name.toLowerCase() &&
currentState?.toLowerCase() !== StateEnum.closed.name.toLowerCase()) {
return (
<CloseForm saveRequestObject={saveRequestObject} handleClosingDateChange={handleClosingDateChange} handleClosingReasonChange={handleClosingReasonChange} enableSaveBtn={enableSaveBtn} />
Expand Down Expand Up @@ -261,7 +262,7 @@ export default function ConfirmationModal({requestId, openModal, handleModal, st
</tr>
</tbody>
</table> : null }
{(currentState?.toLowerCase() !== StateEnum.closed.name.toLowerCase() && [StateEnum.callforrecords.name.toLowerCase(), StateEnum.consult.name.toLowerCase(), StateEnum.onhold.name.toLowerCase()].includes(state.toLowerCase())) ?
{(currentState?.toLowerCase() !== StateEnum.closed.name.toLowerCase() && [StateEnum.callforrecords.name.toLowerCase(), StateEnum.consult.name.toLowerCase(), StateEnum.onhold.name.toLowerCase(), StateEnum.onholdother.name.toLowerCase()].includes(state.toLowerCase())) ?
<table className="table table-bordered table-assignedto">
<tbody>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ import FOI_COMPONENT_CONSTANTS from '../../../../constants/FOI/foiComponentConst
_saveRequestObject.reopen = true;
return {title: "Re-Open Request", body: <>Are you sure you want to re-open Request # {_requestNumber ? _requestNumber : `U-00${_requestId}`}? <br/> The request will be re-opened to the previous state: {_state} </>};
}
if ((_currentState?.toLowerCase() === StateEnum.onholdother.name.toLowerCase())){
return {title: "Taking Request off hold", body: "Are you sure you want to take this request off hold? The legislated due date will be recalculated"};
}
switch(_state.toLowerCase()) {
case StateEnum.intakeinprogress.name.toLowerCase():
return {title: "Changing the state", body: "Are you sure you want to change the state to Intake in Progress?"};
Expand Down Expand Up @@ -134,6 +137,10 @@ import FOI_COMPONENT_CONSTANTS from '../../../../constants/FOI/foiComponentConst
return {title: "Changing the state", body: `Are you sure you want to change Request #${_requestNumber} to ${StateEnum.response.name}?`};
case StateEnum.appfeeowing.name.toLowerCase():
return {title: "Changing the state", body: `Are you sure you want to change Request #${_requestNumber} to ${StateEnum.appfeeowing.name}?`};
case StateEnum.onholdother.name.toLowerCase():
return {title: "Change Request to On Hold - Other",
body: <>Are you sure you want to change Request #{_requestNumber} to {StateEnum.onholdother.name}? This should be used for scenarios
that are not fee related (such as Third Party notice).<b> This will stop the clock.</b></>};
default:
return {title: "", body: ""};
}
Expand Down
Loading

0 comments on commit c025fbb

Please sign in to comment.