On 03/31/2011 03:27 PM, Adam Young wrote:
On 03/31/2011 03:12 PM, Adam Young wrote:
On 03/31/2011 02:09 PM, Adam Young wrote:
On 03/31/2011 12:51 PM, Endi Sukma Dewata wrote:
On 3/31/2011 8:43 AM, Adam Young wrote:
rebased both patches

I don't see any code change in the rebased patches, only new commit ID's, I hope this is correct.

Some comments (some of which had been discussed over IRC):

1. I ran my Selenium test cases against 215, 216, and 217 together,
   so far there's no failure.
Good to know.


2. There's a IPA.metadata assignment and the like in unit tests, this
   is redundant.

yeah, I suspect it was from before I explicitly set async.  removed.


3. In IPA.entity_builder.section(), the current_section should be added
   to the current_facet before adding the fields to do incremental
   construction.
Done.


4. In IPA.entity_builder the entity_name can be replaced with
   entity.name to reduce the number of variables.

Done

5. In IPA.entity_builder the standard_associations() can be replaced
   standard_association_facets() for consistency.
Done

6. In the permission entity definition, the 'add_fields' is used
   inconsistently to add a section (i.e. IPA.target_section). The
   solution is either adding 'add_sections' or converting
   IPA.target_sections into widgets. I think adding 'add_sections' is
simpler because widgets is designed to represent a single attribute.

Gonna punt on this for this patch. Not certain on the correct approach, either to make adders have sections, or to convert the one custom section we have to a widget. Either way, beyond the scope of this patch, and it will only affect one entity and the builder when we decide.


7. The IPA.entity_builder.details_facet() takes an array of sections
   instead of a spec object. This limits the expandability of the
   builder interface. It should take a spec object with a 'sections'
attribute containing the array of sections, this would be consistent
   with the other interfaces.

I thought about it, but there is nothing that we want to customize in the details_facet. We can always do a custom facet to customize. An alternative is to check the type of that is passed in to the details_section method on the builder, check if it is an object or an array, and treat it like a spec or array depending.


8. In IPA.entity_builder.search_facet(), there's no need to call
   current_facet.init() because all facets will be initialized by
   the entity when IPA.start_entities() is invoked.

Done.


9. The IPA.entity_builder could be a singleton because it doesn't take
   any parameters and there's no multi-threading issue.
Going to leave it like this for now. That change would be limited to a single file (entity.js) and can be done if we decide we want to with a very small patch.



10. In IPA.details_refresh() it calls IPA.refresh_devel_hook()
    to execute a code specifically used by testing. I think ideally
the develop.js should modify the entity_builder instance to generate
    details facet with test-specific code. This requires item #9. But
    for now at least we should rename IPA.refresh_devel_hook() into
    IPA.details_refresh_devel_hook() for clarity.

Good idea.  Done


I had already submitted patch freeipa-admiyo-0218-default-all-false. Some of the fixes here would conflict with that patch if rebased. What I've attached is on top of 217-2 and 218-1.



_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
Including Automount


_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
Hadn't merged in the changes.  Updated patch attached.


_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
This version uses a spec for the details facet, IAW code review feedback
From 4dc5d8a71dee4870f6efd6513cfd8e274ebfda4d Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Thu, 31 Mar 2011 15:32:29 -0400
Subject: [PATCH] code review fixes

this version includes using spec for detail_facets
---
 install/ui/aci.js                |   49 +++++++++++++++++++------------------
 install/ui/automount.js          |    8 +++---
 install/ui/details.js            |    4 +-
 install/ui/develop.js            |    2 +-
 install/ui/dns.js                |    8 +++---
 install/ui/entity.js             |   47 ++++++++++++++---------------------
 install/ui/group.js              |    8 +++---
 install/ui/hbac.js               |   12 ++++----
 install/ui/host.js               |   10 ++++----
 install/ui/hostgroup.js          |    8 +++---
 install/ui/netgroup.js           |    8 +++---
 install/ui/policy.js             |   24 ++++++++++--------
 install/ui/serverconfig.js       |    8 ++++--
 install/ui/service.js            |   11 ++++----
 install/ui/sudo.js               |   14 +++++-----
 install/ui/test/details_tests.js |   13 +++-------
 install/ui/test/entity_tests.js  |    5 ----
 install/ui/user.js               |   18 +++++++-------
 18 files changed, 122 insertions(+), 135 deletions(-)

