fixes for rep complete queue

This commit is contained in:
2024-05-02 16:19:46 +01:00
parent 0f3d20ca80
commit 46582d761c
7 changed files with 190 additions and 67 deletions
@@ -21,6 +21,7 @@ const RepComplete = (props) => {
setSubmitBack,
setRepresentationSubmitConfirmation,
setRepresentationMessageSent,
repFormData,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
@@ -46,7 +47,8 @@ const RepComplete = (props) => {
props.props.currentView.representationMessageSent != true &&
(sendRepCompleteMessage(
props.props.props.props.accountDetails.containerID,
props.props.currentView.caseReference.currentReference
props.props.currentView.caseReference.currentReference,
props.repFormData.repfile_name
),
sendEmail(templateId, emailAddress, personalisation, reference),
setRepresentationMessageSent(true));
@@ -37,7 +37,58 @@ const RepCompleteSubmit = (props) => {
const repFormData = formObj.representationForm.values;
console.log("///////// formObj:", formObj);
const repDate = new Date();
let day = repDate.getDate();
let month = repDate.getMonth() + 1;
let year = repDate.getFullYear();
let time = repDate.getTime();
let repType = "";
switch (repFormData.representationCapacity) {
case t("myrepresentations:capacity-options-arr-appellant"):
repType = "APPELLANT";
break;
case t("myrepresentations:capacity-options-arr-agent"):
repType = "AGENT";
break;
case t("myrepresentations:capacity-options-arr-interested"):
repType = "IP";
break;
case "Land Owner":
repType = "LO";
break;
case "lpa":
repType = "LPA";
break;
default:
// code block
}
Object.assign(repFormData, {
"repfile_name": repFormData.hasOwnProperty("repfile_name")
? repFormData.repfile_name
: year +
"-" +
month +
"-" +
day +
"-" +
time +
"-" +
repType +
"-REP" +
"_" +
props.props.props.accountDetails.accountDetails.lastname,
"pinswg_name": props.props.currentView.caseReference.currentReference,
"containerID": props.props.props.accountDetails.containerID,
"appealType": props.props.currentView.caseReference.appealType,
"incidentID": props.props.currentView.caseReference.incidentid,
"caseRef": props.props.currentView.caseReference.currentReference,
});
console.log("///////// repFormData:", repFormData);
const whichQuestionnaireCheck = () => {
{
@@ -72,6 +123,7 @@ const RepCompleteSubmit = (props) => {
<>
{currentView.representationSubmitConfirmation == true ? (
<RepComplete
repFormData={repFormData}
props={props}
setRepresentationMessageSent={setRepresentationMessageSent}
setRepresentationReset={setRepresentationReset}
+79 -57
View File
@@ -103,6 +103,7 @@ let BuildCheckSection = (props) => {
});
const [confirmSections, setConfirmSections] = useState(false);
const [finaliseAppealProcess, setFinaliseAppealProcess] = useState(false);
const FieldsTranslations = (label) => {
const router = useRouter();
@@ -135,6 +136,10 @@ let BuildCheckSection = (props) => {
props.appealType.caseReference.ticketnumber
);
})
.then((data) => {
setFinaliseAppealProcess(true);
return data;
})
.then((data) => {
console.log("have sent comple message :", data);
setCurrentSection(9999);
@@ -221,68 +226,85 @@ let BuildCheckSection = (props) => {
</div>
</dl>
</div>
<div className="govuk-form-group ">
<fieldset className="govuk-fieldset">
<div className="govuk-checkboxes govuk-checkboxes--small">
<div className="govuk-checkboxes__item">
<input
name="pinswg_checkconfirmation"
id="pinswg_checkconfirmation"
type="checkbox"
className="govuk-checkboxes__input"
value=""
onChange={(e) => {
setConfirmSections(!confirmSections);
}}
/>
<label
className="govuk-label govuk-checkboxes__label"
htmlFor="pinswg_checkconfirmation"
>
{finaliseAppealProcess ? (
<div className="">
<h3 className="govuk-heading-m govuk-!-margin-top-9">
Finalising your appeal submission
</h3>
<p className="govuk-body">
Currenly uploading files and finalising your appeal
submission
</p>
<p className="govuk-body textloading">Please wait</p>
</div>
) : (
<>
<div className="govuk-form-group ">
<fieldset className="govuk-fieldset">
<div className="govuk-checkboxes govuk-checkboxes--small">
<div className="govuk-checkboxes__item">
<input
name="pinswg_checkconfirmation"
id="pinswg_checkconfirmation"
type="checkbox"
className="govuk-checkboxes__input"
value=""
onChange={(e) => {
setConfirmSections(
!confirmSections
);
}}
/>
<label
className="govuk-label govuk-checkboxes__label"
htmlFor="pinswg_checkconfirmation"
>
{t(
"newappeal:new-appeal-check-confirm-label"
)}
</label>
</div>
</div>
</fieldset>
<div>
<p className="govuk-body">
{t(
"newappeal:new-appeal-check-confirm-label"
"newappeal:new-appeal-check-confirm-paragraph-one"
)}
</label>
</p>
</div>
<div>
<p className="govuk-body">
{t(
"newappeal:new-appeal-check-confirm-paragraph-two"
)}{" "}
<Link
href={t(
"newappeal:new-appeal-check-confirm-paragraph-two-link"
)}
>
{t(
"newappeal:new-appeal-check-confirm-paragraph-two-link"
)}
</Link>
</p>
</div>
</div>
</fieldset>
<div>
<p className="govuk-body">
{t(
"newappeal:new-appeal-check-confirm-paragraph-one"
)}
</p>
</div>
<div>
<p className="govuk-body">
{t(
"newappeal:new-appeal-check-confirm-paragraph-two"
)}{" "}
<Link
href={t(
"newappeal:new-appeal-check-confirm-paragraph-two-link"
)}
<div className="govuk-button-group">
<a
disabled={confirmSections ? false : true}
className="govuk-button"
data-module="govuk-button"
onClick={() => {
finaliseAppeal();
}}
>
{t(
"newappeal:new-appeal-check-confirm-paragraph-two-link"
)}
</Link>
</p>
</div>
</div>
<div className="govuk-button-group">
<a
disabled={confirmSections ? false : true}
className="govuk-button"
data-module="govuk-button"
onClick={() => {
finaliseAppeal();
}}
>
{t("newappeal:submit-appeal-button")}
</a>
</div>
{t("newappeal:submit-appeal-button")}
</a>
</div>
</>
)}
</div>
</div>
);