awaiting submissions from storage acc
This commit is contained in:
@@ -246,13 +246,13 @@ let Login = (props) => {
|
||||
</button>
|
||||
)}
|
||||
{session && (
|
||||
<button
|
||||
className="govuk-button"
|
||||
type="button"
|
||||
onClick={() => signOut()}
|
||||
>
|
||||
Magic Link Sign Out
|
||||
</button>
|
||||
// <button
|
||||
// className="govuk-button"
|
||||
// type="button"
|
||||
// onClick={() => signOut()}
|
||||
// >
|
||||
// Magic Link Sign Out
|
||||
// </button>
|
||||
)}
|
||||
</div>
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
|
||||
@@ -5,6 +5,8 @@ import { useRouter } from "next/router";
|
||||
import { destroyCookie } from "nookies";
|
||||
import TimeOut from "../components/timeout";
|
||||
import AwaitingSubmission from "./myportal/awaitingsubmission";
|
||||
import AwaitingSubmissionFromBlob from "./myportal/awaitingsubmissionfromblob";
|
||||
|
||||
import Dns from "./myportal/dns";
|
||||
import MakeNewAppeal from "./myportal/makenewappeal";
|
||||
import MyCases from "./myportal/mycases";
|
||||
@@ -101,6 +103,16 @@ const MyPortal = (props) => {
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{props.awaitingSubmission
|
||||
.awaitingSubmissionFromBlob["@odata.count"] >
|
||||
0 && (
|
||||
<AwaitingSubmissionFromBlob
|
||||
awaitingSubmissionFromBlob={
|
||||
props.awaitingSubmission
|
||||
.awaitingSubmissionFromBlob
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{props.myCases.myCases["@odata.count"] > 0 && (
|
||||
<MyCases myCases={props.myCases} />
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import TopThree from "./topthree";
|
||||
import { connect } from "react-redux";
|
||||
import { setCurrentView } from "../../store/currentView/action";
|
||||
|
||||
const AwaitingSubmissionFromBlob = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { setCurrentView } = props;
|
||||
|
||||
let topthreeRow = [];
|
||||
let showTopThreeArr = props.awaitingSubmissionFromBlob.value;
|
||||
|
||||
let topThreeOnlyArr = showTopThreeArr;
|
||||
Object.keys(topThreeOnlyArr).map((key, index) => {
|
||||
topthreeRow.push(
|
||||
<div className="cardModuleItem" key={index}>
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:case-reference")}:</b>
|
||||
{showTopThreeArr[index].pinswg_name}
|
||||
</div>
|
||||
|
||||
<div className="carModuleAddress">
|
||||
<b>{t("myportal:case-address")}:</b>{" "}
|
||||
{_.isEmpty(showTopThreeArr)
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(showTopThreeArr[index])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(showTopThreeArr[index])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(
|
||||
showTopThreeArr[index].pinswg_siteaddressline1
|
||||
)
|
||||
? t("myportal:case-address-not-entered")
|
||||
: showTopThreeArr[index].pinswg_siteaddressline1 +
|
||||
(!_.isEmpty(
|
||||
showTopThreeArr[index].pinswg_siteaddressline2
|
||||
)
|
||||
? ", " +
|
||||
showTopThreeArr[index]
|
||||
.pinswg_siteaddressline2
|
||||
: "") +
|
||||
(!_.isEmpty(
|
||||
showTopThreeArr[index].pinswg_siteaddresstown
|
||||
)
|
||||
? ", " +
|
||||
showTopThreeArr[index]
|
||||
.pinswg_siteaddresstown
|
||||
: "")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="card" id="casescomment-card">
|
||||
<div className="card-body">
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("myportal:awatitingsubmission-card-title")}
|
||||
</h3>
|
||||
<div className="cardModuleContainer">
|
||||
{topthreeRow}
|
||||
{/* <TopThree
|
||||
showTopThree={props.awaitingSubmissionFromBlob}
|
||||
showDetails={props.awaitingSubmissionFromBlob}
|
||||
topThreeType={"awaitingSubmissionFromBlob"}
|
||||
/> */}
|
||||
</div>
|
||||
{props.awaitingSubmissionFromBlob["@odata.count"] > 3 && (
|
||||
<div className="cardVieAll">
|
||||
<Link href="/myportal/viewall">
|
||||
<a
|
||||
className="govuk-link--no-underline"
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
"viewName": "Awaiting Submission",
|
||||
"viewKey": "awaitingSubmission",
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("myportal:viewall-link")}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
setCurrentView: (currentView) => {
|
||||
dispatch(setCurrentView(currentView));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(AwaitingSubmissionFromBlob);
|
||||
@@ -142,7 +142,8 @@ const TopThree = (props) => {
|
||||
<b>{t("myportal:case-reference")}:</b>
|
||||
<Link
|
||||
href={
|
||||
topThreeType == "awaitingSubmission"
|
||||
topThreeType == "awaitingSubmission" ||
|
||||
topThreeType == "awaitingSubmissionFromBlob"
|
||||
? router.locale == "cy"
|
||||
? "/fymhorth/parhauigyflwyno"
|
||||
: "/myportal" +
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}, [
|
||||
|
||||
@@ -454,7 +454,8 @@ let CreateCase = (props) => {
|
||||
appTypeCollection.appealTypeID,
|
||||
values.lpaTypes,
|
||||
props.loggedInUser,
|
||||
values
|
||||
values,
|
||||
props.containerID
|
||||
)
|
||||
.then((data) => {
|
||||
router.replace(
|
||||
|
||||
Reference in New Issue
Block a user