[Freeipa-devel] [PATCH] 142 Moved entity builder registration into webui.js.

Endi Sukma Dewata edewata at redhat.com
Thu Apr 21 02:41:35 UTC 2011


On 4/20/2011 4:32 PM, Endi Sukma Dewata wrote:
> On 4/20/2011 11:50 AM, Adam Young wrote:
>>>> Leave the factories as the top level object. For the factory name, say
>>>> 'entitle' check that the object is in the metadata. If not, don't
>>>> create
>>>> the entity. Then, when processing the tabs, if the entity does not
>>>> exist, drop the tab from the tab set. The explicit enumeration of
>>>> entities in webui.js is not necessary, nor is putting every entity's
>>>> factory into its own namespace.
>>>
>>> I think it would be even better to create only the entities that are
>>> actually needed. So entity creation should be done after we determine
>>> the user and the tab set for that user. What do you think?
>
>> Absolutely. I think that the check should be something like:
>> that.start_entities = function(){
>> ...
>> for (name in that.entity_factories){
>> if (!metadata.objects[name]) continue;
>> ...
>>
>> }
>>
>> and then the tab gets dropped later if the entity doesn't exist.
>
> I don't think this approach will work for DNS. If dns_is_enabled is
> false the entity should not be created either. I'm not sure inserting
> this logic in the IPA.start_entities() would be a good idea. The
> start_entities() should read from a list of entities to be created
> instead of filtering out the entities within the loop.

Attached is a new patch that creates only the entities that are enabled 
and needed by the navigation tabs. It passes jslint, qunit, and 
essential Selenium tests.

This patch can be applied against master or your patch #221.

-- 
Endi S. Dewata
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-edewata-0142-2-Fixed-entity-creation-and-navigation.patch
Type: text/x-patch
Size: 25772 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110420/e8b710ca/attachment.bin>


More information about the Freeipa-devel mailing list