diff --git a/install/ui/aci.js b/install/ui/aci.js
index d51741245f4305a1bdc87acb5fc639b30a5fd23e..e7e0c563de2b4be9dc3d0769c5e52aa8f4aefafb 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -38,13 +38,13 @@ IPA.entity_factories.permission = function() {
                 },
                 {
                     factory: IPA.target_section,
-                    section: 'target',
+                    name: 'target',
                     label: IPA.messages.objects.permission.target,
                     undo: false
                 }]}).
-        details_facet([
+        details_facet({sections:[
             {
-                section:'identity',
+                name:'identity',
                 fields: [{
                     factory: IPA.text_widget,
                     name: 'cn',
@@ -52,15 +52,15 @@ IPA.entity_factories.permission = function() {
                 }]
             },
             {
-                section:'rights',
+                name:'rights',
                 factory:IPA.rights_section
             },
             {
-                section:'target',
+                name:'target',
                 factory:IPA.target_section,
                 label: IPA.messages.objects.permission.target
-            }]).
-        standard_associations().
+            }]}).
+        standard_association_facets().
         build();
 };
 
@@ -71,12 +71,13 @@ IPA.entity_factories.privilege = function() {
         search_facet({
             columns:['cn','description'],
             add_fields:['cn', 'description']}).
-        details_facet([
-            {
-                section:'identity',
+        details_facet({
+            sections:
+            [{
+                name:'identity',
                 label: IPA.messages.details.identity,
                 fields:['cn','description']
-            }]).
+            }]}).
         association_facet({
             name: 'member_role',
             add_method: 'add_privilege',
@@ -88,7 +89,7 @@ IPA.entity_factories.privilege = function() {
                 add_method: 'add_permission',
                 remove_method: 'remove_permission'
         }).
-        standard_associations().
+        standard_association_facets().
         build();
 
 };
@@ -100,17 +101,17 @@ IPA.entity_factories.role = function() {
         search_facet({
             columns:['cn','description'],
             add_fields:['cn', 'description']}).
-        details_facet([
+        details_facet({sections:[
             {
-                section:'identity',
+                name:'identity',
                 label:IPA.messages.objects.role.identity,
-                fields:['cn','description']}]).
+                fields:['cn','description']}]}).
         association_facet({
                 name: 'memberof_privilege',
                 add_method: 'add_privilege',
                 remove_method: 'remove_privilege'
         }).
-        standard_associations().
+        standard_association_facets().
         build();
 };
 
@@ -127,9 +128,9 @@ IPA.entity_factories.selfservice = function() {
                  name:'attrs',
                  undo: false
                 }]}).
-        details_facet([
-            {
-                section:'general',
+        details_facet({
+            sections:[{
+                name:'general',
                 label: IPA.messages.details.general,
                 fields: [
                     'aciname',
@@ -137,7 +138,7 @@ IPA.entity_factories.selfservice = function() {
                         factory:IPA.attributes_widget,
                         object_type:'user',
                         name:'attrs'
-                    }]}]).
+                    }]}]}).
         build();
 };
 
@@ -163,9 +164,9 @@ IPA.entity_factories.delegation = function() {
                     name: 'attrs', object_type: 'user',
                     join: true, undo: false
                 }]}).
-        details_facet([
+        details_facet({sections:[
             {
-                section:'general',
+                name:'general',
                 label: IPA.messages.details.general,
                 fields:[
                     'aciname',
@@ -182,8 +183,8 @@ IPA.entity_factories.delegation = function() {
                         factory:IPA.attributes_widget,
                         name: 'attrs', object_type: 'user',
                         join: true
-                    }]}]).
-        standard_associations().
+                    }]}]}).
+        standard_association_facets().
         build();
 };
 
diff --git a/install/ui/automount.js b/install/ui/automount.js
index a0da4c8c1ab3da7b7f6258cebf32234b51c88ee3..7cbe4fe0e0922e8436457cc6d3ec58a256ea2da7 100644
--- a/install/ui/automount.js
+++ b/install/ui/automount.js
@@ -33,12 +33,12 @@ IPA.entity_factories.automountlocation = function() {
             columns:['cn'],
             add_fields:['cn']
         }).
-        details_facet([{
-            section:'identity',
+        details_facet({sections:[{
+            name:'identity',
             label: IPA.messages.objects.automountlocation.identity,
             fields:['cn']
-        }]).
-        standard_associations().
+        }]}).
+        standard_association_facets().
         build();
 };
 
