[Freeipa-devel] [PATCH] 565-568 webui: field and widget binding refactoring

Petr Vobornik pvoborni at redhat.com
Thu Mar 27 15:07:55 UTC 2014


The last refactoring I did while implementing RCUE login or more 
precisely support for standalone facets which have forms but are not 
details facets.

[PATCH] webui: field and widget binding refactoring

This is a Web UI wide change. Fields and Widgets binding was refactored
to enable proper two-way binding between them. This should allow to have
one source of truth (field) for multiple consumers - widgets or something
else. One of the goal is to have fields and widget implementations
independent on each other. So that one could use a widget without field
or use one field for multiple widgets, etc..

Basically a fields logic was split into separate components:
- adapters
- parsers & formatters
- binder

Adapters
- extract data from data source (FreeIPA RPC command result)
- prepares them for commands.

Parsers
- parse extracted data to format expected by field
- parse widget value to format expected by field

Formatters
- format field value to format suitable for widgets
- format field value to format suitable for adapter

Binder
- is a communication bridge between field and widget
- listens to field's and widget's events and call appropriate methods

Some side benefits:
- better validation reporting in multivalued widget

[PATCH] webui: replace widget's hidden property with visible

Hidden was used only in ACI. There is no reason to have two properties
which are negations of each other.

[PATCH] webui: change widget updated event into value change event

This change allow us to use proper two way binding between a field and
a widget. In previous implementation field was not changed if something
changed the value of a widget in 'update'. Now listeners are notified
when the widget value is changed by: calling 'update', 'set_value'
or by user change.

[PATCH] webui-tests: binding test suite

Add basic tests for two-way binding between a field and two widgets

-- 
Petr Vobornik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0565-webui-field-and-widget-binding-refactoring.patch
Type: text/x-patch
Size: 124248 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140327/f9012bdf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0566-webui-replace-widget-s-hidden-property-with-visible.patch
Type: text/x-patch
Size: 6276 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140327/f9012bdf/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0567-webui-change-widget-updated-event-into-value-change-.patch
Type: text/x-patch
Size: 13075 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140327/f9012bdf/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0568-webui-tests-binding-test-suite.patch
Type: text/x-patch
Size: 7081 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140327/f9012bdf/attachment-0003.bin>


More information about the Freeipa-devel mailing list