On 9/26/2011 10:01 AM, Petr Vobornik wrote:
On 09/17/2011 01:42 AM, Endi Sukma Dewata wrote:
Ticket #1783


It needs rebase and removing 'undo: false' because it's based on your
patch 270 and has conflicts with 271-4a and 271-4b.

Rebased. I also removed the 'undo: false' from this patch.

Should we add 'description' field to HBAC and SUDO rule add dialogs, to
be consistent with other HBAC and SUDO add dialogs?

The description is not required by HBAC/sudo rule, but I think we can add it for 3.0.

Otherwise it's OK.

Pushed to master.

--
Endi S. Dewata
From dedf456928bae928b3f9f6a74dde16006cd8ab2d Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Fri, 16 Sep 2011 18:21:41 -0500
Subject: [PATCH] Replaced description text fields with text areas.

Ticket #1783
---
 install/ui/aci.js       |   68 ++++++++++++++++++++++++++++++++---------
 install/ui/automount.js |   13 +++++++-
 install/ui/group.js     |   34 ++++++++++++++++-----
 install/ui/hbac.js      |   68 +++++++++++++++++++++++++++++++++--------
 install/ui/host.js      |    5 ++-
 install/ui/hostgroup.js |   35 +++++++++++++++++----
 install/ui/netgroup.js  |   29 ++++++++++++------
 install/ui/sudo.js      |   76 ++++++++++++++++++++++++++++++++++------------
 8 files changed, 251 insertions(+), 77 deletions(-)

diff --git a/install/ui/aci.js b/install/ui/aci.js
index fc62f2770979e95768a230c20c80d0aae0e3ce1e..676f5df3e63032dd6c6f32279314545608fbcc28 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -93,14 +93,26 @@ IPA.entity_factories.privilege = function() {
         entity('privilege').
         facet_groups([ 'role', 'settings', 'permission' ]).
         search_facet({
-            columns:['cn','description']}).
+            columns: [
+                'cn',
+                'description'
+            ]
+        }).
         details_facet({
-            sections:
-            [{
-                name:'identity',
-                label: IPA.messages.details.identity,
-                fields:['cn','description']
-            }]}).
+            sections: [
+                {
+                    name: 'identity',
+                    label: IPA.messages.details.identity,
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
+                }
+            ]
+        }).
         association_facet({
             name: 'member_role',
             facet_group: 'role',
@@ -116,7 +128,13 @@ IPA.entity_factories.privilege = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:['cn', 'description']
+            fields: [
+                'cn',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
+            ]
         }).
         build();
 
@@ -128,12 +146,26 @@ IPA.entity_factories.role = function() {
         entity('role').
         facet_groups([ 'member', 'settings', 'privilege' ]).
         search_facet({
-            columns:['cn','description']}).
-        details_facet({sections:[
-            {
-                name:'identity',
-                label:IPA.messages.objects.role.identity,
-                fields:['cn','description']}]}).
+            columns: [
+                'cn',
+                'description'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'identity',
+                    label: IPA.messages.objects.role.identity,
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
+                }
+            ]
+        }).
         association_facet({
                 name: 'memberof_privilege',
                 facet_group: 'privilege',
@@ -142,7 +174,13 @@ IPA.entity_factories.role = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:['cn', 'description']
+            fields: [
+                'cn',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
+            ]
         }).
         build();
 };
diff --git a/install/ui/automount.js b/install/ui/automount.js
index a4fe166e18613b94b27ad048303715fc5d477d88..89b0f6b7eff2988a5f2efcac2358323ee956f767 100644
--- a/install/ui/automount.js
+++ b/install/ui/automount.js
@@ -81,7 +81,13 @@ IPA.entity_factories.automountmap = function() {
                 {
                     name: 'identity',
                     label: IPA.messages.details.identity,
-                    fields: [ 'automountmapname', 'description' ]
+                    fields: [
+                        'automountmapname',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
                 }
             ]
         }).
@@ -107,7 +113,10 @@ IPA.entity_factories.automountmap = function() {
                             ]
                         },
                         'automountmapname',
-                        'description'
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
                     ]
                 },
                 {
diff --git a/install/ui/group.js b/install/ui/group.js
index ad705eb21e4ed06298319110ca4822e86ec701dc..b9664ea6141736e7a2415d2548f838ecd15de1fd 100644
--- a/install/ui/group.js
+++ b/install/ui/group.js
@@ -29,13 +29,27 @@ IPA.entity_factories.group =  function () {
     return IPA.entity_builder().
         entity('group').
         search_facet({
-            columns:['cn','gidnumber','description']
+            columns: [
+                'cn',
+                'gidnumber',
+                'description'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'details',
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        },
+                        'gidnumber'
+                    ]
+                }
+            ]
         }).
-        details_facet({sections:
-            [{
-                name:'details',
-                fields:['cn','description','gidnumber']
-            }]}).
         association_facet({
             name: 'member_user',
             columns:[
@@ -90,14 +104,18 @@ IPA.entity_factories.group =  function () {
         adder_dialog({
             fields: [
                 'cn',
-                'description',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                },
                 {
                     factory: IPA.group_nonposix_checkbox_widget,
                     name: 'nonposix',
                     label: IPA.messages.objects.group.posix,
                     checked: true
                 },
-                'gidnumber']
+                'gidnumber'
+            ]
         }).
         build();
 };
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index 52cb5d6f9d262d2408b2e0e124e86ed1e9164fb8..8c6a92addc939f41004824a88fbabc6da6e0011b 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -60,11 +60,26 @@ IPA.entity_factories.hbacsvc = function() {
     return IPA.entity_builder().
         entity('hbacsvc').
         search_facet({
-            columns:['cn','description']}).
-        details_facet({sections:[{
-            name: 'general',
-            label: IPA.messages.details.general,
-            fields:[ 'cn', 'description']}]}).
+            columns: [
+                'cn',
+                'description'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'general',
+                    label: IPA.messages.details.general,
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
+                }
+            ]
+        }).
         association_facet({
             name: 'memberof_hbacsvcgroup',
             associator: IPA.serial_associator,
@@ -90,7 +105,13 @@ IPA.entity_factories.hbacsvc = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:['cn','description']
+            fields: [
+                'cn',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
+            ]
         }).
         build();
 };
@@ -100,13 +121,26 @@ IPA.entity_factories.hbacsvcgroup = function() {
     return IPA.entity_builder().
         entity('hbacsvcgroup').
         search_facet({
-            columns:['cn', 'description']}).
-        details_facet({sections:[
-            {
-                name: 'general',
-                label: IPA.messages.details.general,
-                fields:['cn','description']
-            }]}).
+            columns: [
+                'cn',
+                'description'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'general',
+                    label: IPA.messages.details.general,
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
+                }
+            ]
+        }).
         association_facet({
             name: 'member_hbacsvc',
             columns:[
@@ -131,7 +165,13 @@ IPA.entity_factories.hbacsvcgroup = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:['cn', 'description']
+            fields: [
+                'cn',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
+            ]
         }).
         build();
 };
diff --git a/install/ui/host.js b/install/ui/host.js
index 6720b4fcabde2636cd88a0760e2bee006f9d00b9..6c5b44392838045c02f38bd97b0baa15b607928e 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -50,7 +50,10 @@ IPA.entity_factories.host = function () {
                             other_entity: 'dnsrecord'
                         },
                         'krbprincipalname',
-                        'description',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        },
                         'l',
                         'nshostlocation',
                         'nshardwareplatform',
diff --git a/install/ui/hostgroup.js b/install/ui/hostgroup.js
index 45420340f9fce06297fc54a952ffb8bf95de6c23..ef669960c114482716b0d27c7a9b6678cc5210ea 100644
--- a/install/ui/hostgroup.js
+++ b/install/ui/hostgroup.js
@@ -27,12 +27,27 @@ IPA.entity_factories.hostgroup = function() {
 
     return IPA.entity_builder().
         entity('hostgroup').
-        search_facet({columns:['cn','description']}).
-        details_facet({sections:[{
-            name:'identity',
-            label: IPA.messages.objects.hostgroup.identity,
-            fields:['cn','description']
-        }]}).
+        search_facet({
+            columns: [
+                'cn',
+                'description'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'identity',
+                    label: IPA.messages.objects.hostgroup.identity,
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
+                }
+            ]
+        }).
         association_facet({
             name: 'memberof_hostgroup',
             associator: IPA.serial_associator
@@ -55,7 +70,13 @@ IPA.entity_factories.hostgroup = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:['cn','description']
+            fields: [
+                'cn',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
+            ]
         }).
         build();
 };
diff --git a/install/ui/netgroup.js b/install/ui/netgroup.js
index 2136f926c7c1db5690c43dcb4bd14f107f8b766c..2b95c661b2478e95280c244076df07c3ba5379dd 100644
--- a/install/ui/netgroup.js
+++ b/install/ui/netgroup.js
@@ -27,19 +27,25 @@ IPA.entity_factories.netgroup = function() {
     return IPA.entity_builder().
         entity('netgroup').
         search_facet({
-            columns:[
+            columns: [
                 'cn',
                 'description'
             ]
         }).
         details_facet({
-            sections:[{
-                name:'identity',
-                fields:[
-                    'cn',
-                    'description',
-                    'nisdomainname']
-            }]
+            sections: [
+                {
+                    name: 'identity',
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        },
+                        'nisdomainname'
+                    ]
+                }
+            ]
         }).
         association_facet({
             name: 'memberhost_host',
@@ -63,9 +69,12 @@ IPA.entity_factories.netgroup = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:[
+            fields: [
                 'cn',
-                'description'
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
             ]
         }).
         build();
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index a97731242fc00c0f688867a07284729ea7af507d..acc1c9f4f471872a0696b65f26fcc82b5246598b 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -46,15 +46,28 @@ IPA.entity_factories.sudorule = function() {
 IPA.entity_factories.sudocmd = function() {
 
     return IPA.entity_builder().
-        entity( 'sudocmd').
+        entity('sudocmd').
         search_facet({
-            columns:['sudocmd','description']}).
-        details_facet({sections:[
-            {
-                name: 'general',
-                label: IPA.messages.details.general,
-                fields:['sudocmd','description']
-            }]}).
+            columns: [
+                'sudocmd',
+                'description'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'general',
+                    label: IPA.messages.details.general,
+                    fields: [
+                        'sudocmd',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
+                }
+            ]
+        }).
         association_facet({
             name: 'memberof_sudocmdgroup',
             associator: IPA.serial_associator,
@@ -66,7 +79,7 @@ IPA.entity_factories.sudocmd = function() {
                 },
                 { name: 'description' }
             ],
-            adder_columns:[
+            adder_columns: [
                 {
                     name: 'cn',
                     primary_key: true,
@@ -80,7 +93,13 @@ IPA.entity_factories.sudocmd = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:['sudocmd','description']
+            fields: [
+                'sudocmd',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
+            ]
         }).
         build();
 
@@ -90,18 +109,29 @@ IPA.entity_factories.sudocmdgroup = function() {
     return IPA.entity_builder().
         entity('sudocmdgroup').
         search_facet({
-            columns:['cn','description']
+            columns: [
+                'cn',
+                'description'
+            ]
+        }).
+        details_facet({
+            sections: [
+                {
+                    name: 'general',
+                    label: IPA.messages.details.general,
+                    fields: [
+                        'cn',
+                        {
+                            factory: IPA.textarea_widget,
+                            name: 'description'
+                        }
+                    ]
+                }
+            ]
         }).
-        details_facet({sections:[
-            {
-
-                name: 'general',
-                label: IPA.messages.details.general,
-                fields:['cn','description']
-            }]}).
         association_facet({
             name: 'member_sudocmd',
-            columns:[
+            columns: [
                 {
                     name: 'sudocmd',
                     primary_key: true,
@@ -123,7 +153,13 @@ IPA.entity_factories.sudocmdgroup = function() {
         }).
         standard_association_facets().
         adder_dialog({
-            fields:['cn','description']
+            fields: [
+                'cn',
+                {
+                    factory: IPA.textarea_widget,
+                    name: 'description'
+                }
+            ]
         }).
         build();
 };
-- 
1.7.5.1

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

Reply via email to