Skip to content

Commit

Permalink
Merge pull request #4935 from bcgov/dev-rook-ST-4169
Browse files Browse the repository at this point in the history
Dev rook st 4169
  • Loading branch information
sumathi-thirumani authored Dec 27, 2023
2 parents 27d92b7 + 1b71bf8 commit 58e19e8
Show file tree
Hide file tree
Showing 9 changed files with 281 additions and 16 deletions.
6 changes: 5 additions & 1 deletion forms-flow-web/src/actions/FOI/foiActionConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ const FOI_ACTION_CONSTANTS = {
"FOI_PDF_STITCHED_STATUS_FOR_RESPONSEPACKAGE",
FOI_PDF_STITCHED_RECORD_FOR_RESPONSEPACKAGE:
"FOI_PDF_STITCHED_RECORD_FOR_RESPONSEPACKAGE",

FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINEREVIEW: "FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINEREVIEW",
FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINEREVIEW: "FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINEREVIEW",
FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINE: "FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINE",
FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINE: "FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINE",

OIPC_OUTCOMES: "OIPC_OUTCOMES",
OIPC_STATUSES: "OIPC_STATUSES",
OIPC_REVIEWTYPES: "OIPC_REVIEWTYPES",
Expand Down
24 changes: 24 additions & 0 deletions forms-flow-web/src/actions/FOI/foiRequestActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ export const setFOIPDFStitchedRecordForResponsePackage =
payload: data,
});
};
export const setFOIPDFStitchedRecordForOipcRedlineReview = (data) => (dispatch) => {
dispatch({
type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINEREVIEW,
payload: data,
});
}
export const setFOIPDFStitchedRecordForOipcRedline = (data) => (dispatch) => {
dispatch({
type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_RECORD_FOR_OIPCREDLINE,
payload: data,
});
}
export const setFOIPDFStitchStatusForHarms = (data) => (dispatch) => {
dispatch({
type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_HARMS,
Expand All @@ -166,6 +178,18 @@ export const setFOIPDFStitchStatusForResponsePackage = (data) => (dispatch) => {
payload: data,
});
};
export const setFOIPDFStitchStatusForOipcRedlineReview = (data) => (dispatch) => {
dispatch({
type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINEREVIEW,
payload: data,
});
};
export const setFOIPDFStitchStatusForOipcRedline = (data) => (dispatch) => {
dispatch({
type: FOI_ACTION_CONSTANTS.FOI_PDF_STITCHED_STATUS_FOR_OIPCREDLINE,
payload: data,
});
};

export const serviceActionError = (_data) => (dispatch) => {
//TODO update to a common file
Expand Down
5 changes: 5 additions & 0 deletions forms-flow-web/src/apiManager/endpoints/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ const API = {
FOI_DOWNLOAD_RECORDS_FOR_RESPONSEPACKAGE: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/download/responsepackage`,
FOI_PDF_STITCH_STATUS_FOR_RESPONSEPACKAGE: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/responsepackage/pdfstitchjobstatus`,

FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINEREVIEW: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/download/oipcreviewredline`,
FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINEREVIEW: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/oipcreviewredline/pdfstitchjobstatus`,
FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINE: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/download/oipcredline`,
FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINE: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/oipcredline/pdfstitchjobstatus`,

FOI_GET_OIPC_OUTCOMES: `${FOI_BASE_API_URL}/api/foiflow/oipc/outcomes`,
FOI_GET_OIPC_STATUSES: `${FOI_BASE_API_URL}/api/foiflow/oipc/statuses`,
FOI_GET_OIPC_REVIEWTYPES: `${FOI_BASE_API_URL}/api/foiflow/oipc/reviewtypes`,
Expand Down
142 changes: 142 additions & 0 deletions forms-flow-web/src/apiManager/services/FOI/foiRecordServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import {
setFOIPDFStitchedRecordForRedlines,
setFOIPDFStitchStatusForResponsePackage,
setFOIPDFStitchedRecordForResponsePackage,
setFOIPDFStitchedRecordForOipcRedlineReview,
setFOIPDFStitchStatusForOipcRedlineReview,
setFOIPDFStitchStatusForOipcRedline,
setFOIPDFStitchedRecordForOipcRedline,
} from "../../../actions/FOI/foiRequestActions";
import { fnDone } from "./foiServicesUtil";
import UserService from "../../../services/UserService";
Expand Down Expand Up @@ -479,3 +483,141 @@ export const fetchPDFStitchedRecordForResponsePackage = (
});
};
};

export const fetchPDFStitchedStatusForOIPCRedline = (
requestId,
ministryId,
...rest) => {
if (!ministryId) {
return () => {};
}
const done = fnDone(rest);
let apiUrl = replaceUrl(
replaceUrl(
API.FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINE,
"<ministryrequestid>",
ministryId
),
"<requestid>",
requestId
);
return (dispatch) => {
httpGETRequest(apiUrl, {}, UserService.getToken())
.then((res) => {
if (res.data) {
dispatch(setFOIPDFStitchStatusForOipcRedline(res.data));
done(null, res.data);
}
})
.catch((error) => {
console.log("Error in fetching pdfstitch job status", error);
dispatch(serviceActionError(error));
done(error);
});
};
}

