From 9d90b7f0a8f30c555e1b5d67dae03a4d43fdb4c0 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 7 Jun 2022 14:36:47 +0100 Subject: [PATCH] check form updates --- components/elements/index.js | 87 ++++++----- components/myportal/topthree.js | 25 +++- components/newappeal/aboutyou.js | 85 +++++++++-- components/newappeal/buildCheckfield.js | 3 + components/newappeal/buildcheckrow.js | 136 +++++++++++------- components/newappeal/buildchecksection.js | 6 +- components/newappeal/buildfield.js | 10 +- components/newappeal/buildprogress.js | 6 +- components/newappeal/buildsection.js | 10 +- components/newappeal/complete.js | 2 - components/newappeal/fileupload.js | 2 +- components/utils/index.js | 13 ++ data/crmfieldlookuptranslations.json | 12 ++ data/formsxml/planningappeals78.xml | 8 +- data/picklistLookups.json | 48 +++++++ locales/cy/common.json | 3 + locales/cy/newappeal.json | 3 +- locales/en/common.json | 3 + locales/en/newappeal.json | 3 +- .../api/endpoint/getawaitingsubmission_api.js | 3 +- .../getawaitingsubmissionproxy_api.js | 2 +- pages/newappeal/index.js | 19 ++- 22 files changed, 356 insertions(+), 133 deletions(-) diff --git a/components/elements/index.js b/components/elements/index.js index 476da1a4..42ef4ed4 100644 --- a/components/elements/index.js +++ b/components/elements/index.js @@ -81,7 +81,7 @@ export function Textfield(props) { <>
- + {/* */} {touched && error && ( Error:{" "} @@ -177,9 +177,11 @@ const RenderMultiline = ({ )}
@@ -190,21 +192,26 @@ export function MultiLinefield(props) { const { name, label, - parentField, form, formProps, + parentField, parentFieldShowOnValue, validation, } = props; const required = (value) => (value ? undefined : "Is required"); var showIfHasParentShowValue = - (parentField != false && - !_.isEmpty(formProps[form]) && - _.has(formProps[form].values, parentField) && - formProps[form].values[parentField]) == parentFieldShowOnValue; + parentField != false && + !_.isEmpty(formProps[form]) && + _.has(formProps[form].values, parentField) && + parentFieldShowOnValue.indexOf( + formProps[form].values[parentField].toString() + ) > -1; - // console.log(parentField, showIfHasParentShowValue); + (showIfHasParentShowValue == parentField) != false && + showIfHasParentShowValue; + + //console.log(showIfHasParentShowValue, formProps[form].values[parentField]); return ( <> @@ -324,12 +331,13 @@ const RenderDatePicker = ({
@@ -355,6 +363,7 @@ const RenderDatePicker = ({ {...custom} locale={router.locale} autoOk={true} + id={id} dateFormat="dd/MM/yyyy" onChange={onChange} selected={ @@ -527,7 +536,7 @@ const RenderYesNo = ({ >