mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Added IP address validator to Host and DNS record adder dialog
Also fixed minor issues reagarding IP addresses or multivalued field: - removed unnecessary method overrides from multivalued_field - fixed extract_child_value method in multivalued_widget to return '' instead of empty arrays when value array is empty - net.js - changed method name and error message from 'trailing zeros' to 'leading zeros' https://fedorahosted.org/freeipa/ticket/1466
This commit is contained in:
committed by
Endi S. Dewata
parent
05345ce8c8
commit
74857a8ee4
@@ -406,8 +406,15 @@ IPA.multivalued_text_widget = function(spec) {
|
||||
|
||||
that.extract_child_value = function(value) {
|
||||
|
||||
if (value.length) return value[0];
|
||||
if (value instanceof Array) {
|
||||
if (value.length > 0) {
|
||||
return value[0];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
if (value) return value;
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
@@ -851,7 +858,14 @@ IPA.select_widget = function(spec) {
|
||||
};
|
||||
|
||||
that.save = function() {
|
||||
var value = that.select.val() || '';
|
||||
var value;
|
||||
|
||||
if (that.select) {
|
||||
value = that.select.val() || '';
|
||||
} else if (that.options.length > 0) {
|
||||
value = that.options[0].value; //will be default value
|
||||
}
|
||||
|
||||
return [value];
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user