diff --git a/install/ui/details.js b/install/ui/details.js
index 1dccb830e240fd7adda2ebc5dd216da4deba617b..40dd6d4f8389531c7caeec98a8d613fb63eb9506 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -579,8 +579,8 @@ IPA.details_refresh = function() {
         options: { 'all': true, 'rights': true }
     });
     
-    if (IPA.refresh_devel_hook){
-        IPA.refresh_devel_hook(that.entity_name,command,that.pkey);
+    if (IPA.details_refresh_devel_hook){
+        IPA.details_refresh_devel_hook(that.entity_name,command,that.pkey);
     }
 
 
diff --git a/install/ui/develop.js b/install/ui/develop.js
index 5095905d7d5b5d3a420e1e0b007a69fc633ade93..9f0c8dd5ac4f60fd1fb43f3f7245702fb0b275fb 100644
--- a/install/ui/develop.js
+++ b/install/ui/develop.js
@@ -4,7 +4,7 @@ if (window.location.protocol == 'file:') {
     IPA.json_url = "test/data";
     IPA.use_static_files = true;
 
-    IPA.refresh_devel_hook = function(entity_name,command,pkey){
+    IPA.details_refresh_devel_hook = function(entity_name,command,pkey){
         if ((entity_name === 'host')||(entity_name === 'permission')){
             command.name =   entity_name+'_show_'+pkey;
             command.method = entity_name+'_show';
diff --git a/install/ui/dns.js b/install/ui/dns.js
index e1fce532edb9df73d85b51624b7658c414d0827a..1af95f726050e05217fabbc57506f05102f4276d 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -32,8 +32,8 @@ IPA.entity_factories.dnszone = function() {
             columns:['idnsname'],
             add_fields: ['idnsname','idnssoamname','idnssoarname']
         }).
-        details_facet([{
-            section:'identity',
+        details_facet({sections:[{
+            name:'identity',
             fields:[
                 'idnsname',
                 'idnszoneactive',
@@ -47,12 +47,12 @@ IPA.entity_factories.dnszone = function() {
                 'dnsttl',
                 'dnsclass',
                 'idnsallowdynupdate',
-                'idnsupdatepolicy']}]).
+                'idnsupdatepolicy']}]}).
         facet(IPA.records_facet({
             'name': 'records',
             'label': IPA.metadata.objects.dnsrecord.label
         })).
-        standard_associations().
+        standard_association_facets().
         build();
 };
 
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 31be28600e17b1e231ecebe1a9c547c17d51e56f..ae0ef5c25cf1086acb0850cd26a5144156e0fa51 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -530,30 +530,28 @@ IPA. facet_create_action_panel = function(container) {
 IPA.entity_builder = function(){
 
     var that = {};
-
-    var entity_name ;
     var entity = null;
     var current_facet = null;
 
-
     function section(spec){
         var current_section = null;
-        spec.entity_name = entity_name;
+        spec.entity_name = entity.name;
 
         if (spec.section){
             spec.name = spec.section;
-            if (!spec.label){
-                var obj_messages = IPA.messages.objects[entity_name];
-                spec.label =  obj_messages[spec.section];
-            }
         }
 
+        if (!spec.label){
+            var obj_messages = IPA.messages.objects[entity.name];
+            spec.label =  obj_messages[spec.name];
+        }
+        
         if (spec.factory){
             current_section =  spec.factory(spec);
         }else{
             current_section = IPA.details_list_section(spec);
         }
-
+        current_facet.add_section(current_section);
         var fields = spec.fields;
         if (fields){
             var i;
@@ -561,23 +559,20 @@ IPA.entity_builder = function(){
             for (i =0; i < fields.length; i += 1){
                 field =  fields[i];
                 if (field instanceof Object){
-                    field.entity_name = entity_name;
+                    field.entity_name = entity.name;
                     current_section.add_field(field.factory(field));
                 }else{
                     field = IPA.text_widget({
                         name:field,
-                        entity_name:entity_name
+                        entity_name:entity.name
                     });
                     current_section.add_field(field);
                 }
             }
         }
-        current_facet.add_section(current_section);
     }
 
     that.entity = function(name){
-        entity_name = name;
-        that.entity_name = name;
         entity = IPA.entity({name: name});
         return that;
     };
@@ -587,8 +582,11 @@ IPA.entity_builder = function(){
         return that;
     };
 
-    that.details_facet = function (sections){
-        current_facet =IPA.details_facet({entity_name:entity_name});
+    that.details_facet = function (spec){
+        var sections = spec.sections;
+        spec.sections = null;
+        spec.entity_name = entity.name;
+        current_facet =IPA.details_facet(spec);
         entity.facet(current_facet);
 
         var i;
@@ -599,10 +597,6 @@ IPA.entity_builder = function(){
         return that;
     };
 
-    that.get_current_facet = function(){
-        return current_facet;
-    };
-
     that.facet = function (facet){
         current_facet = facet;
         entity.facet(facet);
@@ -611,11 +605,9 @@ IPA.entity_builder = function(){
 
     that.search_facet = function (spec){
         current_facet = IPA.search_facet({
-            entity_name:that.entity_name,
+            entity_name:entity.name,
             search_all: spec.search_all || false
         });
-        //once everything usese this mechanism, inline the init code
-        current_facet.init();
 
         var columns = spec.columns;
         var i;
@@ -630,7 +622,7 @@ IPA.entity_builder = function(){
             IPA.add_dialog({
                 'name': 'add',
                 'title': IPA.messages.objects.user.add,
-                entity_name: entity_name
+                entity_name: entity.name
             });
 
         current_facet.dialog(current_dialog);
@@ -653,7 +645,7 @@ IPA.entity_builder = function(){
                     field.section = null;
                     current_dialog.add_section(factory(field));
                 }else{
-                    field.entity_name = entity_name;
+                    field.entity_name = entity.name;
                     factory = field.factory;
                     current_dialog.field(factory(field));
                 }
@@ -661,19 +653,18 @@ IPA.entity_builder = function(){
                 current_dialog.text(add_fields[i]);
             }
         }
-
         entity.facet(current_facet);
         return that;
     };
 
 
     that.association_facet = function(spec){
-        spec.entity_name = entity_name;
+        spec.entity_name = entity.name;
         entity.facet(IPA.association_facet(spec));
         return that;
     };
 
-    that.standard_associations = function(){
+    that.standard_association_facets = function(){
         entity.standard_associations();
         return that;
     };
diff --git a/install/ui/group.js b/install/ui/group.js
index cc443cc53bffed5b49f2dc0d3da49b43bddd148b..7c7488f108a5a8b3379b35fea3e37e8d9e01a000 100644
--- a/install/ui/group.js
+++ b/install/ui/group.js
@@ -42,11 +42,11 @@ IPA.entity_factories.group =  function () {
                 },
                 'gidnumber']
         }).
-        details_facet(
+        details_facet({sections:
             [{
-                section:'details',
+                name:'details',
                 fields:['cn','description','gidnumber']
-            }]).
+            }]}).
         facet( IPA.association_facet({
             'name': 'member_user',
             columns:[
@@ -85,6 +85,6 @@ IPA.entity_factories.group =  function () {
             name: 'memberof_role',
             associator: IPA.serial_associator
         }).
-        standard_associations().
+        standard_association_facets().
         build();
 };
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index 4b9fe1ed3d0e00a02b1ffd672f9c30320c0d2990..a8047abbe5d1b62ab494277b9c6e9b72d7da7d71 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -54,10 +54,10 @@ IPA.entity_factories.hbacsvc = function () {
         search_facet({
             columns:['cn','description'],
             add_fields:['cn','description']}).
-        details_facet([{
+        details_facet({sections:[{
             section : 'general',
             label: IPA.messages.details.general,
-            fields:[ 'cn', 'description']}]).
+            fields:[ 'cn', 'description']}]}).
         build();
 };
 
@@ -68,14 +68,14 @@ IPA.entity_factories.hbacsvcgroup = function () {
         search_facet({
             columns:['cn', 'description'],
             add_fields:['cn', 'description']}).
-        details_facet([
+        details_facet({sections:[
             {
-                section: 'general',
+                name: 'general',
                 label: IPA.messages.details.general,
                 fields:['cn','description']
             },
             {
-                section: 'services',
+                name: 'services',
                 label: IPA.messages.objects.hbacsvcgroup.services,
                 fields:[{
                     factory: IPA.hbacsvcgroup_member_hbacsvc_table_widget,
@@ -84,7 +84,7 @@ IPA.entity_factories.hbacsvcgroup = function () {
                     other_entity: 'hbacsvc',
                     save_values: false
                 }]
-            }]).
+            }]}).
         build();
 };
 
diff --git a/install/ui/host.js b/install/ui/host.js
index 3f9c05d1de849fd6686a51729784b7904d54f52a..488e3032903e9926cf4128fd4b58675b649d56ee 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -36,9 +36,9 @@ IPA.entity_factories.host = function () {
             }],
             add_fields: ['fqdn', {factory:IPA.force_host_add_checkbox_widget}]
         }).
-        details_facet([
+        details_facet({sections:[
             {
-                section:'details',
+                name:'details',
                 fields: [
                     'fqdn',
                     'krbprincipalname',
@@ -51,7 +51,7 @@ IPA.entity_factories.host = function () {
                     'description' ]
             },
             {
-                section:'enrollment',
+                name:'enrollment',
                 fields:[
                     {
                         factory: IPA.host_provisioning_status_widget,
@@ -69,7 +69,7 @@ IPA.entity_factories.host = function () {
                         label: IPA.messages.objects.host.status
                     }
                 ]
-            }]).
+            }]}).
         facet(IPA.host_managedby_host_facet({
             name: 'managedby_host'
         })).
@@ -85,7 +85,7 @@ IPA.entity_factories.host = function () {
             name: 'memberof_role',
             associator: IPA.serial_associator
         }).
-        standard_associations().
+        standard_association_facets().
         build();
 };
 
diff --git a/install/ui/hostgroup.js b/install/ui/hostgroup.js
index 46f2ab68c6dca8ca84e387570083bbf6eb6b5767..a1b5ede2e4811919f4d6b2324a3c1a8e86933dfc 100644
--- a/install/ui/hostgroup.js
+++ b/install/ui/hostgroup.js
@@ -29,16 +29,16 @@ IPA.entity_factories.hostgroup = function() {
         entity('hostgroup').
         search_facet({columns:['cn','description'],
                       add_fields:['cn','description']}).
-        details_facet([{
-            section:'identity',
+        details_facet({sections:[{
+            name:'identity',
             label: IPA.messages.objects.hostgroup.identity,
             fields:['cn','description']
-        }]).
+        }]}).
         association_facet({
             name: 'memberof_hostgroup',
             associator: IPA.serial_associator
         }).
-        standard_associations().
+        standard_association_facets().
         build();
 };
 
diff --git a/install/ui/netgroup.js b/install/ui/netgroup.js
index 9389d019704f871fbde2c9777c3d7fdca5bad8b0..aa61419118ae646d7e1912354853275be6427ace 100644
--- a/install/ui/netgroup.js
+++ b/install/ui/netgroup.js
@@ -28,13 +28,13 @@ IPA.entity_factories.netgroup = function() {
         search_facet({
             columns:['cn','description'],
             add_fields:['cn', 'description']}).
-        details_facet([{
-            section:'identity',
-            fields:['cn','description','nisdomainname']}]).
+        details_facet({sections:[{
+            name:'identity',
+            fields:['cn','description','nisdomainname']}]}).
         association_facet({
             name: 'memberof_netgroup',
             associator: IPA.serial_associator
         }).
-        standard_associations().
+        standard_association_facets().
         build();
 };
diff --git a/install/ui/policy.js b/install/ui/policy.js
index ec202138c42e44a60546127bf38905e35c6fba2d..21ee2bc755a8b8f73cbe0de9670d621c5de2440e 100644
--- a/install/ui/policy.js
+++ b/install/ui/policy.js
@@ -30,13 +30,14 @@ IPA.entity_factories.pwpolicy = function() {
         search_facet({
             columns:['cn'],
             add_fields:['cn', 'cospriority']}).
-        details_facet([
-            {
-                section : 'identity',
-                fields:['krbmaxpwdlife','krbminpwdlife','krbpwdhistorylength',
-                        'krbpwdmindiffchars','krbpwdminlength']
-            }]).
-        standard_associations().
+        details_facet({
+            sections:[
+                {
+                    section : 'identity',
+                    fields:['krbmaxpwdlife','krbminpwdlife','krbpwdhistorylength',
+                            'krbpwdmindiffchars','krbpwdminlength']
+                }]}).
+        standard_association_facets().
         build();
 };
 
@@ -47,9 +48,10 @@ IPA.entity_factories.pwpolicy = function() {
 IPA.entity_factories.krbtpolicy =  function() {
     return IPA.entity_builder().
         entity('krbtpolicy').
-        details_facet([{
-            section: 'identity',
-            fields:[ 'krbmaxrenewableage','krbmaxticketlife' ]
-        }]).
+        details_facet({
+            sections:[{
+                name: 'identity',
+                fields:[ 'krbmaxrenewableage','krbmaxticketlife' ]
+            }]}).
         build();
 };
diff --git a/install/ui/serverconfig.js b/install/ui/serverconfig.js
index 4d10423140500f2e785f1ff8ae15970d905fa6d8..3c2b33e231e82281e8d019595893c035bf0c5fb3 100644
--- a/install/ui/serverconfig.js
+++ b/install/ui/serverconfig.js
@@ -30,8 +30,10 @@
 IPA.entity_factories.config = function(){
     return IPA.entity_builder().
         entity('config').
-        details_facet([{
-            section: 'ipaserver',
+        details_facet({
+            sections:
+            [{
+            name: 'ipaserver',
             label: IPA.messages.objects.config.ipaserver,
             fields:
             [{
@@ -43,6 +45,6 @@ IPA.entity_factories.config = function(){
              'ipadefaultprimarygroup','ipagroupsearchfields',
              'ipahomesrootdir','ipamaxusernamelength',
              'ipamigrationenabled','ipasearchrecordslimit',
-             'ipasearchtimelimit','ipausersearchfields']}]).
+             'ipasearchtimelimit','ipausersearchfields']}]}).
         build();
 };
\ No newline at end of file
diff --git a/install/ui/service.js b/install/ui/service.js
index 8590550aeef2e8454893ebd98c863448bb88556e..45b8e3d091ccc60ed304fc9559b32afe10f4bc4a 100644
--- a/install/ui/service.js
+++ b/install/ui/service.js
@@ -36,9 +36,9 @@ IPA.entity_factories.service = function() {
                         title: IPA.messages.objects.service.add,
                         width: '450px'
                     }))).
-        details_facet([
+        details_facet({sections:[
             {
-                section: 'details',
+                name: 'details',
                 fields:['krbprincipalname',
                         {
                             factory:IPA.service_name_widget,
@@ -62,19 +62,20 @@ IPA.entity_factories.service = function() {
                 }]
             },
             {
-                section: 'certificate',
+                name: 'certificate',
                 fields:[{
                     factory:IPA.service_certificate_status_widget,
                     name: 'certificate_status',
                     label: IPA.messages.objects.service.status
                 }]
-            }]).
+            }]}).
         facet(IPA.service_managedby_host_facet({
                 name: 'managedby_host',
                 add_method: 'add_host',
                 remove_method: 'remove_host'
         })).
-        standard_associations().build();
+        standard_association_facets().
+        build();
 };
 
 
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 742895a44015694391f12cef9f20f88fb5a34958..70cc7d30619bea6a550a71373fbdde659259992f 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -44,14 +44,14 @@ IPA.entity_factories.sudocmd = function () {
         search_facet({
             columns:['sudocmd','description'],
             add_fields:['sudocmd','description']}).
-        details_facet([
+        details_facet({sections:[
             {
                 section : 'general',
                 label: IPA.messages.details.general,
                 fields:['sudocmd','description']
             },
             {
-                section: 'groups',
+                name: 'groups',
                 label: IPA.messages.objects.sudocmd.groups,
                 factory: IPA.details_section,
                 fields:[{
@@ -84,7 +84,7 @@ IPA.entity_factories.sudocmd = function () {
                         }
                     ]
                 }]
-            }]).
+            }]}).
         build();
 
 };
