questionnaire for callins and uploads

This commit is contained in:
2024-12-03 18:27:51 +00:00
parent c7e13f84e7
commit 49d39e052e
14 changed files with 220 additions and 160 deletions
+18 -8
View File
@@ -34,7 +34,6 @@ let MakeRepresentation = (props) => {
const [clearRepForm, setClearRepForm] = useState(false);
const [savingStatus, setSavingStatus] = useState(false);
const [showQuestionnaireSection, setShowQuestionnaireSection] = useState(1);
//const [questionnaireCount, setQuestionnaireCount] = useState(0);
const { data: session } = useSession();
@@ -57,6 +56,8 @@ let MakeRepresentation = (props) => {
handleSubmit,
setRepresentationSubmitConfirmation,
setRepresentationMessageSent,
setShowQuestionnaireSection,
showQuestionnaireSection,
initialValues,
} = props;
const formObj = props.props.form;
@@ -194,6 +195,8 @@ let MakeRepresentation = (props) => {
? true
: false;
isLPA && setRepresentationCapacity("lpa");
currentType == "searchResultsObj"
? (casesObj = jsonpath(
'$..[?(@.title=="' + caseReference + '")]',
@@ -374,7 +377,15 @@ let MakeRepresentation = (props) => {
};
const whichControl = () => {
if (isLPA && _.isEmpty(currentView.representationCapacity)) {
if (
isLPA &&
_.isEmpty(
currentView.representationCapacity ||
(currentView.caseReference.hasOwnProperty("repDetails") &&
currentView.caseReference.repDetails
.representationCapacity)
)
) {
return (
//setRepresentationCapacity("lpa"),
<RepLPACapacitySelection
@@ -396,7 +407,10 @@ let MakeRepresentation = (props) => {
/>
);
} else {
switch (currentView.representationCapacity) {
switch (
currentView.representationCapacity ||
currentView.caseReference.repDetails.representationCapacity
) {
case false:
<RepCapacitySelection
formObj={formObj}
@@ -955,11 +969,7 @@ let MakeRepresentation = (props) => {
if (currentView.representationSubmit != true) {
if (_.isEmpty(currentView.representationCapacity)) {
if (isLPA) {
setRepresentationCapacity(
values.representationCapacity
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
);
setRepresentationCapacity("lpa");
} else {
setRepresentationCapacity(
values.representationCapacity