export const fetchPDFStitchedRecordForOIPCRedline = (
requestId,
ministryId,
...rest) => {
if (!ministryId) {
return () => {};
}
const done = fnDone(rest);
let apiUrl = replaceUrl(
replaceUrl(
API.FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINE,
"<ministryrequestid>",
ministryId
),
"<requestid>",
requestId
);
return (dispatch) => {
httpGETRequest(apiUrl, {}, UserService.getToken())
.then((res) => {
if (res.data) {
dispatch(setFOIPDFStitchedRecordForOipcRedline(res.data));
done(null, res.data);
} else {
console.log("Error in fetching records for redlines", res);
dispatch(serviceActionError(res));
}
})
.catch((error) => {
console.log("Error in fetching records for redlines", error);
dispatch(serviceActionError(error));
done(error);
});
};
}

export const fetchPDFStitchedStatusForOIPCRedlineReview = (
requestId,
ministryId,
...rest) => {
if (!ministryId) {
return () => {};
}
const done = fnDone(rest);
let apiUrl = replaceUrl(
replaceUrl(
API.FOI_PDF_STITCH_STATUS_FOR_OIPCREDLINEREVIEW,
"<ministryrequestid>",
ministryId
),
"<requestid>",
requestId
);
return (dispatch) => {
httpGETRequest(apiUrl, {}, UserService.getToken())
.then((res) => {
if (res.data) {
dispatch(setFOIPDFStitchStatusForOipcRedlineReview(res.data));
done(null, res.data);
}
})
.catch((error) => {
console.log("Error in fetching pdfstitch job status", error);
dispatch(serviceActionError(error));
done(error);
});
};
}

export const fetchPDFStitchedRecordForOIPCRedlineReview = (
requestId,
ministryId,
...rest) => {
if (!ministryId) {
return () => {};
}
const done = fnDone(rest);
let apiUrl = replaceUrl(
replaceUrl(
API.FOI_DOWNLOAD_RECORDS_FOR_OIPCREDLINEREVIEW,
"<ministryrequestid>",
ministryId
),
"<requestid>",
requestId
);
return (dispatch) => {
httpGETRequest(apiUrl, {}, UserService.getToken())
.then((res) => {
if (res.data) {
dispatch(setFOIPDFStitchedRecordForOipcRedlineReview(res.data));
done(null, res.data);
} else {
console.log("Error in fetching records for redlines", res);
dispatch(serviceActionError(res));
}
})
.catch((error) => {
console.log("Error in fetching records for redlines", error);
dispatch(serviceActionError(error));
done(error);
});
};
}
4 changes: 4 additions & 0 deletions forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import {
fetchRedactedSections,
fetchPDFStitchStatusForRedlines,
fetchPDFStitchStatusForResponsePackage,
fetchPDFStitchedStatusForOIPCRedlineReview,
fetchPDFStitchedStatusForOIPCRedline,
} from "../../../apiManager/services/FOI/foiRecordServices";
import { makeStyles } from "@material-ui/core/styles";
import FOI_COMPONENT_CONSTANTS from "../../../constants/FOI/foiComponentConstants";
Expand Down Expand Up @@ -301,6 +303,8 @@ const FOIRequest = React.memo(({ userDetail }) => {
dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId));
dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId));
dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId));
dispatch(fetchPDFStitchedStatusForOIPCRedline(requestId, ministryId));
dispatch(fetchPDFStitchedStatusForOIPCRedlineReview(requestId, ministryId));
fetchCFRForm(ministryId, dispatch);
dispatch(fetchApplicantCorrespondence(requestId, ministryId));
dispatch(fetchApplicantCorrespondenceTemplates());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import {
fetchPDFStitchStatusForHarms,
fetchPDFStitchStatusForRedlines,
fetchPDFStitchStatusForResponsePackage,
fetchPDFStitchedStatusForOIPCRedlineReview,
fetchPDFStitchedStatusForOIPCRedline,
} from "../../../../apiManager/services/FOI/foiRecordServices";

import { fetchCFRForm } from "../../../../apiManager/services/FOI/foiCFRFormServices";
Expand Down Expand Up @@ -213,6 +215,8 @@ const MinistryReview = React.memo(({ userDetail }) => {
dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId));
dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId));
dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId));
dispatch(fetchPDFStitchedStatusForOIPCRedline(requestId, ministryId));
dispatch(fetchPDFStitchedStatusForOIPCRedlineReview(requestId, ministryId));
fetchCFRForm(ministryId, dispatch);
if (bcgovcode) dispatch(fetchFOIMinistryAssignedToList(bcgovcode));
}
Expand Down Expand Up @@ -345,6 +349,8 @@ const MinistryReview = React.memo(({ userDetail }) => {
dispatch(fetchPDFStitchStatusForHarms(requestId, ministryId));
dispatch(fetchPDFStitchStatusForRedlines(requestId, ministryId));
dispatch(fetchPDFStitchStatusForResponsePackage(requestId, ministryId));
dispatch(fetchPDFStitchedStatusForOIPCRedline(requestId, ministryId));
dispatch(fetchPDFStitchedStatusForOIPCRedlineReview(requestId, ministryId));
fetchCFRForm(ministryId, dispatch);
setStateChanged(false);
setcurrentrequestStatus(_state);
Expand Down
Loading

0 comments on commit 58e19e8

Please sign in to comment.