mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-24 00:01:36 +01:00
Merge branch 'add-inital-form-data-to-children-of-foris-form' into 'dev'
Add initial form data to children of the ForisForm. See merge request turris/reforis/foris-js!107
This commit is contained in:
commit
27c37eb74b
|
@ -36,7 +36,7 @@ WiFiForm.defaultProps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function WiFiForm({
|
export default function WiFiForm({
|
||||||
formData, formErrors, setFormValue, hasGuestNetwork, ...props
|
formData, formErrors, setFormValue, hasGuestNetwork, disabled,
|
||||||
}) {
|
}) {
|
||||||
return formData.devices.map((device) => (
|
return formData.devices.map((device) => (
|
||||||
<DeviceForm
|
<DeviceForm
|
||||||
|
@ -45,8 +45,7 @@ export default function WiFiForm({
|
||||||
formErrors={(formErrors || [])[device.id]}
|
formErrors={(formErrors || [])[device.id]}
|
||||||
setFormValue={setFormValue}
|
setFormValue={setFormValue}
|
||||||
hasGuestNetwork={hasGuestNetwork}
|
hasGuestNetwork={hasGuestNetwork}
|
||||||
|
disabled={disabled}
|
||||||
{...props}
|
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,6 +149,7 @@ export function ForisForm({
|
||||||
const childrenWithFormProps = React.Children.map(
|
const childrenWithFormProps = React.Children.map(
|
||||||
children,
|
children,
|
||||||
(child) => React.cloneElement(child, {
|
(child) => React.cloneElement(child, {
|
||||||
|
initialData: formState.initialData,
|
||||||
formData: formState.data,
|
formData: formState.data,
|
||||||
formErrors: formState.errors,
|
formErrors: formState.errors,
|
||||||
setFormValue: onFormChangeHandler,
|
setFormValue: onFormChangeHandler,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user