First two patches are bug fixes which are required for third patch. Depends on my patch #259 (Combobox keyboard support)

1) [PATCH] Fix dirty state update of editable combobox

Editable combobox didn't update it's dirty state correctly. CB had it's own
internal value changed event, which was incorrectly used. It was removed and
widget's value_changed event was used instead.

2) [PATCH] Fix handling of no_update flag in Web UI

There was an incorrect check for no_update flag. Check was performed as
if the flag was an attribute of object not an item of array. Hence, the
flag never caused any effect.

3) [PATCH] Global trust config page

https://fedorahosted.org/freeipa/ticket/3333



--
Petr Vobornik
From 12e823b1ba6a63119f67a6c7adf5469d296a397a Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Mon, 18 Feb 2013 15:53:22 +0100
Subject: [PATCH] Fix dirty state update of editable combobox

Editable combobox didn't update it's dirty state correctly. CB had it's own
internal value changed event, which was incorrectly used. It was removed and
widget's value_changed event was used instead.
---
 install/ui/src/freeipa/field.js  | 24 ++----------------------
 install/ui/src/freeipa/widget.js |  4 +---
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js
index f6906d7d9fd23ca654b28be1f7a2038404dbbea4..c549a0004eb87f5680aee456a5de95260f237ed9 100644
--- a/install/ui/src/freeipa/field.js
+++ b/install/ui/src/freeipa/field.js
@@ -714,26 +714,6 @@ IPA.select_field = function(spec) {
     return that;
 };
 
