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/widget.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/widget.js')
-rw-r--r-- | install/ui/widget.js | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js index 5438c8157..4a02cb7d8 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -40,7 +40,6 @@ IPA.widget = function(spec) { that.disabled = spec.disabled; that.hidden = spec.hidden; - that.conditional = spec.conditional; that.optional = spec.optional || false; // read_only is set when widget is created @@ -65,8 +64,8 @@ IPA.widget = function(spec) { that.dirty_changed = IPA.observer(); - function set_param_info(){ - if (!that.param_info && that.entity){ + function set_param_info() { + if (!that.param_info && that.entity) { that.param_info = IPA.get_entity_param(that.entity.name, that.name); } @@ -88,7 +87,7 @@ IPA.widget = function(spec) { if (!value.match(/^-?\d+$/)) { that.valid = false; that.show_error(IPA.messages.widget.validation.integer); - return; + return that.valid; } if (meta.minvalue !== undefined && value < meta.minvalue) { @@ -96,7 +95,7 @@ IPA.widget = function(spec) { message = IPA.messages.widget.validation.min_value; message = message.replace('${value}', meta.minvalue); that.show_error(message); - return; + return that.valid; } if (meta.maxvalue !== undefined && value > meta.maxvalue) { @@ -104,7 +103,7 @@ IPA.widget = function(spec) { message = IPA.messages.widget.validation.max_value; message = message.replace('${value}', meta.maxvalue); that.show_error(message); - return; + return that.valid; } } if (meta.pattern) { @@ -112,11 +111,13 @@ IPA.widget = function(spec) { if (!value.match(regex)) { that.valid = false; that.show_error(meta.pattern_errmsg); - return; + return that.valid; } } + return that.valid; } + that.create_error_link = function(container){ container.append(' '); @@ -153,22 +154,25 @@ IPA.widget = function(spec) { var values = that.save(); if (!values) { - return; + return that.valid; } if (values.length === 0) { - return; + return that.valid; } var value = values[0]; if (!value) { - return; + return that.valid; } if (that.metadata) { - meta_validate(that.metadata,value); + meta_validate(that.metadata, value); } - if (that.param_info) { - meta_validate(that.param_info,value); + + if (that.valid && that.param_info) { + meta_validate(that.param_info, value); } + + return that.valid; }; |