From 9ffbe4977713b1e6c2d51eb7867d852f9a778318 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 14 Jan 2025 10:57:09 +0000 Subject: [PATCH] uat defect 115 --- components/elements/index.js | 6 ++- components/newappeal/buildcheckrow.js | 63 +++++++++++++++------------ 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/components/elements/index.js b/components/elements/index.js index 75e11112..af6f1b6f 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -9,7 +9,7 @@ import React, { useMemo, useState } from "react"; import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import Dropzone from "react-dropzone"; -import { Field, FieldArray } from "redux-form"; +import { Field, FieldArray, change } from "redux-form"; import { deleteBlob, getFilesFromBlobHashed, @@ -2364,6 +2364,8 @@ export const FieldArrayForm = (props) => { maxSubField, } = props; + const dispatch = useDispatch(); // Get dispatch using useDispatch hook + var showIfHasParentShowValue = parentField != false && !_.isEmpty(formProps[form]) && @@ -2375,6 +2377,8 @@ export const FieldArrayForm = (props) => { (showIfHasParentShowValue == parentField) != false && showIfHasParentShowValue; + !showIfHasParentShowValue && dispatch(change("appealForm", name, null)); + parentFieldShowOnValue; const { handleSubmit, pristine, reset, submitting } = props; diff --git a/components/newappeal/buildcheckrow.js b/components/newappeal/buildcheckrow.js index cae9eee4..339da986 100644 --- a/components/newappeal/buildcheckrow.js +++ b/components/newappeal/buildcheckrow.js @@ -302,35 +302,41 @@ let BuildCheckRow = (props) => { "undefined" && props.props.form["appealForm"].values[ datafieldname[0].value - ].map((tenant, index) => { - console.log( - typeof tenant.pinswg_owners - ); - return typeof tenant.pinswg_owners != - "undefined" || - typeof tenant.pinswg_agriculturaltenantname != - "undefined" ? ( -
-
- {tenant.pinswg_agriculturaltenantname || - tenant.pinswg_owners} + ] != null ? ( + props.props.form["appealForm"].values[ + datafieldname[0].value + ].map((tenant, index) => { + console.log( + typeof tenant.pinswg_owners + ); + return typeof tenant.pinswg_owners != + "undefined" || + typeof tenant.pinswg_agriculturaltenantname != + "undefined" ? ( +
+
+ {tenant.pinswg_agriculturaltenantname || + tenant.pinswg_owners} +
+
+ Served:{" "} + {formatDate( + tenant.dateserved + )} +
-
- Served:{" "} - {formatDate( - tenant.dateserved - )} -
-
- ) : ( - "" - ); - }) + ) : ( + "" + ); + }) + ) : ( + "N/A" + ) ) : ( props.props.form["appealForm"].values[ datafieldname[0].value @@ -358,6 +364,7 @@ let BuildCheckRow = (props) => {
); + // } } })}