[Freeipa-devel] [PATCH] 647-651 [webui] Make utility section of navigation extensible

Petr Vobornik pvoborni at redhat.com
Wed Jun 18 11:11:07 UTC 2014


On 12.6.2014 17:25, Endi Sukma Dewata wrote:
> On 5/27/2014 6:15 AM, Petr Vobornik wrote:
>> This is just a first draft of implementation of
>> https://fedorahosted.org/freeipa/ticket/4345
>>
>> It introduces a `freeipa/extend` module which should serve as a more
>> stable API for Web UI plugins. I think it requires further discussion -
>> what to have there, the level of abstraction...
>>
>> Other patches fixes navigation/router to support custom URL path
>> patterns.
>>
>> The usage of facet.create_hash(router) method in patch #649 is
>> questionable.
>>
>> The WIP patch contains an example of a plugin which uses this
>> functionality.
>
> Some comments:
>
> 1. As discussed on IRC, the plugin is causing an error due to missing
> extend.js. This needs to be fixed.

Fixed

>
> 2. Also discussed, a base widget class for StateWidget might help
> providing a structure and simplifying the plugin code by defining the
> default widget behavior (e.g. event registration).

Out of scope of this ticket.

>
> 3. Related to inheritance, instead of conditionally calling a method
> like this:
>
>    if (facet.create_hash) return facet.create_hash(router);
>    // otherwise, do the default behavior
>
> if we use inheritance it could be simplified like this:
>
>    return facet.create_hash(router);
>
> So the method will "do the default behavior" as defined in the base
> class unless it's overridden by the subclass.
>
> 4. I agree that the facet shouldn't define the hash. The hash should be
> part of the plugin declaration.

Ideally, facet should be router agnostic. We need a mechanism of mapping 
facet's state to hash and vice versa.

Originally I did not want to do it now because it requires bigger 
refactoring of a router.

While I was designing it, I ended up with a patch - attached.

It's a replacement for original patch #649. Patch #651 and example 
plugin are updated accordingly.

Basically I refactored router's `navigate_to_*`, `_create_*_hash` and 
`*_route_handler` methods into separate classes which are registered and 
mapped to facets. All in navigation.routing module.

Btw, can you think of some better name(s)/placement for the module?

>
> 5. Also discussed about moving away from declarative entity/facet
> definitions into template-based framework. It could help reduce the code
> complexity.
>

Out of scope of this ticket.
-- 
Petr Vobornik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wip-freeipa-pvoborni-0718-API-browser-plugin.patch
Type: text/x-patch
Size: 14361 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140618/eed84a6c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0651-1-webui-plugin-API.patch
Type: text/x-patch
Size: 3913 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140618/eed84a6c/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0650-1-webui-add-parent-link-to-widgets-in-ContainerMixin.patch
Type: text/x-patch
Size: 1860 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140618/eed84a6c/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0649-1-webui-generic-routing.patch
Type: text/x-patch
Size: 30274 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140618/eed84a6c/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0648-1-webui-support-standalone-facets-in-navigation-module.patch
Type: text/x-patch
Size: 2206 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140618/eed84a6c/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0647-1-webui-fix-excessive-registration-of-state-change-eve.patch
Type: text/x-patch
Size: 1196 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140618/eed84a6c/attachment-0005.bin>


More information about the Freeipa-devel mailing list