-
Notifications
You must be signed in to change notification settings - Fork 3
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
Setup deployment forms (+ define some generic form patterns) #158
Conversation
ui/src/pages/deployment-details/deployment-details-form/section-location.tsx
Outdated
Show resolved
Hide resolved
✅ Deploy Preview for ami-web ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for ami-storybook ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
One thing to note, there will be some backend validation needed at each step as well (is deployment name unique? for example). So there needs to be an initial POST request somewhere, then multiple PUT requests as you fill out the steps. Perhaps the Next button is also a "safe draft" feature. Or you make a PUT request to up the draft each time a field loses focus. |
This PR includes:
FormController
: Helper component to simplify and streamline error handling in formsFormField
: Helper component to simplify and streamline form field logicFormContext
: Context for handling multistep formsFormStepper
: UI component for multistep formsComments
Most tricky part here was the multistep form and making it work nicely with the validation. Also to prepare for field details, such as validation rules, to be specified by the server (this was a requirement).
When it comes to validation, the logic we decided upon is as follow:
Screenshots