From 390d017e321fd5ed56af094cf1f1c74f64e95735 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Sat, 10 Sep 2011 11:54:02 -0500 Subject: Modified dialog to use sections. The IPA.dialog has been modified to store sections instead of fields. If there is no sections specified, it will create a default section. The adder dialog for automount map has been modified such that the fields related to indirect map are stored in a section which will only be visible when the map type is set to indirect. The adder dialog for host has been modified such that it uses a custom section for hostname and DNS zone and standard section for the other fields. Ticket #1394 --- install/ui/aci.js | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'install/ui/aci.js') diff --git a/install/ui/aci.js b/install/ui/aci.js index 5dcd69d4..13fbc7d1 100644 --- a/install/ui/aci.js +++ b/install/ui/aci.js @@ -65,12 +65,20 @@ IPA.entity_factories.permission = function() { adder_dialog({ width: 500, height: 400, - fields: [ - 'cn', + sections: [ { - factory: IPA.rights_widget, - name: 'permissions', - join: true, undo: false + name: 'general', + fields: [ + { + name: 'cn', + undo: false + }, + { + factory: IPA.rights_widget, + name: 'permissions', + join: true, undo: false + } + ] }, { factory: IPA.target_section, @@ -274,7 +282,7 @@ IPA.attributes_widget = function(spec) { } if (that.object_type){ - that.populate (that.object_type); + that.populate(that.object_type); } }; @@ -392,7 +400,6 @@ IPA.target_section = function(spec) { spec = spec || {}; var that = IPA.details_section(spec); - that.section = true; that.undo = typeof spec.undo == 'undefined' ? true : spec.undo; var target_types = [ @@ -406,7 +413,7 @@ IPA.target_section = function(spec) { that.filter_text.load(record); }, save: function(record) { - record.filter = that.filter_text.save()[0]; + record.filter = that.filter_text.save(); } }, { @@ -419,7 +426,7 @@ IPA.target_section = function(spec) { that.subtree_textarea.load(record); }, save: function(record) { - record.subtree = that.subtree_textarea.save()[0]; + record.subtree = that.subtree_textarea.save(); } }, { @@ -432,7 +439,7 @@ IPA.target_section = function(spec) { that.group_select.list.val(record.targetgroup); }, save: function(record) { - record.targetgroup = that.group_select.save()[0]; + record.targetgroup = that.group_select.save(); } }, { @@ -478,17 +485,17 @@ IPA.target_section = function(spec) { that.type_select.select_update(); that.attribute_table.object_type = that.type_select.save()[0]; - that.attribute_table.reset(); - }; + that.attribute_table.reset(); + }; }, - load: function(record){ + load: function(record) { that.type_select.load(record); that.attribute_table.object_type = record.type; that.attribute_table.reset(); }, - save: function(record){ - record.type = that.type_select.save()[0]; - record.attrs = that.attribute_table.save().join(','); + save: function(record) { + record.type = that.type_select.save(); + record.attrs = that.attribute_table.save(); } }] ; @@ -507,12 +514,14 @@ IPA.target_section = function(spec) { undo: that.undo }); that.group_select = IPA.entity_select_widget({ + entity: spec.entity, name: 'targetgroup', other_entity: 'group', other_field: 'cn', undo: that.undo }); that.type_select = IPA.select_widget({ + entity: spec.entity, name: 'type', undo: that.undo }); -- cgit