added in message queue for applications and reps
This commit is contained in:
@@ -19,6 +19,8 @@ import {
|
||||
setRepresentationSubmit,
|
||||
setSubmitBack,
|
||||
setRepresentationSubmitConfirmation,
|
||||
setRepresentationMessageSent,
|
||||
setRepresentationReset,
|
||||
} from "../../../store/currentView/action";
|
||||
import RepCapacitySelection from "./representationCapacitySelection";
|
||||
import RepDetails from "./representationDetails";
|
||||
@@ -65,6 +67,7 @@ let MakeRepresentation = (props) => {
|
||||
setSubmitBack,
|
||||
handleSubmit,
|
||||
setRepresentationSubmitConfirmation,
|
||||
setRepresentationMessageSent,
|
||||
} = props;
|
||||
const formObj = props.props.form;
|
||||
let setCaseQueryObj = props[currentType] || {};
|
||||
@@ -388,9 +391,13 @@ let MakeRepresentation = (props) => {
|
||||
setRepresentationSubmit={setRepresentationSubmit}
|
||||
currentView={currentView}
|
||||
setSubmitBack={setSubmitBack}
|
||||
setRepresentationMessageSent={
|
||||
setRepresentationMessageSent
|
||||
}
|
||||
setRepresentationSubmitConfirmation={
|
||||
setRepresentationSubmitConfirmation
|
||||
}
|
||||
props={props}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
@@ -453,6 +460,12 @@ const mapDispatchToProps = (dispatch) => {
|
||||
setRepresentationSubmitConfirmation: () => {
|
||||
dispatch(setRepresentationSubmitConfirmation(true));
|
||||
},
|
||||
setRepresentationMessageSent: (messageSent) => {
|
||||
dispatch(setRepresentationMessageSent(messageSent));
|
||||
},
|
||||
setRepresentationReset: () => {
|
||||
dispatch(setRepresentationReset());
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { Field, reduxForm } from "redux-form";
|
||||
import {
|
||||
RenderPickList,
|
||||
RenderTextfield,
|
||||
RenderRadioList,
|
||||
RenderMultiline,
|
||||
} from "./representationElements";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setSubmitBack,
|
||||
} from "../../../store/currentView/action";
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { sendEmail, sendRepCompleteMessage } from "../../../actions";
|
||||
import { setRepresentationReset } from "../../../store/currentView/action";
|
||||
|
||||
const RepComplete = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -28,6 +20,7 @@ const RepComplete = (props) => {
|
||||
currentView,
|
||||
setSubmitBack,
|
||||
setRepresentationSubmitConfirmation,
|
||||
setRepresentationMessageSent,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const files = acceptedFiles.map((file) => (
|
||||
@@ -36,6 +29,28 @@ const RepComplete = (props) => {
|
||||
</li>
|
||||
));
|
||||
|
||||
useEffect(() => {
|
||||
const reference = "PEDW-REPRESENTATION-COMPLETE";
|
||||
const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
|
||||
const emailAddress =
|
||||
props.props.props.props.accountDetails.accountDetails.emailaddress1;
|
||||
const personalisation = {
|
||||
"caseReference":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"emailAddress":
|
||||
props.props.props.props.accountDetails.accountDetails
|
||||
.emailaddress1,
|
||||
"linkExpiry": 10 * 60,
|
||||
};
|
||||
|
||||
props.props.currentView.representationMessageSent != true &&
|
||||
(sendRepCompleteMessage(
|
||||
props.props.props.props.accountDetails.containerID,
|
||||
props.props.currentView.caseReference.currentReference
|
||||
),
|
||||
sendEmail(templateId, emailAddress, personalisation, reference),
|
||||
setRepresentationMessageSent(true));
|
||||
});
|
||||
return (
|
||||
<div id="rep-appellant">
|
||||
<div className="govuk-grid-column-full">
|
||||
@@ -64,7 +79,12 @@ const RepComplete = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<Link href="/myportal">
|
||||
<a className="govuk-button">Continue</a>
|
||||
<a
|
||||
onClick={() => setRepresentationReset()}
|
||||
className="govuk-button"
|
||||
>
|
||||
Continue
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,8 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import _ from "lodash";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { Field, reduxForm } from "redux-form";
|
||||
import {
|
||||
RenderPickList,
|
||||
RenderTextfield,
|
||||
RenderRadioList,
|
||||
RenderMultiline,
|
||||
} from "./representationElements";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setSubmitBack,
|
||||
setRepresentationSubmitConfirmation,
|
||||
} from "../../../store/currentView/action";
|
||||
import { useRouter } from "next/router";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import RepComplete from "./representationComplete";
|
||||
import _ from "lodash";
|
||||
|
||||
const RepCompleteSubmit = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -31,6 +17,8 @@ const RepCompleteSubmit = (props) => {
|
||||
currentView,
|
||||
setSubmitBack,
|
||||
setRepresentationSubmitConfirmation,
|
||||
setRepresentationMessageSent,
|
||||
setRepresentationReset,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const files = acceptedFiles.map((file) => (
|
||||
@@ -44,7 +32,11 @@ const RepCompleteSubmit = (props) => {
|
||||
return (
|
||||
<>
|
||||
{currentView.representationSubmitConfirmation == true ? (
|
||||
<RepComplete />
|
||||
<RepComplete
|
||||
props={props}
|
||||
setRepresentationMessageSent={setRepresentationMessageSent}
|
||||
setRepresentationReset={setRepresentationReset}
|
||||
/>
|
||||
) : (
|
||||
<div id="rep-appellant">
|
||||
<div className="govuk-grid-column-full">
|
||||
|
||||
@@ -1,27 +1,24 @@
|
||||
import Link from "next/link";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { parseCookies } from "nookies";
|
||||
import { connect } from "react-redux";
|
||||
import {
|
||||
getWatchedCasesProxy,
|
||||
getPortalModuleDetailsProxy,
|
||||
deleteWatchedCases,
|
||||
deleteAwaitingSubmissions,
|
||||
deleteWatchedCases,
|
||||
getAwaitingSubmissionProxy,
|
||||
getPortalModuleDetailsProxy,
|
||||
getWatchedCasesProxy,
|
||||
} from "../../actions";
|
||||
import jsonpath from "jsonpath";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import {
|
||||
setWatchedCases,
|
||||
setWatchedCasesDetails,
|
||||
} from "../../store/watchedCases/action";
|
||||
import {
|
||||
setAwaitingSubmission,
|
||||
setAwaitingSubmissionDetails,
|
||||
} from "../../store/awaitingSubmission/action";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import {
|
||||
setWatchedCases,
|
||||
setWatchedCasesDetails,
|
||||
} from "../../store/watchedCases/action";
|
||||
import { getFormCollectionByID } from "../utils";
|
||||
|
||||
const TopThree = (props) => {
|
||||
@@ -139,8 +136,16 @@ const TopThree = (props) => {
|
||||
<div className="cardModuleItem" key={index}>
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>Representation ID:</b>
|
||||
<Link href="#">
|
||||
<b>Representation ID:</b>{" "}
|
||||
<Link
|
||||
// href={{
|
||||
// pathname: "/myportal/representation",
|
||||
// query: {
|
||||
// case: showTopThreeArr[key].casereference,
|
||||
// },
|
||||
// }}
|
||||
href="#"
|
||||
>
|
||||
<a
|
||||
className="govuk-link--no-underline"
|
||||
data-id={index}
|
||||
@@ -175,7 +180,8 @@ const TopThree = (props) => {
|
||||
</Link>
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:case-reference")}:</b>{" "}
|
||||
<b>{t("myportal:case-reference")}:</b>
|
||||
{" "}
|
||||
{showTopThreeArr[key].casereference}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import jsonpath from "jsonpath";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { formValueSelector } from "redux-form";
|
||||
import xpath from "xpath";
|
||||
import { updateCase, patchCase, sendEmail } from "../../actions";
|
||||
import data from "../../data/collections.json";
|
||||
import {
|
||||
patchCase,
|
||||
sendCaseCompleteMessage,
|
||||
sendEmail,
|
||||
updateCase,
|
||||
} from "../../actions";
|
||||
import { setCurrentSection } from "../../store/appealType/action";
|
||||
import { getFormCollectionByID } from "../utils";
|
||||
|
||||
@@ -60,6 +62,11 @@ let CompleteAppeal = (props) => {
|
||||
};
|
||||
sendEmail(templateId, emailAddress, personalisation, reference);
|
||||
|
||||
sendCaseCompleteMessage(
|
||||
props.appealType.caseReference.ticketnumber,
|
||||
props.props.accountDetails.loggedinUserEmail
|
||||
);
|
||||
|
||||
console.log("patching////////");
|
||||
patchCase(incidentId);
|
||||
}, [
|
||||
@@ -135,13 +142,6 @@ let CompleteAppeal = (props) => {
|
||||
<a className="govuk-link">Back to My Portal</a>
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
<a href="#" className="govuk-link">
|
||||
What did you think of this service?
|
||||
</a>
|
||||
(takes 30 seconds)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user