mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user