Skip to content

Commit

Permalink
Merged in r2-3025-referral-generation (pull request #6925)
Browse files Browse the repository at this point in the history
R2-3025: Fixing issues where external referral hang

Approved-by: Dennis Hernandez
  • Loading branch information
jtoliver-quoin authored and pnabutovsky committed Sep 18, 2024
2 parents 6c1c925 + c7657b3 commit 5e024e0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,7 @@ export const saveReferral = (recordId, recordType, body, message) => {
}
};
};

export const resetReferralSuccess = () => ({
type: actions.REFER_USER_SUCCESS_FINISHED
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe("<Transitions /> - Action Creators", () => {
delete creators.fetchTransitionData;
delete creators.fetchReferralUsers;
delete creators.saveReferral;
delete creators.resetReferralSuccess;

expect(creators).to.deep.equal({});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const actions = namespaceActions(NAMESPACE, [
"TRANSFER_USERS_FETCH_SUCCESS",
"TRANSFER_USER_FAILURE",
"TRANSFER_USER_STARTED",
"TRANSFER_USER_SUCCESS"
"TRANSFER_USER_SUCCESS",
"REFER_USER_SUCCESS_FINISHED"
]);

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ describe("<Transitions /> - Actions", () => {
"TRANSFER_USER_SUCCESS",
"USERS_ASSIGN_TO",
"USERS_REFER_TO",
"USERS_TRANSFER_TO"
"USERS_TRANSFER_TO",
"REFER_USER_SUCCESS_FINISHED"
].forEach(property => {
expect(cloneActions).to.have.property(property);
expect(cloneActions[property]).to.be.a("string");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default (state = DEFAULT_STATE, { type, payload }) => {
.update("data", data => {
return data.unshift(TransitionRecord(payload.data));
});
case Actions.REFER_USER_FINISHED:
case Actions.REFER_USER_SUCCESS_FINISHED:
return state.setIn(["referral", "success"], false);
default:
return state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Form, { OPTION_TYPES } from "../../../form";
import { useI18n } from "../../../i18n";
import { RECORD_TYPES } from "../../../../config";
import { getRecordForms, getServiceToRefer } from "../../../record-form/selectors";
import { saveReferral } from "../action-creators";
import { resetReferralSuccess, saveReferral } from "../action-creators";
import { getErrorsByTransitionType } from "../selectors";
import { setServiceToRefer } from "../../../record-form/action-creators";
import PdfExporter from "../../../pdf-exporter";
Expand Down Expand Up @@ -107,6 +107,7 @@ function Referrals({
useEffect(() => {
if (submittedSuccessfully && formValues.remote) {
pdfExporterRef.current.savePdf({ setPending, close: handleClose, values: formValues });
dispatch(resetReferralSuccess());
}
}, [submittedSuccessfully]);

Expand Down

0 comments on commit 5e024e0

Please sign in to comment.