- added login page;
- added file upload; - added faq item edit modal;
This commit is contained in:
@@ -18,7 +18,8 @@ const FormFieldRepeaterCriteria = ({
|
||||
errors,
|
||||
register,
|
||||
label,
|
||||
infoText
|
||||
infoText,
|
||||
config = {}
|
||||
}) => {
|
||||
const forMenu = useRef(null);
|
||||
const [stateFieldData, setStateFieldData] = useState([]);
|
||||
@@ -72,6 +73,7 @@ const FormFieldRepeaterCriteria = ({
|
||||
|
||||
const onThresholdChange = (value) => {
|
||||
setThreshold(value);
|
||||
setDataFn('threshold', value, { shouldValidate: true });
|
||||
}
|
||||
|
||||
const properField = (item, i) => {
|
||||
@@ -92,16 +94,19 @@ const FormFieldRepeaterCriteria = ({
|
||||
const newData = storeFieldData.map(o => ({ ...o, status: o.id ? 'existing' : 'new' }))
|
||||
setStateFieldData(newData);
|
||||
setThreshold(data['threshold'])
|
||||
register(fieldName)
|
||||
register(fieldName, config)
|
||||
register('threshold', {
|
||||
required: __('È obbligatorio', 'gepafin')
|
||||
})
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
setDataFn(fieldName, [...stateFieldData]);
|
||||
setDataFn(fieldName, [...stateFieldData], { shouldValidate: true });
|
||||
}, [stateFieldData])
|
||||
|
||||
return (
|
||||
<div className={classNames(['appForm__field', 'formfieldrepeater'])}>
|
||||
<label htmlFor={fieldName} className={classNames({ 'p-error': errors[fieldName] })}>
|
||||
<label htmlFor={fieldName} className={classNames({ 'p-error': errors[fieldName] || errors['threshold'] })}>
|
||||
{label}
|
||||
</label>
|
||||
<div className="appForm__oneCol">
|
||||
|
||||
Reference in New Issue
Block a user