Skip to content

Commit

Permalink
Merge pull request #5360 from bcgov/dev
Browse files Browse the repository at this point in the history
Merge CFD features from DEV to TEST env
  • Loading branch information
richard-aot authored Aug 13, 2024
2 parents 463c123 + 72a7bcc commit 2d3db9d
Show file tree
Hide file tree
Showing 32 changed files with 2,102 additions and 276 deletions.
2 changes: 1 addition & 1 deletion forms-flow-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ARG REACT_APP_RECORD_DOWNLOAD_LIMIT
ARG REACT_APP_RECORD_DOWNLOAD_SIZE_LIMIT

ENV NODE_ENV ${NODE_ENV}
ENV GENERATE_SOURCEMAP false
ENV GENERATE_SOURCEMAP ${GENERATE_SOURCEMAP}
ENV REACT_APP_API_SERVER_URL ${REACT_APP_API_SERVER_URL}
ENV REACT_APP_API_PROJECT_URL ${REACT_APP_API_PROJECT_URL}
ENV REACT_APP_KEYCLOAK_CLIENT ${REACT_APP_KEYCLOAK_CLIENT}
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-web/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
dockerfile: Dockerfile
args:
- NODE_ENV=${NODE_ENV:-development}
- GENERATE_SOURCEMAP=false
- GENERATE_SOURCEMAP=${GENERATE_SOURCEMAP}
- REACT_APP_CLIENT_ROLE=${CLIENT_ROLE:-formsflow-client}
- REACT_APP_STAFF_REVIEWER_ROLE=${REVIEWER_ROLE:-formsflow-reviewer}
- REACT_APP_STAFF_DESIGNER_ROLE=${DESIGNER_ROLE:-formsflow-designer}
Expand Down
3 changes: 3 additions & 0 deletions forms-flow-web/src/actions/FOI/foiActionConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const FOI_ACTION_CONSTANTS = {
FOI_MINISTRY_DIVISIONALSTAGES: "FOI_MINISTRY_DIVISIONALSTAGES",
FOI_PERSONAL_DIVISIONS_SECTIONS: "FOI_PERSONAL_DIVISIONS_SECTIONS",
FOI_PERSONAL_SECTIONS: "FOI_PERSONAL_SECTIONS",
FOI_PERSONAL_PEOPLE: "FOI_PERSONAL_PEOPLE",
FOI_PERSONAL_FILETYPES: "FOI_PERSONAL_FILETYPES",
FOI_PERSONAL_VOLUMES: "FOI_PERSONAL_VOLUMES",

FOI_WATCHER_LIST: "FOI_WATCHER_LIST",

Expand Down
18 changes: 18 additions & 0 deletions forms-flow-web/src/actions/FOI/foiRequestActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,24 @@ export const setFOIPersonalSections = (data) => dispatch => {
payload:data
})
}
export const setFOIPersonalPeople = (data) => dispatch => {
dispatch({
type:FOI_ACTION_CONSTANTS.FOI_PERSONAL_PEOPLE,
payload:data
})
}
export const setFOIPersonalFiletypes = (data) => dispatch => {
dispatch({
type:FOI_ACTION_CONSTANTS.FOI_PERSONAL_FILETYPES,
payload:data
})
}
export const setFOIPersonalVolumes = (data) => dispatch => {
dispatch({
type:FOI_ACTION_CONSTANTS.FOI_PERSONAL_VOLUMES,
payload:data
})
}
export const setFOIWatcherList = (data) => (dispatch) => {
dispatch({
type: FOI_ACTION_CONSTANTS.FOI_WATCHER_LIST,
Expand Down
4 changes: 4 additions & 0 deletions forms-flow-web/src/apiManager/endpoints/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const API = {
FOI_PERSONAL_DIVISIONS_SECTIONS: `${FOI_BASE_API_URL}/api/foiflow/divisions/<bcgovcode>/true/divisionsandsections`,
FOI_PERSONAL_SECTIONS: `${FOI_BASE_API_URL}/api/foiflow/divisions/<bcgovcode>/true/sections`,
FOI_PERSONAL_DIVISIONS: `${FOI_BASE_API_URL}/api/foiflow/divisions/<bcgovcode>/true/divisions`,
FOI_PERSONAL_PEOPLE: `${FOI_BASE_API_URL}/api/foiflow/divisions/<bcgovcode>/true/people`,
FOI_PERSONAL_FILETYPES: `${FOI_BASE_API_URL}/api/foiflow/divisions/<bcgovcode>/true/filetypes`,
FOI_PERSONAL_VOLUMES: `${FOI_BASE_API_URL}/api/foiflow/divisions/<bcgovcode>/true/volumes`,
FOI_POST_RAW_REQUEST_WATCHERS: `${FOI_BASE_API_URL}/api/foiwatcher/rawrequest`,
FOI_GET_RAW_REQUEST_WATCHERS: `${FOI_BASE_API_URL}/api/foiwatcher/rawrequest/<requestid>`,
FOI_POST_MINISTRY_REQUEST_WATCHERS: `${FOI_BASE_API_URL}/api/foiwatcher/ministryrequest`,
Expand Down Expand Up @@ -115,6 +118,7 @@ const API = {
FOI_REPLACE_RECORDS: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/record/<recordid>/replace`,
FOI_POST_RECORDS: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>`,
FOI_UPDATE_RECORDS: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/update`,
FOI_UPDATE_PERSONAL_ATTRIBUTES: `${FOI_BASE_API_URL}/api/foirecord/<requestid>/ministryrequest/<ministryrequestid>/updatepersonalattributes`,
DOC_REVIEWER_DELETE_RECORDS: `${DOC_REVIEWER_BASE_API_URL}/api/document/delete`,
DOC_REVIEWER_REDACTED_SECTIONS: `${DOC_REVIEWER_BASE_API_URL}/api/redactedsections/ministryrequest/<ministryrequestid>`,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import {
setFOIReceivedModeList,
setFOIMinistryDivisionalStages,
setFOIPersonalDivisionsAndSections,
setFOIPersonalPeople,
setFOIPersonalFiletypes,
setFOIPersonalVolumes,
setFOIPersonalSections,
setClosingReasons,
setFOISubjectCodeList,
Expand Down Expand Up @@ -418,6 +421,93 @@ import {
}
};

export const fetchFOIPersonalPeople = (bcgovcode) => {
switch(bcgovcode) {
case "MCF":
const apiUrlMCF = replaceUrl(API.FOI_PERSONAL_PEOPLE, "<bcgovcode>", bcgovcode);
return (dispatch) => {
httpGETRequest(apiUrlMCF, {}, UserService.getToken())
.then((res) => {
if (res.data) {
const foiPersonalSections = res.data;
dispatch(setFOIPersonalPeople({}));
dispatch(setFOIPersonalPeople(foiPersonalSections));
dispatch(setFOILoader(false));
} else {
console.log(`Error while fetching (${bcgovcode}) FOI records people`, res);
dispatch(serviceActionError(res));
dispatch(setFOILoader(false));
}
})
.catch((error) => {
console.log(`Error while fetching (${bcgovcode}) FOI records people`, error);
dispatch(serviceActionError(error));
dispatch(setFOILoader(false));
});
};
default:
break;
}
};

export const fetchFOIPersonalFiletypes = (bcgovcode) => {
switch(bcgovcode) {
case "MCF":
const apiUrlMCF = replaceUrl(API.FOI_PERSONAL_FILETYPES, "<bcgovcode>", bcgovcode);
return (dispatch) => {
httpGETRequest(apiUrlMCF, {}, UserService.getToken())
.then((res) => {
if (res.data) {
const foiPersonalSections = res.data;
dispatch(setFOIPersonalFiletypes({}));
dispatch(setFOIPersonalFiletypes(foiPersonalSections));
dispatch(setFOILoader(false));
} else {
console.log(`Error while fetching (${bcgovcode}) FOI records people`, res);
dispatch(serviceActionError(res));
dispatch(setFOILoader(false));
}
})
.catch((error) => {
console.log(`Error while fetching (${bcgovcode}) FOI records people`, error);
dispatch(serviceActionError(error));
dispatch(setFOILoader(false));
});
};
default:
break;
}
};

export const fetchFOIPersonalVolumes = (bcgovcode) => {
switch(bcgovcode) {
case "MCF":
const apiUrlMCF = replaceUrl(API.FOI_PERSONAL_VOLUMES, "<bcgovcode>", bcgovcode);
return (dispatch) => {
httpGETRequest(apiUrlMCF, {}, UserService.getToken())
.then((res) => {
if (res.data) {
const foiPersonalSections = res.data;
dispatch(setFOIPersonalVolumes({}));
dispatch(setFOIPersonalVolumes(foiPersonalSections));
dispatch(setFOILoader(false));
} else {
console.log(`Error while fetching (${bcgovcode}) FOI records people`, res);
dispatch(serviceActionError(res));
dispatch(setFOILoader(false));
}
})
.catch((error) => {
console.log(`Error while fetching (${bcgovcode}) FOI records people`, error);
dispatch(serviceActionError(error));
dispatch(setFOILoader(false));
});
};
default:
break;
}
};

export const fetchFOIPersonalDivisions = (bcgovcode) => {
const apiUrl = replaceUrl(API.FOI_PERSONAL_DIVISIONS, "<bcgovcode>", bcgovcode);
return (dispatch) => {
Expand Down
15 changes: 15 additions & 0 deletions forms-flow-web/src/apiManager/services/FOI/foiRecordServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,21 @@ export const updateFOIRecords = (requestId, ministryId, data, ...rest) => {
};
};

export const editPersonalAttributes = (requestId, ministryId, data, ...rest) => {
if (!ministryId) {
return () => {};
}
const done = fnDone(rest);
let apiUrl = replaceUrl(
replaceUrl(API.FOI_UPDATE_PERSONAL_ATTRIBUTES, "<ministryrequestid>", ministryId),
"<requestid>",
requestId
);
return (dispatch) => {
postRecord(dispatch, apiUrl, data, "Error in updating records", rest);
};
};

export const deleteReviewerRecords = (filepaths, ...rest) => {
const done = fnDone(rest);
let apiUrl = API.DOC_REVIEWER_DELETE_RECORDS;
Expand Down
13 changes: 12 additions & 1 deletion forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import {
fetchFOIMinistryAssignedToList,
fetchFOISubjectCodeList,
fetchFOIPersonalDivisionsAndSections,
fetchFOIPersonalPeople,
fetchFOIPersonalFiletypes,
fetchFOIPersonalVolumes,
fetchOIPCOutcomes,
fetchOIPCStatuses,
fetchOIPCReviewtypes,
Expand Down Expand Up @@ -380,9 +383,16 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
setIsIAORestricted(isRequestRestricted(requestDetails, ministryId));
}

if(MinistryNeedsScanning.includes(bcgovcode.replaceAll('"', '')) && requestDetails.requestType == FOI_COMPONENT_CONSTANTS.REQUEST_TYPE_PERSONAL) {
if(
MinistryNeedsScanning.includes(bcgovcode.replaceAll('"', '')) &&
requestDetails.requestType ==
FOI_COMPONENT_CONSTANTS.REQUEST_TYPE_PERSONAL
) {
dispatch(fetchFOIPersonalDivisionsAndSections(bcgovcode.replaceAll('"', '')));
if(bcgovcode.replaceAll('"', '') == "MCF") {
dispatch(fetchFOIPersonalPeople(bcgovcode.replaceAll('"', '')));
dispatch(fetchFOIPersonalFiletypes(bcgovcode.replaceAll('"', '')));
dispatch(fetchFOIPersonalVolumes(bcgovcode.replaceAll('"', '')));
setIsMCFPersonal(true);
}
}
Expand Down Expand Up @@ -1669,6 +1679,7 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
setLockRecordsTab={setLockRecordsTab}
validLockRecordsState={validLockRecordsState}
setSaveRequestObject={setSaveRequestObject}
handleSaveRequest={handleSaveRequest}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import {
import {
fetchFOIMinistryAssignedToList,
fetchFOIPersonalDivisionsAndSections,
fetchFOIPersonalPeople,
fetchFOIPersonalFiletypes,
fetchFOIPersonalVolumes,
} from "../../../../apiManager/services/FOI/foiMasterDataServices";

import { fetchFOIRequestAttachmentsList } from "../../../../apiManager/services/FOI/foiAttachmentServices";
Expand Down Expand Up @@ -283,10 +286,11 @@ const MinistryReview = React.memo(({ userDetail }) => {
requestDetails.requestType ==
FOI_COMPONENT_CONSTANTS.REQUEST_TYPE_PERSONAL
) {
dispatch(
fetchFOIPersonalDivisionsAndSections(bcgovcode.replaceAll('"', ""))
);
dispatch(fetchFOIPersonalDivisionsAndSections(bcgovcode.replaceAll('"', "")));
if (bcgovcode.replaceAll('"', "") == "MCF") {
dispatch(fetchFOIPersonalPeople(bcgovcode.replaceAll('"', '')));
dispatch(fetchFOIPersonalFiletypes(bcgovcode.replaceAll('"', '')));
dispatch(fetchFOIPersonalVolumes(bcgovcode.replaceAll('"', '')));
setIsMCFPersonal(true);
}
}
Expand Down Expand Up @@ -1078,6 +1082,7 @@ const MinistryReview = React.memo(({ userDetail }) => {
requestType={requestDetails?.requestType}
lockRecords={lockRecordsTab}
validLockRecordsState={validLockRecordsState}
handleSaveRequest={handleSaveRequest}
/>
</>
) : (
Expand Down
Loading

0 comments on commit 2d3db9d

Please sign in to comment.