silverstripe-framework/admin
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
..
client Use redux-form instead of custom actions/reducers (fixes #5524) 2016-10-20 21:49:06 +13:00
code Consistently set 'id' in FormSchema 2016-10-20 15:33:50 +13:00
templates/SilverStripe Adjust CSS for top toolbar split for Pages section 2016-10-18 14:22:03 +13:00
tests FIX: Graceful degradation if obsolete classnames in ChangeSetItem (fixes #6065) 2016-09-23 12:28:32 +12:00
themes API Add bootstrap button row template 2016-09-21 15:59:12 +12:00
thirdparty Remove Layout 2016-10-11 13:45:08 +13:00
_config.php API Moved frontend assets into admin/ "module" 2016-09-16 13:46:06 +12:00
.gitignore MINOR Removing executable flag from all files (thanks miiihi) 2011-09-18 22:04:02 +02:00