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

Adam Young ayoung at redhat.com
Thu Apr 21 19:00:45 UTC 2011


On 04/20/2011 10:41 PM, Endi Sukma Dewata wrote:
> 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.
>
Officially a NACK,  but I am going to integrate most of these changes 
into an updated verison of my latest patch, as git merging them will  be 
too painful.




More information about the Freeipa-devel mailing list