Skip to content

Commit

Permalink
Merge pull request #5466 from bcgov/test-rook-NC-3152
Browse files Browse the repository at this point in the history
Fixed issues in 3152, state order, updated verbiage and enable onhold…
  • Loading branch information
nagarajaPC-AOT authored Dec 4, 2024
2 parents 5774831 + 272d353 commit c963518
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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 @@ -667,6 +668,20 @@ const AdvancedSearch = ({ userDetail }) => {
}
label="Ministry Sign Off"
/>
<FormControlLabel
className={classes.checkboxLabel}
control={
<Checkbox
size="small"
name="onholdother"
stateid={StateEnum.onholdother.label}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.onholdother.label]}
color="success"
/>
}
label="On Hold - Other"
/>
<FormControlLabel
className={classes.checkboxLabel}
control={
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 @@ -666,6 +667,20 @@ const AdvancedSearch = ({ userDetail }) => {
}
label="Ministry Sign Off"
/>
<FormControlLabel
className={classes.checkboxLabel}
control={
<Checkbox
size="small"
name="onholdother"
stateid={StateEnum.onholdother.label}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.onholdother.label]}
color="success"
/>
}
label="On Hold - Other"
/>
<FormControlLabel
className={classes.checkboxLabel}
control={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ 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.appfeeowing.name}?`};
case StateEnum.onholdother.name.toLowerCase():
return {title: "Change Request to On Hold - other",
body: "Are you sure you want to put this request on hold - Other? This should only be used for reasons other than fees when you need to put a request on hold (eg - Third Party notice, or Intake related reasons)"};
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ const StateDropDown = ({
const appendRecordsReadyForReview = (stateList) => {
const recordsreadyforreview = { status: "Records Ready for Review", isSelected: false };
let appendedList = stateList.slice();
appendedList.splice(-1, 0, recordsreadyforreview);
if(previousState === StateEnum.open.name || previousState === StateEnum.response.name)
appendedList.splice(-2, 0, recordsreadyforreview);
else appendedList.splice(-1, 0, recordsreadyforreview);
return appendedList;
}
const appendPreviousStateForHoldOthers = (stateList, previousStateName) => {
Expand Down
2 changes: 0 additions & 2 deletions forms-flow-web/src/constants/FOI/statusEnum.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,13 @@ const StateList = Object.freeze({
{ status: "Open", isSelected: false },
{ status: "Peer Review", isSelected: false },
{ status: "Redirect", isSelected: false },
{ status: "On Hold - Other", isSelected: false },
{ status: "Closed", isSelected: false },
],
appfeeowing: [
{ status: "App Fee Owing", isSelected: false },
{ status: "Open", isSelected: false },
{ status: "Peer Review", isSelected: false },
{ status: "Redirect", isSelected: false },
{ status: "On Hold - Other", isSelected: false },
{ status: "Closed", isSelected: false },
],
recordsreadyforreview: [
Expand Down
5 changes: 3 additions & 2 deletions request-management-api/request_api/services/requestservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def updateduedate(
currentstatus not in (None, "")
and ((currentstatus == StateName.onhold.value
and nextstatename != StateName.response.value)
or currentstatus == StateName.onholdother.value)
or (currentstatus == StateName.onholdother.value
and nextstatename != StateName.open.value))
):
skipcalculation = self.__skipduedatecalculation(
ministryrequestid, offholddate, currentstatus, nextstatename
Expand Down Expand Up @@ -272,7 +273,7 @@ def __skipduedatecalculation(self, ministryrequestid, offholddate, currentstatus
previousoffholddate = FOIMinistryRequest.getlastoffholddate(ministryrequestid, currentstatus)
if (
(currentstatus not in (None, "")
and currentstatus == StateName.onhold.value
and (currentstatus == StateName.onhold.value or currentstatus == StateName.onholdother.value)
and nextstatename not in (None, "")
and currentstatus == nextstatename)
):
Expand Down

0 comments on commit c963518

Please sign in to comment.