diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-09-10 11:54:02 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-09-23 13:13:10 +0000 |
commit | 390d017e321fd5ed56af094cf1f1c74f64e95735 (patch) | |
tree | ea90b38f292170059dd757f59ef6b757c5b9b5a5 /install/ui/automount.js | |
parent | a90e50cdf759a1b436381f0e9e91caf2d4288636 (diff) | |
download | freeipa-390d017e321fd5ed56af094cf1f1c74f64e95735.tar.gz freeipa-390d017e321fd5ed56af094cf1f1c74f64e95735.tar.xz freeipa-390d017e321fd5ed56af094cf1f1c74f64e95735.zip |
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
Diffstat (limited to 'install/ui/automount.js')
-rw-r--r-- | install/ui/automount.js | 106 |
1 files changed, 61 insertions, 45 deletions
diff --git a/install/ui/automount.js b/install/ui/automount.js index eeff8a048..8be2b6574 100644 --- a/install/ui/automount.js +++ b/install/ui/automount.js @@ -36,25 +36,26 @@ IPA.entity_factories.automountlocation = function() { }). nested_search_facet({ facet_group: 'automountmap', - nested_entity : 'automountmap', - label : IPA.metadata.objects.automountmap.label, + nested_entity: 'automountmap', + label: IPA.metadata.objects.automountmap.label, name: 'maps', - columns:['automountmapname'] + columns: [ 'automountmapname' ] }). details_facet({ sections:[ { - name:'identity', + name: 'identity', label: IPA.messages.details.identity, - fields:['cn'] + fields: [ 'cn' ] } ] }). adder_dialog({ - fields:['cn'] + fields: [ 'cn' ] }). build(); }; + IPA.entity_factories.automountmap = function() { return IPA.entity_builder(). entity({ name: 'automountmap' }). @@ -62,63 +63,78 @@ IPA.entity_factories.automountmap = function() { facet_groups([ 'automountkey', 'settings' ]). nested_search_facet({ facet_group: 'automountkey', - nested_entity : 'automountkey', - label : IPA.metadata.objects.automountkey.label, + nested_entity: 'automountkey', + label: IPA.metadata.objects.automountkey.label, name: 'keys', get_values: IPA.get_option_values, - columns:[ + columns: [ { factory: IPA.automount_key_column, - name:'automountkey', - label:IPA.get_entity_param('automountkey', 'automountkey'). - label + name: 'automountkey', + label: IPA.get_entity_param('automountkey', 'automountkey').label }, - 'automountinformation'] + 'automountinformation' + ] }). details_facet({ - sections:[ + sections: [ { - name:'identity', + name: 'identity', label: IPA.messages.details.identity, - fields:['automountmapname','description'] + fields: [ 'automountmapname', 'description' ] } ] }). adder_dialog({ factory: IPA.automountmap_adder_dialog, - fields: [ + sections: [ { - factory: IPA.radio_widget, - name: 'method', - undo: false, - label: IPA.messages.objects.automountmap.map_type, - options: [ + name: 'general', + fields: [ { - value: 'add', - label: IPA.messages.objects.automountmap.direct + factory: IPA.radio_widget, + name: 'method', + label: IPA.messages.objects.automountmap.map_type, + options: [ + { + value: 'add', + label: IPA.messages.objects.automountmap.direct + }, + { + value: 'add_indirect', + label: IPA.messages.objects.automountmap.indirect + } + ], + undo: false }, { - value: 'add_indirect', - label: IPA.messages.objects.automountmap.indirect + name: 'automountmapname', + undo: false + }, + { + name: 'description', + undo: false } ] }, - 'automountmapname', - 'description', - { - name: 'key', - label: IPA.get_method_option( - 'automountmap_add_indirect', 'key').label, - conditional: true, - undo: false - }, { - name: 'parentmap', - label: IPA.get_method_option( - 'automountmap_add_indirect', 'parentmap').label, - conditional: true, - undo: false - }] + name: 'indirect', + fields: [ + { + name: 'key', + label: IPA.get_method_option( + 'automountmap_add_indirect', 'key').label, + undo: false + }, + { + name: 'parentmap', + label: IPA.get_method_option( + 'automountmap_add_indirect', 'parentmap').label, + undo: false + } + ] + } + ] }). build(); }; @@ -202,7 +218,6 @@ IPA.automount_key_column = function(spec){ return that; }; - IPA.automountmap_adder_dialog = function(spec) { var that = IPA.add_dialog(spec); @@ -214,12 +229,14 @@ IPA.automountmap_adder_dialog = function(spec) { var direct_input = $('input[value="add"]', method_field.container); direct_input.change(function() { - that.disable_conditional_fields(); + that.method = 'add'; + that.get_section('indirect').set_visible(false); }); var indirect_input = $('input[value="add_indirect"]', method_field.container); indirect_input.change(function() { - that.enable_conditional_fields(); + that.method = 'add_indirect'; + that.get_section('indirect').set_visible(true); }); direct_input.click(); @@ -237,7 +254,6 @@ IPA.automountmap_adder_dialog = function(spec) { return that; }; - IPA.get_option_values = function(){ var values = []; |