-
-IPA.combobox_field = function(spec) {
-
-    spec = spec || {};
-
-    var that = IPA.field(spec);
-
-    that.widgets_created = function() {
-
-        that.field_widgets_created();
-        that.widget.input_field_changed.attach(that.on_input_field_changed);
-    };
-
-    that.on_input_field_changed = function() {
-        that.validate();
-    };
-
-    return  that;
-};
-
 IPA.link_field = function(spec) {
 
     spec = spec || {};
@@ -935,9 +915,9 @@ IPA.field_builder = function(spec) {
 
 IPA.field_factories['checkbox'] = IPA.checkbox_field;
 IPA.field_factories['checkboxes'] = IPA.checkboxes_field;
-IPA.field_factories['combobox'] = IPA.combobox_field;
+IPA.field_factories['combobox'] = IPA.field;
 IPA.field_factories['enable'] = IPA.enable_field;
-IPA.field_factories['entity_select'] = IPA.combobox_field;
+IPA.field_factories['entity_select'] = IPA.field;
 IPA.field_factories['field'] = IPA.field;
 IPA.field_factories['link'] = IPA.link_field;
 IPA.field_factories['multivalued'] = IPA.multivalued_field;
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index b67d6776a3e164ba5fe67b5e477e2c3d35570b4d..6472cab971385d31247639c3e526c9e8f0b9063c 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -2080,7 +2080,6 @@ IPA.combobox_widget = function(spec) {
     that.size = spec.size || 5;
     that.empty_option = spec.empty_option === undefined ? true : spec.empty_option;
     that.options = spec.options || [];
-    that.input_field_changed = IPA.observer();
     that.z_index = spec.z_index ? spec.z_index + 9000000 : 9000000;
 
     that.create = function(container) {
@@ -2237,7 +2236,6 @@ IPA.combobox_widget = function(spec) {
             return false;
         }
 
-        that.input_field_changed.notify([], that);
         return true;
     };
 
@@ -2245,7 +2243,7 @@ IPA.combobox_widget = function(spec) {
         if (!that.editable || that.read_only) {
             e.preventDefault();
         } else {
-            that.input_field_changed.notify([], that);
+            that.value_changed.notify([], that);
         }
     };
 
-- 
1.7.11.7

From 9ace4685c7f8c30882b1c1d75aeb64a49c1480de Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Mon, 18 Feb 2013 13:44:07 +0100
Subject: [PATCH] Fix handling of no_update flag in Web UI

There was an incorrect check for no_update flag. Check was performed as
if the flag was an attribute of object not an item of array. Hence, the
flag never caused any effect.
---
 install/ui/src/freeipa/field.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js
index c549a0004eb87f5680aee456a5de95260f237ed9..f705ef7b899f502b717daa384c01763c96aea664 100644
--- a/install/ui/src/freeipa/field.js
+++ b/install/ui/src/freeipa/field.js
@@ -21,7 +21,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-define(['./ipa', './jquery'], function(IPA, $) {
+define(['dojo/_base/array', './ipa', './jquery'], function(array, IPA, $) {
 
 IPA.field = function(spec) {
     spec = spec || {};
@@ -182,7 +182,7 @@ IPA.field = function(spec) {
                 that.writable = false;
             }
 
-            if (that.metadata.flags && 'no_update' in that.metadata.flags) {
+            if (that.metadata.flags && array.indexOf(that.metadata.flags, 'no_update') > -1) {
                 that.writable = false;
             }
         }
-- 
1.7.11.7

From fe6eb20ecb47f9b48274314d4e49c09a00eed9c1 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Mon, 11 Feb 2013 12:56:35 +0100
Subject: [PATCH] Global trust config page

https://fedorahosted.org/freeipa/ticket/3333
---
 install/ui/src/freeipa/trust.js    | 67 ++++++++++++++++++++++++++++++++++++++
 install/ui/src/freeipa/webui.js    |  7 +++-
 install/ui/test/data/ipa_init.json |  6 +++-
 ipalib/plugins/internal.py         |  4 +++
 4 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/install/ui/src/freeipa/trust.js b/install/ui/src/freeipa/trust.js
index 22880bfe7859821355838bb29a65485a3ec665dc..c72197a1c4c32d91de53a1b26072edff60ac81ff 100644
--- a/install/ui/src/freeipa/trust.js
+++ b/install/ui/src/freeipa/trust.js
@@ -179,7 +179,74 @@ IPA.trust.adder_dialog = function(spec) {
     return that;
 };
 
+IPA.trust.config_entity = function(spec) {
+
+    var that = IPA.entity(spec);
+
+    that.init = function() {
+        that.entity_init();
+
+        that.builder.details_facet({
+            factory: IPA.trust.config_details_facet,
+            trust_type:  'ad',
+            sections: [
+                {
+                    name: 'details',
+                    label: IPA.messages.objects.trustconfig.options,
+                    fields: [
+                        'cn',
+                        'ipantsecurityidentifier',
+                        'ipantflatname',
+                        'ipantdomainguid',
+                        {
+                            type: 'entity_select',
+                            name: 'ipantfallbackprimarygroup',
+                            other_entity: 'group',
+                            other_field: 'cn',
+                            editable: true
+                        }
+                    ]
+                }
+            ]
+        });
+    };
+
+    return that;
+};
+
+IPA.trust.config_details_facet = function(spec) {
+
+    spec = spec || {};
+
+    var that = IPA.details_facet(spec);
+
+    that.trust_type = spec.trust_type;
+
+    that.get_refresh_command_name = function() {
+        return that.entity.name+that.trust_type+'_show';
+    };
+
+    that.create_refresh_command = function() {
+
+        var command = that.details_facet_create_refresh_command();
+        command.set_option('trust_type', that.trust_type);
+
+        return command;
+    };
+
+    that.create_update_command = function() {
+
+        var command = that.details_facet_create_update_command();
+        command.set_option('trust_type', that.trust_type);
+
+        return command;
+    };
+
+    return that;
+};
+
 IPA.register('trust', IPA.trust.entity);
+IPA.register('trustconfig', IPA.trust.config_entity);
 
 return {};
 });
\ No newline at end of file
diff --git a/install/ui/src/freeipa/webui.js b/install/ui/src/freeipa/webui.js
index f6c3339ec4b5d3fb8a4cb547407eebf2a19b45af..48ca2e09c122dd155a29d299ef52227b3798e6a1 100644
--- a/install/ui/src/freeipa/webui.js
+++ b/install/ui/src/freeipa/webui.js
@@ -82,7 +82,12 @@ IPA.admin_navigation = function(spec) {
             {entity: 'selfservice'},
             {entity: 'delegation'},
             {entity: 'idrange'},
-            {entity: 'trust'},
+            {
+                name: 'trusts', label: IPA.messages.tabs.trust, children:[
+                    {entity: 'trust'},
+                    {entity: 'trustconfig'}
+                ]
+            },
             {entity: 'config'}
         ]}];
 
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index 44484a9aaa4b04c2730cacd1adcbe682e507d736..2d527a104ec6d5c445c6d4407966c4d178cc159e 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -457,6 +457,9 @@
                             "truststatus": "Trust status",
                             "trusttype": "Trust type"
                         },
+                        "trustconfig": {
+                            "options": "Options"
+                        },
                         "user": {
                             "account": "Account Settings",
                             "account_status": "Account Status",
@@ -515,7 +518,8 @@
                         "ipaserver": "IPA Server",
                         "policy": "Policy",
                         "role": "Role Based Access Control",
-                        "sudo": "Sudo"
+                        "sudo": "Sudo",
+                        "trust": "Trusts"
                     },
                     "true": "True",
                     "widget": {
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index cfb5d60f9f8a9f748b58dd8364a8690bf6724755..b3e4d3caff9605548eae57233cb5443cfb96f8aa 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -596,6 +596,9 @@ class i18n_messages(Command):
                 "truststatus": _("Trust status"),
                 "trusttype": _("Trust type"),
             },
+            "trustconfig": {
+                "options": _("Options"),
+            },
             "user": {
                 "account": _("Account Settings"),
                 "account_status": _("Account Status"),
@@ -655,6 +658,7 @@ class i18n_messages(Command):
             "policy": _("Policy"),
             "role": _("Role Based Access Control"),
             "sudo": _("Sudo"),
+            "trust": _("Trusts"),
         },
         "true": _("True"),
         "widget": {
-- 
1.7.11.7

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

Reply via email to