-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use components for complex UI elements #94
Comments
This is linked to comments on this PR - UKHomeOffice-attic/hof-controllers#39 (comment) |
Can you expend on why the tricky part will be naming?
|
Can you clarify what you mean by "mixin", a template mixin or programmaitcally mixing two more object together?
|
if we have a mixin which overrides the |
mixin - mixing in the prototypal methods of a class into the controller |
I thought perhaps you meant a template mixin with extra functionality, which might be a third option? |
it will have a template mixin, this will be the rendering part. The controller will deal with processing the data |
For more complicated mixins, eg input-date, we should provide a fully packaged component, containing a view partial, rendering logic, process logic and tests. From speaking at length with @JoeChapman the tricky part will be where the processing logic will sit. One option could be to use a mixin, where the additional functionality will be mixed in to the base controller, the downside of this would be naming - last mixin methods would overwrite and conflicting previous mixins methods, and each mixin would also need to have access to the parent class to call any overwritten super methods.
Another solution would be to hook into POST requests before the controller POST process/save cycle is called, and manipulate the data that is represented by the 'field' - this would be more of a middleware approach I guess and seems cleaner than the mixin approach IMO.
Open to any other suggestions @JoeChapman @easternbloc @daniel-ac-martin
The text was updated successfully, but these errors were encountered: