Skip to content

Commit

Permalink
Merge pull request #4866 from bcgov/revert-4861-dev-shiva-4707-marshal
Browse files Browse the repository at this point in the history
Revert "Dev shiva 4707 marshal"
  • Loading branch information
divyav-aot authored Dec 11, 2023
2 parents 7cc53d8 + ff47792 commit a47862f
Show file tree
Hide file tree
Showing 63 changed files with 24,859 additions and 9,298 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ services:
- EVENT_QUEUE_PDFSTITCH_STREAMKEY=${EVENT_QUEUE_PDFSTITCH_STREAMKEY}
- EVENT_QUEUE_PDFSTITCH_LARGE_FILE_STREAMKEY=${EVENT_QUEUE_PDFSTITCH_LARGE_FILE_STREAMKEY}
- STREAM_SEPARATION_FILE_SIZE_LIMIT=${STREAM_SEPARATION_FILE_SIZE_LIMIT}
- MUTE_NOTIFICATION=${MUTE_NOTIFICATION}
#- LOG_ROOT=${LOG_ROOT}
#- LOG_BASIC=${LOG_BASIC}
#- LOG_TRACING=${LOG_TRACING}
Expand Down
32,509 changes: 24,453 additions & 8,056 deletions forms-flow-web/package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions forms-flow-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"clsx": "^1.1.1",
"connected-react-router": "^6.9.1",
"create-react-class": "^15.7.0",
"crypto-js": "^4.2.0",
"crypto-js": "^4.0.0",
"date-fns": "^2.23.0",
"date-fns-tz": "^1.1.6",
"date-holidays": "^3.15.1",
Expand All @@ -72,6 +72,7 @@
"html-to-draftjs": "1.5.0",
"html-to-pdf-js": "^0.9.3",
"jquery": "^3.5.1",
"jsonwebtoken": "^8.5.1",
"keycloak-js": "^20.0.2",
"popper.js": "^1.16.1",
"prop-types": "^15.7.2",
Expand All @@ -93,7 +94,7 @@
"react-quill": "^1.3.5",
"react-redux": "^7.2.4",
"react-router-dom": "^5.1.2",
"react-scripts": "^5.0.1",
"react-scripts": "^4.0.3",
"react-select": "^3.2.0",
"react-test-renderer": "^17.0.2",
"react-toastify": "9.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { catchError, fnDone} from './foiServicesUtil';
import UserService from "../../../services/UserService";
import { replaceUrl } from "../../../helper/FOI/helper";
import { persistRequestFieldsNotInAxis } from "../../../components/FOI/FOIRequest/utils";
import { StateEnum } from "../../../constants/FOI/statusEnum";

export const fetchFOIRequestList = () => {
return (dispatch) => {
Expand Down Expand Up @@ -179,8 +178,7 @@ export const fetchFOIRawRequestDetails = (requestId) => {
const foiRequest = res.data;
dispatch(clearRequestDetails({}));
dispatch(setFOIRequestDetail(foiRequest));
const ministryCode = (foiRequest.currentState !== StateEnum.redirect.name && foiRequest.requestType === 'personal') ? foiRequest.selectedMinistries[0].code.toLowerCase() : "";
dispatch(fetchFOIAssignedToList(foiRequest.requestType.toLowerCase(), foiRequest.currentState.replace(/\s/g, '').toLowerCase(), ministryCode));
dispatch(fetchFOIAssignedToList(foiRequest.requestType.toLowerCase(), foiRequest.currentState.replace(/\s/g, '').toLowerCase(), ""));
dispatch(fetchFOIProcessingTeamList(foiRequest.requestType.toLowerCase()));
dispatch(setFOILoader(false));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ const AdvancedSearch = ({ userDetail }) => {
});

const intitialRequestState = {
[StateEnum.unopened.label]: false,
[StateEnum.open.label]: false,
[StateEnum.callforrecords.label]: false,
[StateEnum.review.label]: false,
[StateEnum.signoff.label]: false,
[StateEnum.closed.label]: false,
[StateEnum.callforrecordsoverdue.label]: false
[StateEnum.unopened.id]: false,
[StateEnum.open.id]: false,
[StateEnum.callforrecords.id]: false,
[StateEnum.review.id]: false,
[StateEnum.signoff.id]: false,
[StateEnum.closed.id]: false,
[StateEnum.callforrecordsoverdue.id]: false
};

const [requestState, setRequestState] = useState(() => {
if (Object.keys(advancedSearchParams).length > 0 && advancedSearchParams.requestState.length > 0) {
let savedRequestState = {...intitialRequestState}
Expand Down Expand Up @@ -578,9 +579,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="unopened"
stateid={StateEnum.unopened.label}
stateid={StateEnum.unopened.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.unopened.label]}
checked={requestState[StateEnum.unopened.id]}
color="success"
/>
}
Expand All @@ -592,9 +593,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="callforrecords"
stateid={StateEnum.callforrecords.label}
stateid={StateEnum.callforrecords.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.callforrecords.label]}
checked={requestState[StateEnum.callforrecords.id]}
color="success"
/>
}
Expand All @@ -606,9 +607,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="review"
stateid={StateEnum.review.label}
stateid={StateEnum.review.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.review.label]}
checked={requestState[StateEnum.review.id]}
color="success"
/>
}
Expand All @@ -620,9 +621,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="signoff"
stateid={StateEnum.signoff.label}
stateid={StateEnum.signoff.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.signoff.label]}
checked={requestState[StateEnum.signoff.id]}
color="success"
/>
}
Expand All @@ -634,9 +635,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="closed"
stateid={StateEnum.closed.label}
stateid={StateEnum.closed.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.closed.label]}
checked={requestState[StateEnum.closed.id]}
color="success"
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ const AdvancedSearch = ({ userDetail }) => {
});

