[Scaffolder] Get data of other fields in Form from a custom field

Allows to use e.g.
```
const CustomFieldExtensionComponent(props: FieldExtensionComponentProps<string[]>) => {
     const { formContext } = props;
     ....
};

const CustomFieldExtension = scaffolderPlugin.provide(
  createScaffolderFieldExtension({
    name: ...,
    component: CustomFieldExtensionComponent,
    validation: ....
  })
);
```

Signed-off-by: Minh Trí <tritri251214@gmail.com>
This commit is contained in:
Minh Trí
2022-05-17 14:52:00 +07:00
committed by Minh Tri
parent c1f303cc90
commit 86a4a0f72d
3 changed files with 39 additions and 0 deletions
@@ -161,3 +161,20 @@ spec:
description: My custom name for the component
ui:field: MyCustomExtension
```
## Get data of other fields in Form from a Custom Field Extension
```tsx
const CustomFieldExtensionComponent(props: FieldExtensionComponentProps<string[]>) => {
const { formContext } = props;
...
};
const CustomFieldExtension = scaffolderPlugin.provide(
createScaffolderFieldExtension({
name: ...,
component: CustomFieldExtensionComponent,
validation: ...
})
);
```