linked watched cases for all personnas

This commit is contained in:
2024-02-02 12:30:18 +00:00
parent c3a4b4bb10
commit 87019693e2
23 changed files with 273 additions and 353 deletions
+17 -2
View File
@@ -75,6 +75,7 @@ let MakeRepresentation = (props) => {
var casesObj = {};
const [showQuestionnaireSection, setShowQuestionnaireSection] = useState(1);
const [questionnaireCount, setQuestionnaireCount] = useState(0);
const isLPA =
props.props.accountDetails.accountDetails[
@@ -107,6 +108,8 @@ let MakeRepresentation = (props) => {
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
: props.props.searchResultsObj.searchDetailsObj
: props.currentType == "watchedCases"
? props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {};
@@ -240,6 +243,8 @@ let MakeRepresentation = (props) => {
setShowQuestionnaireSection
}
showQuestionnaireSection={showQuestionnaireSection}
setQuestionnaireCount={setQuestionnaireCount}
questionnaireCount={questionnaireCount}
/>
);
break;
@@ -347,6 +352,8 @@ let MakeRepresentation = (props) => {
setShowQuestionnaireSection={
setShowQuestionnaireSection
}
setQuestionnaireCount={setQuestionnaireCount}
questionnaireCount={questionnaireCount}
/>
);
break;
@@ -363,6 +370,8 @@ let MakeRepresentation = (props) => {
setShowQuestionnaireSection={
setShowQuestionnaireSection
}
setQuestionnaireCount={setQuestionnaireCount}
questionnaireCount={questionnaireCount}
/>
);
break;
@@ -555,7 +564,7 @@ let MakeRepresentation = (props) => {
: isLPA
? "lpa"
: values.representationCapacity,
"locale": locale,
"locale": router.locale,
}));
currentView.representationSubmit != true
? _.isEmpty(currentView.representationCapacity)
@@ -566,10 +575,14 @@ let MakeRepresentation = (props) => {
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
)
: questionnaireCount != 0 &&
showQuestionnaireSection < questionnaireCount
? setShowQuestionnaireSection(showQuestionnaireSection + 1)
: setRepresentationSubmit(true)
: currentView.representationSubmit == true
? (console.log("capacity", currentView.representationCapacity),
console.log("has errors:", props.invalid),
Object.assign(values, { "locale": router.locale }),
props.invalid == false &&
updateRepresentation(values, false, false),
values.hasOwnProperty("representationDocuments") &&
@@ -579,7 +592,9 @@ let MakeRepresentation = (props) => {
"size": Blob.size,
})
),
Object.assign(values, { "filesList": buildFileArray })),
Object.assign(values, {
"filesList": buildFileArray,
})),
generateRepPDF(
values,
props.props.accountDetails.containerID,
@@ -76,20 +76,7 @@ const RepAgent = (props) => {
)}
</div>
</div>
{/* <div className="govuk-grid-row">
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-three-quarters"
id="representationDescription"
name="representationDescription"
value="email"
data-aria-controls="representationDescription"
type="text"
component={RenderTextfield}
label="Description of representation"
/>
</div>
</div> */}
<div className="govuk-grid-row">
<div className="govuk-form-group">
<Field
@@ -194,14 +181,7 @@ const RepAgent = (props) => {
>
{t("common:continue-button")}{" "}
</button>
{/* <a
onClick={() => {
setRepresentationSubmit(true);
}}
className="govuk-button"
>
{t("common:continue-button")} ww
</a> */}
<a
onClick={() => {
setRepresentationCapacity();
@@ -78,21 +78,6 @@ const RepAppellant = (props) => {
</div>
</div>
{/* <div className="govuk-grid-row">
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-three-quarters"
id="representationDescription"
name="representationDescription"
value="email"
data-aria-controls="representationDescription"
type="text"
component={RenderTextfield}
label="Description of representation"
/>
</div>
</div> */}
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values.representationType !=
"undefined") && (
@@ -199,14 +184,7 @@ const RepAppellant = (props) => {
>
{t("common:continue-button")}
</button>
{/* <a
onClick={() => {
setRepresentationSubmit(true);
}}
className="govuk-button"
>
{t("common:continue-button")} ww
</a> */}
<a
onClick={() => {
setRepresentationCapacity();
@@ -19,7 +19,9 @@ const RepDetails = (props) => {
? router.query.state == "edit"
? props.myRepresentations.myRepresentations
: props.searchResultsObj.searchDetailsObj
: props.searchResultsObj.searchDetailsObj;
: props.currentType == "watchedCases"
? props.props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {};
@@ -53,19 +55,9 @@ const RepDetails = (props) => {
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
]
}
{/* {detailsObj.firstName +
" " +
detailsObj.lastName || "not entered"} */}
</dd>
</div>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-agent-label")}
</dt>
<dd className="govuk-summary-list__value">
Mr A Agent
</dd>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-site-address-label")}
@@ -645,11 +645,6 @@ export const RenderDatePicker = ({
</span>
)}
{/* {value}
<br />
{moment(value).format("DD/MM/YY")}
<br /> */}
<DatePicker
{...custom}
locale={custom.locale}
@@ -1007,10 +1002,6 @@ export const RenderFileUpload = (field) => {
>
{({ getRootProps, getInputProps }) => (
<>
{/* {field.hint != false && (
<div className="govuk-hint">ss{t(field.hint)}</div>
)}
<div className="govuk-form-group"></div> */}
<section className="container">
<div {...getRootProps({ style })}>
{" "}
@@ -151,16 +151,7 @@ const RepInterestedPartyPerson = (props) => {
>
{t("common:continue-button")}
</button>
{/* <Link href="/representation">
<a
onClick={() => {
setRepresentationSubmit(true);
}}
className="govuk-button"
>
{t("common:continue-button")}
</a>
</Link> */}
<a
onClick={() => {
setRepresentationCapacity();
@@ -24,7 +24,7 @@ import { select } from "xpath";
import jsonpath from "jsonpath";
import { useState } from "react";
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
import S78_Qquestionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78";
import S78_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
import transLookup from "../../../data/lookuptranslations.json";
@@ -35,6 +35,8 @@ let RepLPA = (props) => {
const router = useRouter();
const { locale } = router;
const {
onSubmit,
handleSubmit,
formObj,
appellantApplicantRepresentationArr,
setRepresentationCapacity,
@@ -44,6 +46,8 @@ let RepLPA = (props) => {
onBehalfOfLPA,
setShowQuestionnaireSection,
showQuestionnaireSection,
questionnaireCount,
setQuestionnaireCount,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
@@ -53,6 +57,34 @@ let RepLPA = (props) => {
));
const required = (value) => (value ? undefined : "Required");
const updateQuestionnaireCount = () => {
{
switch (currentView.caseReference.appealType) {
case 846040000:
case 846040001:
case 846040006:
case 846040025:
case 846040004:
case 846040018:
case 846040003:
case 846040009:
case 846040008:
setQuestionnaireCount(7);
break;
case 846040005:
case 846040006:
case 846040007:
setQuestionnaireCount(9);
break;
default:
setQuestionnaireCount(7);
break;
}
}
};
const whichQuestionnaire = () => {
{
switch (currentView.caseReference.appealType) {
@@ -65,8 +97,9 @@ let RepLPA = (props) => {
case 846040003:
case 846040009:
case 846040008:
updateQuestionnaireCount();
return (
<S78_Qquestionnaire
<S78_Questionnaire
props={props}
containerID={
props.props.props.accountDetails.containerID
@@ -76,6 +109,7 @@ let RepLPA = (props) => {
setShowQuestionnaireSection={
setShowQuestionnaireSection
}
questionnaireCount={questionnaireCount}
/>
);
break;
@@ -83,6 +117,7 @@ let RepLPA = (props) => {
case 846040005:
case 846040006:
case 846040007:
updateQuestionnaireCount();
return (
<Enforcement_Questionnaire
props={props}
@@ -94,6 +129,7 @@ let RepLPA = (props) => {
setShowQuestionnaireSection={
setShowQuestionnaireSection
}
questionnaireCount={questionnaireCount}
/>
);
break;
@@ -235,7 +271,6 @@ let RepLPA = (props) => {
</div>
)}
</div>
<div className="govuk-grid-row">
<div className="govuk-form-group">
{typeof props.representationType != "undefined" &&
@@ -306,18 +341,26 @@ let RepLPA = (props) => {
{typeof props.representationType != "undefined" &&
props.representationType == "Questionnaire" && (
<>
{showQuestionnaireSection < 7 && (
<a
href="#"
onClick={() => {
setShowQuestionnaireSection(
showQuestionnaireSection + 1
);
}}
{showQuestionnaireSection <=
questionnaireCount && (
<button
// type="submit"
className="govuk-button"
data-module="govuk-button"
>
Next section
</a>
{t("common:continue-button")}ww
</button>
// <a
// href="#"
// onClick={() => {
// setShowQuestionnaireSection(
// showQuestionnaireSection + 1
// );
// }}
// className="govuk-button"
// >
// Next section
// </a>
)}
{showQuestionnaireSection == 9 && (
<button
@@ -352,15 +395,6 @@ let RepLPA = (props) => {
>
{t("common:continue-button")}
</button>
{/* <a
onClick={() => {
setRepresentationSubmit(false);
}}
className="govuk-button"
>
{t("common:continue-button")}
</a> */}
<a
onClick={() => {
//setRepresentationCapacity();
@@ -16,7 +16,9 @@ const RepLPADetails = (props) => {
let setCaseDetailsObj = router.query.hasOwnProperty("state")
? router.query.state == "edit"
? props.props.myRepresentations.myRepresentations
: props.props.searchResultsObj.searchDetailsObj
: props.searchResultsObj.searchDetailsObj
: props.currentType == "watchedCases"
? props.props.props.watchedCases.watchedCasesDetails
: props.props.searchResultsObj.searchDetailsObj;
var detailsObj = {};
@@ -45,14 +47,7 @@ const RepLPADetails = (props) => {
] || "not entered"}
</dd>
</div>
{/* <div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-agent-label")}
</dt>
<dd className="govuk-summary-list__value">
Mr A Agent
</dd>
</div> */}
<div className="govuk-summary-list__row">
<dt className="govuk-summary-list__key">
{t("case:summary-site-address-label")}
@@ -60,20 +60,6 @@ const RepLandOwner = (props) => {
/>
</div>
</div>
{/* <div className="govuk-grid-row">
<div className="govuk-form-group">
<Field
className="govuk-input govuk-!-width-three-quarters"
id="representationDescription"
name="representationDescription"
value="email"
data-aria-controls="representationDescription"
type="text"
component={RenderTextfield}
label="Description of representation"
/>
</div>
</div> */}
<div className="govuk-grid-row">
<div className="govuk-form-group">
@@ -128,16 +114,6 @@ const RepLandOwner = (props) => {
>
{t("common:continue-button")}
</button>
{/* <Link href="/representation">
<a
onClick={() => {
setRepresentationSubmit(true);
}}
className="govuk-button"
>
{t("common:continue-button")}
</a>
</Link> */}
<a
onClick={() => {
setRepresentationCapacity();
@@ -23,10 +23,10 @@ import { select } from "xpath";
import jsonpath from "jsonpath";
import { getFormCollectionByID } from "../../../../components/utils";
let S78_Questionnaire = async (props) => {
//let { t } = useTranslation();
let S78_Questionnaire = (props) => {
let { t } = useTranslation();
let t = await getT(props.reqQuery.__nextLocale, "common");
//let t = await getT(props.reqQuery.__nextLocale, "common");
const router = useRouter();
const { locale } = router;
@@ -89,10 +89,22 @@ let S78_Questionnaire = async (props) => {
console.log(resultsObj);
const onHandleSubmit = (values) => {
//if (currentSection == sectionCount) {
let valuesObj = values || {};
delete valuesObj["_pinswg_appellant_value"];
console.log("has errors:", props.invalid);
props.invalid == false && updateCaseProgress(valuesObj, false, false);
setCurrentSection(currentSection + 1);
};
return (
<>
{props.representationTypeValue}
{props.procedureTypeValue}
{showQuestionnaireSection == 1 && (
<fieldset
className="govuk-fieldset"
@@ -186,6 +198,7 @@ let S78_Questionnaire = async (props) => {
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
validate={[required]}
/>
<div className="govuk-form-group">
@@ -372,6 +385,7 @@ let S78_Questionnaire = async (props) => {
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
validate={[required]}
/>
</fieldset>
)}
@@ -399,6 +413,7 @@ let S78_Questionnaire = async (props) => {
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
validate={[required]}
/>
<div className="govuk-form-group">
@@ -624,6 +639,7 @@ let S78_Questionnaire = async (props) => {
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
validate={[required]}
/>
<div className="govuk-form-group">
@@ -667,6 +683,7 @@ let S78_Questionnaire = async (props) => {
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
validate={[required]}
/>
<Field
label={
@@ -684,6 +701,7 @@ let S78_Questionnaire = async (props) => {
rows="5"
className="govuk-textarea govuk-input--width-30"
aria-describedby={props.name + "-hint"}
validate={[required]}
/>
<div className="govuk-form-group">