const intitialRequestState = {
[StateEnum.callforrecords.label]: false,
[StateEnum.review.label]: false,
[StateEnum.signoff.label]: false,
[StateEnum.closed.label]: false,
[StateEnum.callforrecordsoverdue.label]: false
[StateEnum.callforrecords.id]: false,
[StateEnum.review.id]: false,
[StateEnum.signoff.id]: false,
[StateEnum.closed.id]: false,
[StateEnum.callforrecordsoverdue.id]: false
};

const [requestState, setRequestState] = useState(() => {
if (Object.keys(advancedSearchParams).length > 0 && advancedSearchParams.requestState.length > 0) {
let savedRequestState = {...intitialRequestState}
Expand Down Expand Up @@ -591,9 +592,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="callforrecords"
stateid={StateEnum.callforrecords.label}
stateid={StateEnum.callforrecords.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.callforrecords.label]}
checked={requestState[StateEnum.callforrecords.id]}
color="success"
/>
}
Expand All @@ -605,9 +606,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="review"
stateid={StateEnum.review.label}
stateid={StateEnum.review.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.review.label]}
checked={requestState[StateEnum.review.id]}
color="success"
/>
}
Expand All @@ -619,9 +620,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="signoff"
stateid={StateEnum.signoff.label}
stateid={StateEnum.signoff.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.signoff.label]}
checked={requestState[StateEnum.signoff.id]}
color="success"
/>
}
Expand All @@ -633,9 +634,9 @@ const AdvancedSearch = ({ userDetail }) => {
<Checkbox
size="small"
name="closed"
stateid={StateEnum.closed.label}
stateid={StateEnum.closed.id}
onChange={handleRequestStateChange}
checked={requestState[StateEnum.closed.label]}
checked={requestState[StateEnum.closed.id]}
color="success"
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,8 @@ const AxisSyncModal = ({ axisSyncModalOpen, setAxisSyncModalOpen, saveRequestObj


const saveAxisData = async () => {
if (urlIndexCreateRequest > -1) {
updatedSaveReqObj.requeststatuslabel = StateEnum.intakeinprogress.label;
}
if (urlIndexCreateRequest > -1)
updatedSaveReqObj.requeststatusid = StateEnum.intakeinprogress.id;
dispatch(saveRequestDetails(updatedSaveReqObj, urlIndexCreateRequest,requestId,ministryId,
(err, res) => {
if (!err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const BottomButtonGroup = React.memo(

const saveRequest = async (setLoader = false) => {
if (urlIndexCreateRequest > -1) {
saveRequestObject.requeststatuslabel = StateEnum.intakeinprogress.label;
saveRequestObject.requeststatusid = StateEnum.intakeinprogress.id;
setIsAddRequest(false);
}
dispatch(setFOILoader(setLoader))
Expand Down Expand Up @@ -176,7 +176,7 @@ const BottomButtonGroup = React.memo(
if (
currentSelectedStatus &&
currentSelectedStatus !== StateEnum.open.name &&
saveRequestObject.requeststatuslabel &&
saveRequestObject.requeststatusid &&
saveRequestObject.currentState
) {
//scanning team - MSD/CFD personal
Expand All @@ -200,7 +200,7 @@ const BottomButtonGroup = React.memo(
}
saveRequestModal();
} else {
saveRequestObject.requeststatuslabel = StateEnum.open.label;
saveRequestObject.requeststatusid = StateEnum.open.id;
if (currentSelectedStatus === StateEnum.open.name && ministryId) {
saveRequestModal();
}
Expand Down Expand Up @@ -231,7 +231,7 @@ const BottomButtonGroup = React.memo(
saveRequestObject.id = saveRequestObject.id
? saveRequestObject.id
: requestId;
saveRequestObject.requeststatuslabel = StateEnum.open.label;
saveRequestObject.requeststatusid = 1;
setOpenModal(true);
};

Expand Down Expand Up @@ -292,14 +292,14 @@ const BottomButtonGroup = React.memo(
if (currentSelectedStatus) {
switch (currentSelectedStatus) {
case StateEnum.closed.name:
saveRequestObject.requeststatuslabel = StateEnum.closed.label;
saveRequestObject.requeststatusid = StateEnum.closed.id;
saveRequestObject.closedate = closingDate;
saveRequestObject.closereasonid = closingReasonId;
break;

case StateEnum.callforrecords.name:
saveRequestObject.paymentExpiryDate = ""
saveRequestObject.requeststatuslabel = StateEnum.callforrecords.label;
saveRequestObject.requeststatusid = StateEnum.callforrecords.id;
if (
!("cfrDueDate" in saveRequestObject) ||
saveRequestObject.cfrDueDate === ""
Expand Down Expand Up @@ -354,7 +354,7 @@ const BottomButtonGroup = React.memo(
const status = Object.values(StateEnum).find(
(statusValue) => statusValue.name === currentSelectedStatus
);
saveRequestObject.requeststatuslabel = status.label;
saveRequestObject.requeststatusid = status.id;
if (currentSelectedStatus === StateEnum.onhold.name && !saveRequestObject.paymentExpiryDate) {
saveRequestObject.paymentExpiryDate = dueDateCalculation(new Date(), PAYMENT_EXPIRY_DAYS);
}
Expand Down
4 changes: 2 additions & 2 deletions forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ const FOIRequest = React.memo(({ userDetail }) => {
const assignedTo = getAssignedTo(requestDetails);
setAssignedToValue(assignedTo);
if (Object.entries(requestDetails)?.length !== 0) {
let requestStateFromId = findRequestState(requestDetails.requeststatuslabel)
? findRequestState(requestDetails.requeststatuslabel)
let requestStateFromId = findRequestState(requestDetails.requeststatusid)
? findRequestState(requestDetails.requeststatusid)
: StateEnum.unopened.name;
setRequestState(requestStateFromId);
settabStatus(requestStateFromId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,34 +186,34 @@ const BottomButtonGroup = React.memo(
const [successCount, setSuccessCount] = useState(0);
const [fileCount, setFileCount] = useState(0);
const [documents, setDocuments] = useState([]);

const saveStatusId = () => {
if (currentSelectedStatus) {
switch (currentSelectedStatus.toLowerCase()) {
case StateEnum.review.name.toLowerCase():
saveMinistryRequestObject.requeststatuslabel = StateEnum.review.label;
saveMinistryRequestObject.requeststatusid = StateEnum.review.id;
break;
case StateEnum.feeassessed.name.toLowerCase():
saveMinistryRequestObject.requeststatuslabel =
StateEnum.feeassessed.label;
saveMinistryRequestObject.requeststatusid =
StateEnum.feeassessed.id;
break;
case StateEnum.deduplication.name.toLowerCase():
saveMinistryRequestObject.requeststatuslabel =
StateEnum.deduplication.label;
saveMinistryRequestObject.requeststatusid =
StateEnum.deduplication.id;
break;
case StateEnum.harms.name.toLowerCase():
saveMinistryRequestObject.requeststatuslabel = StateEnum.harms.label;
saveMinistryRequestObject.requeststatusid = StateEnum.harms.id;
break;
case StateEnum.signoff.name.toLowerCase():
saveMinistryRequestObject.requeststatuslabel = StateEnum.signoff.label;
saveMinistryRequestObject.requeststatusid = StateEnum.signoff.id;
break;
case StateEnum.response.name.toLowerCase():
saveMinistryRequestObject.ministrysignoffapproval = ministryApprovalState;
saveMinistryRequestObject.requeststatuslabel = StateEnum.response.label;
saveMinistryRequestObject.requeststatusid = StateEnum.response.id;
break;
case StateEnum.callforrecords.name.toLowerCase():
saveMinistryRequestObject.requeststatuslabel =
StateEnum.callforrecords.label;
saveMinistryRequestObject.requeststatusid =
StateEnum.callforrecords.id;
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const RequestDetails = React.memo(
receivedDate: !!receivedDate ? formatDate(receivedDate): "",
requestStartDate: startDate ? formatDate(startDate): "",
dueDate: validateFields(requestDetails, FOI_COMPONENT_CONSTANTS.DUE_DATE, startDate ? formatDate(startDate): ""),
requestState: findRequestState(requestDetails?.requeststatuslabel)
requestState: findRequestState(requestDetails?.requeststatusid)
}
//event bubble up - sets the initial value to validate the required fields
handleRequestDetailsInitialValue(requestDetailsObject);
Expand Down
6 changes: 3 additions & 3 deletions forms-flow-web/src/components/FOI/FOIRequest/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ export const alertUser = (e) => {
e.returnValue = "";
};

export const findRequestState = (requestStatusLabel) => {
if (requestStatusLabel != undefined) {
export const findRequestState = (requestStatusId) => {
if (requestStatusId != undefined) {
let stateArray = Object.entries(StateEnum).find(
(value) => value[1].label === requestStatusLabel
(value) => value[1].id === requestStatusId
);
return stateArray[1].name;
}
Expand Down
Loading

0 comments on commit a47862f

Please sign in to comment.