-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support static action forms with layout #1182
Conversation
field => | ||
field.type === 'Layout' || // all forms containing some layout elements are handled as dynamic | ||
Object.values(field).some(value => this.isHandler(value)) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recursive check for layout elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. I will wait for the pages to be available I think
describe('with a form with layout elements', () => { | ||
test('should be flagged as dynamic form', () => { | ||
newBooks.addAction('make photocopy', { | ||
scope: 'Single', | ||
execute: (context, resultBuilder) => { | ||
return resultBuilder.error('meeh'); | ||
}, | ||
form: [ | ||
{ label: 'firstname', type: 'String' }, | ||
{ type: 'Layout', component: 'Separator' }, | ||
{ label: 'lastname', type: 'String' }, | ||
], | ||
}); | ||
|
||
expect(newBooks.schema.actions['make photocopy']).toEqual({ | ||
scope: 'Single', | ||
generateFile: false, | ||
staticForm: false, | ||
}); | ||
}); | ||
|
||
test('should compute the form recursively', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep this test with dynamic elements in a row in a page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sry missclick again :/ need recursive check in getForms
Code Climate has analyzed commit 4b3231f and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (98% is the threshold). This pull request will bring the total coverage in the repository to 97.5% (0.0% change). View more on Code Climate. |
## [1.11.2](https://github.com/ForestAdmin/agent-nodejs/compare/example@1.11.1...example@1.11.2) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
# [1.50.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.49.1...@forestadmin/agent@1.50.0) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
🎉 This PR is included in version 1.4.3 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.11.2 🎉 The release is available on Your semantic-release bot 📦🚀 |
## [1.1.35](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-dummy@1.1.34...@forestadmin/datasource-dummy@1.1.35) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
🎉 This PR is included in version 1.50.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
## [1.11.22](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/forest-cloud@1.11.21...@forestadmin/forest-cloud@1.11.22) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
## [1.4.3](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/plugin-aws-s3@1.4.2...@forestadmin/plugin-aws-s3@1.4.3) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
🎉 This PR is included in version 1.55.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
## [1.1.6](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/plugin-export-advanced@1.1.5...@forestadmin/plugin-export-advanced@1.1.6) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
🎉 This PR is included in version 1.1.35 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
## [1.3.3](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/plugin-flattener@1.3.2...@forestadmin/plugin-flattener@1.3.3) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
🎉 This PR is included in version 1.11.22 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.4.3 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.1.6 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.3.3 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
## [1.10.3](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-sequelize@1.10.2...@forestadmin/datasource-sequelize@1.10.3) (2024-10-09) ### Bug Fixes * required fields are not required in schema when they have default values ([#1185](#1185)) ([a5501fc](a5501fc)) * search hook with layout ([#1187](#1187)) ([e75a06e](e75a06e)) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
## [1.14.29](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-sql@1.14.28...@forestadmin/datasource-sql@1.14.29) (2024-10-09) ### Bug Fixes * required fields are not required in schema when they have default values ([#1185](#1185)) ([a5501fc](a5501fc)) * search hook with layout ([#1187](#1187)) ([e75a06e](e75a06e)) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
🎉 This PR is included in version 1.10.3 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.14.29 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
## [1.8.4](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-mongoose@1.8.3...@forestadmin/datasource-mongoose@1.8.4) (2024-10-10) ### Bug Fixes * missing exported type ([#1192](#1192)) ([7e26bd9](7e26bd9)) * **permissions:** properly check permissions when dissociating or deleting related resources ([#1190](#1190)) ([211fd1f](211fd1f)) * required fields are not required in schema when they have default values ([#1185](#1185)) ([a5501fc](a5501fc)) * search hook with layout ([#1187](#1187)) ([e75a06e](e75a06e)) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
## [1.42.1](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-toolkit@1.42.0...@forestadmin/datasource-toolkit@1.42.1) (2024-10-10) ### Bug Fixes * missing exported type ([#1192](#1192)) ([7e26bd9](7e26bd9)) * **permissions:** properly check permissions when dissociating or deleting related resources ([#1190](#1190)) ([211fd1f](211fd1f)) * required fields are not required in schema when they have default values ([#1185](#1185)) ([a5501fc](a5501fc)) * search hook with layout ([#1187](#1187)) ([e75a06e](e75a06e)) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
🎉 This PR is included in version 1.3.24 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
## [1.34.1](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/forestadmin-client@1.34.0...@forestadmin/forestadmin-client@1.34.1) (2024-10-10) ### Bug Fixes * missing exported type ([#1192](#1192)) ([7e26bd9](7e26bd9)) * **permissions:** properly check permissions when dissociating or deleting related resources ([#1190](#1190)) ([211fd1f](211fd1f)) * required fields are not required in schema when they have default values ([#1185](#1185)) ([a5501fc](a5501fc)) * search hook with layout ([#1187](#1187)) ([e75a06e](e75a06e)) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
# [1.55.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-customizer@1.54.1...@forestadmin/datasource-customizer@1.55.0) (2024-10-07) ### Features * support static action forms with layout ([#1182](#1182)) ([92011d8](92011d8))
Definition of Done
#86c097c1w
General
Security