[scaffolder] Expose formData to fields
See original GitHub issueRight now, the complete formData
isn’t accessible to field implementations.
Feature Suggestion
Expose formData
to fields to allow context dependent behavior. I’ve been thinking about both defaults and validation, but if #6932 is about scaffolder, it could also be used to populate options dynamically.
Possible Implementation
Create a React context for formData
and expose it to fields. Maybe even together with a setFormData
entry point to change status.
Context
I would like to create repository name defaults based on metadata for the created project, and validate some constraints while still being able to adjust the name manually.
Having a setFormData
could allow a field to add computed values, which could be helpful for actions. I’m also seeing a lot of opportunity for shooting yourself in the foot here, though.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
TBH, I’ve tabled this as “not part of the demo”. In the end, if we write a frontend for a scaffolder, it’ll be the same kinda work independent of scaffolder-backend or not. If a mostly-full-page field is engineering-wise and ux-wise a good option would be for another day. Surely an option to look at, though.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.