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

Petr Vobornik pvoborni at redhat.com
Thu Apr 3 10:42:08 UTC 2014


On 2.4.2014 17:57, Misnyovszki Adam wrote:
> 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
>
Pushed to master:
* 0d05a50e19b71cade636d9ca4882e453f614a78c webui: field and widget 
binding refactoring
* aadde0f849bc7f129ef5bfdd96391ebeee273829 webui: replace widget's 
hidden property with visible
* df18a3bc040299dae2dc573667ec7ee2db45a8e5 webui: change widget updated 
event into value change event
* 480eba26a14cc616c4c336a6db69fb8ba66a0a60 webui-tests: binding test suite

-- 
Petr Vobornik




More information about the Freeipa-devel mailing list