diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2011-11-22 17:33:09 +0100 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-12-05 16:00:50 +0000 |
commit | e0215421208d853e853f9c7b66add1e145982fbc (patch) | |
tree | f2d9d495dbe4f839f5b65a3348c0e11f8ac25d9a /install/ui/add.js | |
parent | 6cdf09812dd13531acb29f1413de87ce7cd5218f (diff) | |
download | freeipa.git-e0215421208d853e853f9c7b66add1e145982fbc.tar.gz freeipa.git-e0215421208d853e853f9c7b66add1e145982fbc.tar.xz freeipa.git-e0215421208d853e853f9c7b66add1e145982fbc.zip |
Removing sections as special type of object
Sections are changed into pure widget objects. Introduced IPA.composite_widget, basic widget for widget nesting (it's using IPA.widget_container). It's base class for section widgets.
TODO: change old custom sections into custom fields and widgets.
Note: usage of section in HBAC and SUDO is kept - whole logic will be removed in #1515 patch.
https://fedorahosted.org/freeipa/ticket/2040
Diffstat (limited to 'install/ui/add.js')
-rw-r--r-- | install/ui/add.js | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/install/ui/add.js b/install/ui/add.js index c9d5e46b..032302e3 100644 --- a/install/ui/add.js +++ b/install/ui/add.js @@ -127,31 +127,24 @@ IPA.entity_adder_dialog = function(spec) { var record = {}; that.save(record); - var sections = that.sections.values; - for (var i=0; i<sections.length; i++) { - var section = sections[i]; - - var section_fields = section.fields.values; - for (var j=0; j<section_fields.length; j++) { - var field = section_fields[j]; - - var values = record[field.name]; - if (!values) continue; - - // TODO: Handle multi-valued attributes like in detail facet's update() - var value = values.join(','); - if (!value) continue; - - if (field.name == pkey_name) { - command.add_arg(value); - } else { - command.set_option(field.name, value); - } + var fields = that.fields.get_fields(); + for (var j=0; j<fields.length; j++) { + var field = fields[j]; + + var values = record[field.name]; + if (!values) continue; + + // TODO: Handle multi-valued attributes like in detail facet's update() + var value = values.join(','); + if (!value) continue; + + if (field.name == pkey_name) { + command.add_arg(value); + } else { + command.set_option(field.name, value); } } - //alert(JSON.stringify(command.to_json())); - if (that.pre_execute_hook) { that.pre_execute_hook(command); } |