From 17a1f1f41477913815c4b4a92c6a00d1ab539de2 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 27 Feb 2024 11:39:00 +0000 Subject: [PATCH] 10486 double click on dropdown --- components/newappeal/createCase.js | 707 ++++++++++++++--------------- 1 file changed, 345 insertions(+), 362 deletions(-) diff --git a/components/newappeal/createCase.js b/components/newappeal/createCase.js index d65ba695..75dab272 100644 --- a/components/newappeal/createCase.js +++ b/components/newappeal/createCase.js @@ -17,6 +17,351 @@ import Aboutyou from "./aboutyou"; import { createNewCase, createNewCaseBlob, consoleLogger } from "../../actions"; import { FieldsTranslations } from "../elements"; +const RenderLPAList = ({ + name, + input, + optionsObj, + meta: { touched, error }, + label, + errorMsg, +}) => { + let { t } = useTranslation(); + const router = useRouter(); + + return ( + <> +
+ {" "} + + {touched && error && ( + + Error:{" "} + {errorMsg} + + )} +
+ +
+
+ + ); +}; + +const RenderAppealTypeList = ({ + name, + input, + optionsObj, + meta: { touched, error }, + label, + errorMsg, +}) => { + let { t } = useTranslation(); + const router = useRouter(); + return ( + <> +
+ + {touched && error && ( + + Error:{" "} + {errorMsg} + + )} +
+ +
+
+ + ); +}; + +const RenderRadio = ({ + datafieldname, + name, + label, + id, + errorMsg, + options, + input: { onChange, value }, + meta: { touched, error }, + ...custom +}) => { + let { t } = useTranslation(); + const required = (value) => (value ? undefined : "Required"); + return ( + <> +
+
+ + + + {touched && error && ( + + + Error: + {" "} + {errorMsg} + + )} +
+ {" "} + {custom.hint != undefined && ( +
{custom.hint}
+ )} + {Object.keys(options).map((key, index) => ( +
+ { + let docListObj = custom.documentList; + if ( + custom.requiredDocumentValue == + "Yes" + ) { + e.target.value != "846040000" + ? (docListObj = Object.assign( + docListObj, + { + ["documentCheckList_" + + id]: + custom.requiredDocumentLabel, + } + )) + : delete docListObj[ + "documentCheckList_" + id + ]; + custom.setDocumentsList(docListObj); + } + }} + /> + +
+ ))} +
+
+
+ + ); +}; + +function Radiofield(props) { + const { + name, + label, + datafieldname, + parentField, + form, + formProps, + parentFieldShowOnValue, + validation, + } = props; + + const router = useRouter(); + const required = (value) => (value ? undefined : "Required"); + // console.log(props.options); + + const fieldOptions = props.options + .slice(1, props.options.length - 1) + .split(","); + + //parentFieldShowOnValue + var showIfHasParentShowValue = parentField != false; + //debugger; + // parentField != false && + // !_.isEmpty(formProps[form]) && + // _.has(formProps[form].values, parentField) && + // parentFieldShowOnValue.indexOf( + // formProps[form].values[parentField].toString() + // ) > -1; + + (showIfHasParentShowValue == parentField) != false && + showIfHasParentShowValue; + + // console.log( + // datafieldname, + // showIfHasParentShowValue, + // formProps[form].values[parentField] + // ); + + return ( + <> + {parentField != false ? ( + showIfHasParentShowValue && ( + + ) + ) : ( + + )} + + ); +} + let CreateCase = (props) => { // useEffect(() => { // window.scrollTo(0, 0); @@ -49,368 +394,6 @@ let CreateCase = (props) => { ? [{}] : props.LPAData.LPAData.value; - const RenderLPAList = ({ - name, - input, - optionsObj, - meta: { touched, error }, - label, - errorMsg, - }) => { - return ( - <> -
- {" "} - - {touched && error && ( - - - Error: - {" "} - {errorMsg} - - )} -
- -
-
- - ); - }; - - const RenderAppealTypeList = ({ - name, - input, - optionsObj, - meta: { touched, error }, - label, - errorMsg, - }) => { - return ( - <> -
- - {touched && error && ( - - - Error: - {" "} - {errorMsg} - - )} -
- -
-
- - ); - }; - - const RenderRadio = ({ - datafieldname, - name, - label, - id, - errorMsg, - options, - input: { onChange, value }, - meta: { touched, error }, - ...custom - }) => { - let { t } = useTranslation(); - const required = (value) => (value ? undefined : "Required"); - return ( - <> -
-
- - - - {touched && error && ( - - - Error: - {" "} - {errorMsg} - - )} -
- {" "} - {custom.hint != undefined && ( -
{custom.hint}
- )} - {Object.keys(options).map((key, index) => ( -
- { - let docListObj = - custom.documentList; - if ( - custom.requiredDocumentValue == - "Yes" - ) { - e.target.value != "846040000" - ? (docListObj = - Object.assign( - docListObj, - { - ["documentCheckList_" + - id]: - custom.requiredDocumentLabel, - } - )) - : delete docListObj[ - "documentCheckList_" + - id - ]; - custom.setDocumentsList( - docListObj - ); - } - }} - /> - -
- ))} -
-
-
- - ); - }; - - function Radiofield(props) { - const { - name, - label, - datafieldname, - parentField, - form, - formProps, - parentFieldShowOnValue, - validation, - } = props; - - const router = useRouter(); - const required = (value) => (value ? undefined : "Required"); - // console.log(props.options); - - const fieldOptions = props.options - .slice(1, props.options.length - 1) - .split(","); - - //parentFieldShowOnValue - var showIfHasParentShowValue = parentField != false; - //debugger; - // parentField != false && - // !_.isEmpty(formProps[form]) && - // _.has(formProps[form].values, parentField) && - // parentFieldShowOnValue.indexOf( - // formProps[form].values[parentField].toString() - // ) > -1; - - (showIfHasParentShowValue == parentField) != false && - showIfHasParentShowValue; - - // console.log( - // datafieldname, - // showIfHasParentShowValue, - // formProps[form].values[parentField] - // ); - - return ( - <> - {parentField != false ? ( - showIfHasParentShowValue && ( - - ) - ) : ( - - )} - - ); - } - const required = (value) => (value ? undefined : "Required"); const [formStep, setFormStep] = useState(0);