Skip to content
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

Introduce new "beforeRegister" field lifecycle method #233

Closed
kettanaito opened this issue Apr 2, 2018 · 1 comment
Closed

Introduce new "beforeRegister" field lifecycle method #233

kettanaito opened this issue Apr 2, 2018 · 1 comment
Assignees
Labels
enhancement Enhances existing functionality. scope:architecture Changes affect architecture.
Projects
Milestone

Comments

@kettanaito
Copy link
Owner

What

Need to introduce a new field lifecycle method which controls the registration behavior of the field. This method is different from mapPropsToField, which controls the field record which goes to the registration. The suggested method actually controls whether the registration is needed.

Why

Currently Form.registerField() contains a radio field specific logic, which looks and is a hack. Instead, a new lifecycle method must control that behavior, while registerField() ensures that lifecycle method is called and reacts to it correspondingly.

Also, this allows to control the registration of the fields for custom fields.

How

  1. Introduce a new field lifecycle method.
  2. Extend fieldPresets.radio, adding the logic which is currently in Form.registerField() (for radio fields de-duplication when the radio field with the same name and present value is set)
  3. Ensure tests are passing.
@kettanaito kettanaito added enhancement Enhances existing functionality. scope:architecture Changes affect architecture. labels Apr 2, 2018
@kettanaito kettanaito added this to the 1.x.x milestone Apr 2, 2018
@kettanaito kettanaito self-assigned this Apr 2, 2018
@kettanaito kettanaito added this to Ready for release in Roadmap Apr 2, 2018
@kettanaito
Copy link
Owner Author

Merged.

Ready to be release under the next minor version of the library.

Roadmap automation moved this from Ready for release to Released Apr 2, 2018
@kettanaito kettanaito moved this from Released to Ready for release in Roadmap Apr 4, 2018
@kettanaito kettanaito moved this from Staging to Released in Roadmap Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances existing functionality. scope:architecture Changes affect architecture.
Projects
Roadmap
  
Released
Development

No branches or pull requests

1 participant