@@ -96,15 +96,15 @@ IPA.entity_factories.sudocmdgroup = function () {
             columns:['cn','description'],
             add_fields:['cn','description']
         }).
-        details_facet([
+        details_facet({sections:[
             {
 
-                section: 'general',
+                name: 'general',
                 label: IPA.messages.dialogs.general,
                 fields:['cn','description']
             },
             {
-                section: 'commands',
+                name: 'commands',
                 factory:  IPA.details_section,
                 fields: [{
                     factory: IPA.association_table_widget,
@@ -136,7 +136,7 @@ IPA.entity_factories.sudocmdgroup = function () {
                         }
                     ]
                 }]
-            }]).
+            }]}).
         build();
 };
 
diff --git a/install/ui/test/details_tests.js b/install/ui/test/details_tests.js
index 6cc8fd72d01a63a088095448db093faa3b299ff1..d3c18d435843d712f9ebbb90de326e6290cdb7d6 100644
--- a/install/ui/test/details_tests.js
+++ b/install/ui/test/details_tests.js
@@ -29,11 +29,6 @@ module('details', {
             "data",
             true,
             function(data, text_status, xhr) {
-                IPA.metadata = data.result.results[0];
-                IPA.messages = data.result.results[1].messages;
-                IPA.whoami  = data.result.results[2].result[0];
-                IPA.env = data.result.results[3].result;
-                IPA.dns_enabled = data.result.results[4].result;
             },
             function(xhr, text_status, error_thrown) {
                 ok(false, "ipa_init() failed: "+error_thrown);
@@ -181,14 +176,14 @@ test("Testing details lifecycle: create, setup, load.", function(){
     var entity =   IPA.
         entity_builder().
         entity('user').
-        details_facet([
+        details_facet({sections:[
             {
-                section: 'identity',
+                name: 'identity',
                 label: IPA.messages.details.identity,
                 fields:['title','givenname','sn','cn','displayname', 'initials']
             },
             {
-                section: 'contact',
+                name: 'contact',
                 label:'contact',
                 fields:
                 [  {factory: test_widget,name:'test'},
@@ -200,7 +195,7 @@ test("Testing details lifecycle: create, setup, load.", function(){
                    {factory: IPA.multivalued_text_widget,
                     name:'facsimiletelephonenumber'}]
             },
-        ]).build();
+        ]}).build();
     entity.init();
 
     var facet = entity.get_facet('details');
diff --git a/install/ui/test/entity_tests.js b/install/ui/test/entity_tests.js
index 5f7ba9e7398b8ee0eb6f9ec944d1d7a92db06f54..86e44cd6741056c91eddb2cabc3274ffc44167ba 100644
--- a/install/ui/test/entity_tests.js
+++ b/install/ui/test/entity_tests.js
@@ -30,11 +30,6 @@ module('entity',{
             "data",
             true,
             function(data, text_status, xhr) {
-                IPA.metadata = data.result.results[0];
-                IPA.messages = data.result.results[1].messages;
-                IPA.whoami  = data.result.results[2].result[0];
-                IPA.env = data.result.results[3].result;
-                IPA.dns_enabled = data.result.results[4].result;
 
                 IPA.entity_factories.user = function(){
                     return IPA.
diff --git a/install/ui/user.js b/install/ui/user.js
index a922f9f89341419e68d3a03893de7865bd95d672..c88fe78d607251597e8aaff20ef5e3d13bbab940 100644
--- a/install/ui/user.js
+++ b/install/ui/user.js
@@ -33,21 +33,21 @@ IPA.entity_factories.user = function() {
             add_fields: ['uid','givenname','sn'],
             search_all: true
         }).
-        details_facet([
+        details_facet({sections:[
             {
-                section: 'identity',
+                name: 'identity',
                 label: IPA.messages.details.identity,
                 fields:['title','givenname','sn','cn','displayname', 'initials']
             },
             {
-                section: 'account',
+                name: 'account',
                 fields:[{factory:IPA.user_status_widget,name:'nsaccountlock'},
                         'uid',
                         {factory: IPA.user_password_widget,name:'userpassword'},
                         'uidnumber','gidnumber','loginshell','homedirectory']
             },
             {
-                section: 'contact',
+                name: 'contact',
                 fields:
                 [  {factory: IPA.multivalued_text_widget, name:'mail'},
                    {factory: IPA.multivalued_text_widget, name:'telephonenumber'},
@@ -56,17 +56,17 @@ IPA.entity_factories.user = function() {
                    {factory: IPA.multivalued_text_widget, name:'facsimiletelephonenumber'}]
             },
             {
-                section: 'mailing',
+                name: 'mailing',
                 fields: ['street','l','st','postalcode']
             },
             {
-                section: 'employee',
+                name: 'employee',
                 fields: ['ou','manager']
             },
             {
-                section: 'misc',
+                name: 'misc',
                 fields:['carlicense']
-            }]).
+            }]}).
         association_facet({
             name: 'memberof_group',
             associator: IPA.serial_associator
@@ -79,7 +79,7 @@ IPA.entity_factories.user = function() {
             name: 'memberof_role',
             associator: IPA.serial_associator
         }).
-        standard_associations();
+        standard_association_facets();
 
 
     var entity = builder.build();
-- 
1.7.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to