[Freeipa-devel] [PATCH] 565-568 webui: field and widget binding refactoring
Misnyovszki Adam
amisnyov at redhat.com
Wed Apr 2 15:57:07 UTC 2014
On Thu, 27 Mar 2014 16:07:55 +0100
Petr Vobornik <pvoborni at redhat.com> wrote:
> 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
>
Integration tests and unit tests ran as expected, looking through the
code, and manually testing it confirmed that, so
ACK
Greets
Adam
More information about the Freeipa-devel
mailing list