awaiting submissions from storage acc

This commit is contained in:
2022-09-05 16:46:30 +01:00
parent b0dde836b0
commit c66883b4c5
25 changed files with 653 additions and 69 deletions
+27 -7
View File
@@ -15,7 +15,7 @@ import {
setNewAppealProgress,
} from "../../store/appealType/action";
import { getFormCollectionByID, getProgressObj } from "../utils";
import { updateCase, patchCase, uploadFiles } from "../../actions";
import { updateCase, patchCase, uploadFiles, sendEmail } from "../../actions";
import { FieldsTranslations } from "../elements";
import jsonpath from "jsonpath";
@@ -134,7 +134,7 @@ let BuildSection = (props) => {
});
};
const updateCaseProgress = (values) => {
const updateCaseProgress = (values, sendSavedEmail) => {
let incidentId = props.appealType.caseReference.incidentid;
let updateBody = values || {};
@@ -183,8 +183,28 @@ let BuildSection = (props) => {
primaryAttribute,
props.appealType.caseReference.ticketnumber
);
//console.log("patching////////");
//patchCase(incidentId);
sendSavedEmail == true &&
sendEmail(
props.props.accountDetails.loggedinUserEmail,
"Saved progress for appeal " +
props.appealType.caseReference.ticketnumber,
"Your saved appeal " +
props.appealType.caseReference.ticketnumber,
"You can resume your application at a later date <a href='" +
props.props.url +
"/myportal/" +
appTypeCollection.UrlName +
"?lpa=" +
props.appealType.appealLPA +
"&apt=" +
appTypeCollection.appealTypeID +
"&casereference=" +
props.appealType.caseReference.ticketnumber +
"&inid=" +
props.appealType.caseReference.incidentid +
"'> from here </a>"
);
};
const onHandleSubmit = (values) => {
@@ -193,7 +213,7 @@ let BuildSection = (props) => {
delete valuesObj["_pinswg_appellant_value"];
console.log("has errors:", props.invalid);
props.invalid == false && updateCaseProgress(valuesObj);
props.invalid == false && updateCaseProgress(valuesObj, false);
setCurrentSection(currentSection + 1);
};
@@ -309,7 +329,7 @@ let BuildSection = (props) => {
delete valuesObj["_pinswg_appellant_value"];
//console.log("on save:", valuesObj);
updateCaseProgress(valuesObj);
updateCaseProgress(valuesObj, false);
}}
>
{t("common:continue-button")}
@@ -373,7 +393,7 @@ let BuildSection = (props) => {
delete valuesObj["_pinswg_appellant_value"];
console.log("on save:", valuesObj);
updateCaseProgress(valuesObj);
updateCaseProgress(valuesObj, true);
router.replace(
router.locale != "en"
? router.locale + "/myportal"
+10 -1
View File
@@ -6,7 +6,7 @@ import { useEffect } from "react";
import { connect } from "react-redux";
import { formValueSelector } from "redux-form";
import xpath from "xpath";
import { updateCase, patchCase } from "../../actions";
import { updateCase, patchCase, sendEmail } from "../../actions";
import data from "../../data/collections.json";
import { setCurrentSection } from "../../store/appealType/action";
import { getFormCollectionByID } from "../utils";
@@ -49,6 +49,15 @@ let CompleteAppeal = (props) => {
primaryAttribute,
props.appealType.caseReference.ticketnumber
);
sendEmail(
props.props.accountDetails.loggedinUserEmail,
"Saved progress for appeal " +
props.appealType.caseReference.ticketnumber,
"Your saved appeal " + props.appealType.caseReference.ticketnumber,
"You have now completed your appeal."
);
console.log("patching////////");
patchCase(incidentId);
}, [
+2 -1
View File
@@ -454,7 +454,8 @@ let CreateCase = (props) => {
appTypeCollection.appealTypeID,
values.lpaTypes,
props.loggedInUser,
values
values,
props.containerID
)
.then((data) => {
router.replace(