Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 14 (Open Info) Bug Fix - Handling of inflight requets + handling of requests exempt from open info #5508

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions forms-flow-web/src/components/FOI/FOIRequest/FOIRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,13 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {

const [unsavedPrompt, setUnsavedPrompt] = useState(false);
const [unsavedMessage, setUnsavedMessage] = useState(<></>);
const commentTypes = useSelector((state) => state.foiRequests.foiCommentTypes);
const commentTypes = useSelector((state) => state.foiRequests.foiCommentTypes);

//get foiopeninfo request details from the store
let foiOITransactionData = useSelector(
(state) => state.foiRequests.foiOpenInfoRequest
);
const activePublicationRequest = !SKIP_OPENINFO_MINISTRIES.split(",").includes(requestDetails?.bcgovcode?.toUpperCase()) && requestDetails?.requestType === FOI_COMPONENT_CONSTANTS.REQUEST_TYPE_GENERAL;

const handleUnsavedContinue = () => {
window.removeEventListener("popstate", handleOnHashChange);
Expand Down Expand Up @@ -396,7 +401,7 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
}, [requestId, ministryId, comment, attachments]);

useEffect(() => {
if (!SKIP_OPENINFO_MINISTRIES.split(",").includes(requestDetails?.bcgovcode?.toUpperCase()) && requestDetails?.requestType === FOI_COMPONENT_CONSTANTS.REQUEST_TYPE_GENERAL) {
if (activePublicationRequest) {
dispatch(fetchFOIOpenInfoRequest(ministryId));
}
}, [requestId, ministryId, requestDetails])
Expand Down Expand Up @@ -1132,11 +1137,11 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
requestState !== StateEnum.appfeeowing.name &&
requestDetails?.requestType === FOI_COMPONENT_CONSTANTS.REQUEST_TYPE_GENERAL)
}

const showOpenInformationTab = () => {
return (
requestDetails?.requestType === FOI_COMPONENT_CONSTANTS.REQUEST_TYPE_GENERAL &&
!SKIP_OPENINFO_MINISTRIES.includes(requestDetails?.bcgovcode) &&
foiOITransactionData &&
Object.keys(foiOITransactionData).length > 0 &&
activePublicationRequest &&
requestState !== StateEnum.intakeinprogress.name &&
requestState !== StateEnum.unopened.name
);
Expand All @@ -1157,7 +1162,7 @@ const FOIRequest = React.memo(({ userDetail, openApplicantProfileModal }) => {
}
}

return (!isLoading &&
return (!isLoading && (activePublicationRequest ? foiOITransactionData : true) &&
requestDetails &&
Object.keys(requestDetails).length !== 0) ||
isAddRequest ? (
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-web/src/modules/FOI/foiRequestsReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const initialState = {
oiExemptions: [],
oiPublicationStatuses: [],
oiStatuses: [],
foiOpenInfoRequest: {},
// foiOpenInfoRequest: {},
foiOpenInfoAdditionalFiles: [],
foiPDFStitchedOIPackage: {},
foiPDFStitchStatusForOIPackage: "not started",
Expand Down
4 changes: 2 additions & 2 deletions request-management-api/request_api/resources/foiopeninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class FOIOpenInfoRequest(Resource):
def get(foiministryrequestid, usertype=None):
try:
result = openinfoservice().getcurrentfoiopeninforequest(foiministryrequestid)
if result in (None, {}):
return {"status": False, "message": "Could not find FOIOpenInfoRequest"}, 404
# if result in (None, {}):
# return {"status": False, "message": "Could not find FOIOpenInfoRequest"}, 404
return json.dumps(result), 200
except ValidationError as err:
return {'status': False, 'message': str(err)}, 400
Expand Down