Commit Graph

9 Commits

Author SHA1 Message Date
Damian Mooyman
6e589aac75
API Updates to Form, ValidationResponse, ValidationException
API Implement form schema "errors" handling
2016-12-09 14:24:11 +13:00
Christopher Joe
c405b4e41a remove required for actions 2016-12-06 14:27:27 +13:00
Christopher Joe
875811fdfd API Create loading state for schema
API Create stateOverride state for schema
Enhancement Moved crumbs property to rely on redux state
Enhancement Updated file app icon names
API Added InsertMediaModal functionality to HtmlEditorField
API Removed dependency on schema ID that is returned from server
API Added afterMessages property for FormBuilder to display content after the alert message
2016-11-22 16:58:00 +13:00
Damian Mooyman
3449d5df0f
BUG Fix broken promise handling 2016-11-03 11:45:54 +13:00
Damian Mooyman
67f00302f9 Add logic to React FormBuilder to utilise validation schema generated 2016-11-03 10:24:36 +13:00
Christopher Joe
e592c5b45e Remove back button if no callback was given
Fix FormBuilderLoader not chaining promise
2016-10-31 13:11:57 +13:00
Chris Joe
82119888c1 Validation on server side for React forms (fixes #6205) 2016-10-28 16:13:29 +13:00
Ingo Schommer
3a690d8084 Moved promise polyfill into boot logic
It's not specific to one single component
2016-10-20 22:03:42 +13:00
Ingo Schommer
5b31a40593 Use redux-form instead of custom actions/reducers (fixes #5524)
- Removed custom form reducers in favour of redux-form (updateField(), addForm(), etc)
- Storing 'state' in schema reducer to avoid a separate forms reducer tree (no longer needed for other use cases). This means 'state' is only the "initial state", any form edits will be handled by redux-form internally in the 'reduxForm' reducer namespace
- Removed componentWillUnmount() from <Form> since there's no more reducer state to clean up (removed formReducer.js), and redux-form handles that internally
- Removed isFetching state from <FormBuilder> since there's now a props.submitting coming from redux-form
- Improved passing of "clicked button" (submittingAction), using component state rather than reducer and passing it into action handlers (no need for components to inspect it any other way)
- Hacky duplication of this.submittingAction and this.state.submittingAction to avoid re-render of <FormBuilder> *during* a submission (see https://github.com/erikras/redux-form/issues/1944)
- Inlined handleSubmit() XHR (rather than using a redux action). There's other ways for form consumers to listen to form evens (e.g. onSubmitSuccess passed through <FormBuilder> into reduxForm()).
- Adapting checkbox/radio fields to redux-forms
  Need to send onChange event with values rather than the original event,
  see http://redux-form.com/6.1.1/docs/api/Field.md/#-input-onchange-eventorvalue-function-
- Using reduxForm() within render() causes DOM to get thrown away,
  and has weird side effects like https://github.com/erikras/redux-form/issues/1944.
  See https://github.com/erikras/redux-form/issues/603#issuecomment-176397728
- Refactored <FormBuilderLoader> as a separate container component which connects to redux and redux-form. This keeps the <FormBuilder> component dependency free and easy to test. It'll also be an advantage if we switch to a GraphQL backed component, in which case the async loading routines will look very different from the current <FormBuilderLoader> implementation
- Refactoring out the redux-form dependency from FormBuilder to make it more testable (through baseFormComponent and baseFieldComponent)
- Passing through 'form' to allow custom identifiers (which is important because currently the schema "id" contains the record identifier, making the form identifier non-deterministic - which means you can't use it with the redux-form selector API)
2016-10-20 21:49:06 +13:00