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/widget.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'install/ui/widget.js') diff --git a/install/ui/widget.js b/install/ui/widget.js index 5438c815..4a02cb7d 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; }; -- cgit