feat(plugin-form-builder)!: update form builder plugin field overrides to use a function instead (#6497)
## Description
Changes the `fields` override for form builder plugin to use a function
instead so that we can actually override existing fields which currently
will not work.
```ts
//before
fields: [
{
name: 'custom',
type: 'text',
}
]
// current
fields: ({ defaultFields }) => {
return [
...defaultFields,
{
name: 'custom',
type: 'text',
},
]
}
```
## Type of change
- [x] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
This commit is contained in:
@@ -73,12 +73,26 @@ export default buildConfigWithDefaults({
|
||||
// singular: 'Contact Form',
|
||||
// plural: 'Contact Forms'
|
||||
// },
|
||||
fields: [
|
||||
{
|
||||
name: 'custom',
|
||||
type: 'text',
|
||||
},
|
||||
],
|
||||
fields: ({ defaultFields }) => {
|
||||
return [
|
||||
...defaultFields,
|
||||
{
|
||||
name: 'custom',
|
||||
type: 'text',
|
||||
},
|
||||
]
|
||||
},
|
||||
},
|
||||
formSubmissionOverrides: {
|
||||
fields: ({ defaultFields }) => {
|
||||
return [
|
||||
...defaultFields,
|
||||
{
|
||||
name: 'custom',
|
||||
type: 'text',
|
||||
},
|
||||
]
|
||||
},
|
||||
},
|
||||
redirectRelationships: ['pages'],
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user