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

Endi Sukma Dewata edewata at redhat.com
Thu Jun 12 15:25:13 UTC 2014


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.

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).

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.

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

-- 
Endi S. Dewata




More information about the Freeipa-devel mailing list