summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-10-26 18:21:11 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-10-27 15:03:33 +0000
commit916d08719b355bec6b8be5e8dd702883037c5eec (patch)
treef0d4780654887631ea5dcf0c8e2d993599e3593d /install
parenta486f49a3726934f99763cc6ae93a41dafc40deb (diff)
downloadfreeipa-916d08719b355bec6b8be5e8dd702883037c5eec.tar.gz
freeipa-916d08719b355bec6b8be5e8dd702883037c5eec.tar.xz
freeipa-916d08719b355bec6b8be5e8dd702883037c5eec.zip
Fixed inconsistent details facet validation.
The details facet validation has been moved out of update() such that all subclasses perform consistent validation. Ticket #1455
Diffstat (limited to 'install')
-rw-r--r--install/ui/details.js25
-rw-r--r--install/ui/dns.js5
-rw-r--r--install/ui/hbac.js5
-rw-r--r--install/ui/sudo.js5
4 files changed, 25 insertions, 15 deletions
diff --git a/install/ui/details.js b/install/ui/details.js
index 022b005bc..98f48d0f9 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -374,7 +374,7 @@ IPA.details_facet = function(spec) {
icon: 'reset-icon',
'class': 'details-reset action-button-disabled',
click: function() {
- if(!that.update_button.hasClass('action-button-disabled')) {
+ if (!that.update_button.hasClass('action-button-disabled')) {
that.reset();
}
return false;
@@ -387,9 +387,19 @@ IPA.details_facet = function(spec) {
icon: 'update-icon',
'class': 'details-update action-button-disabled',
click: function() {
- if(!that.update_button.hasClass('action-button-disabled')) {
- that.update();
+ if (that.update_button.hasClass('action-button-disabled')) return false;
+
+ if (!that.validate()) {
+ var dialog = IPA.message_dialog({
+ title: IPA.messages.dialogs.validation_title,
+ message: IPA.messages.dialogs.validation_message
+ });
+ dialog.open();
+ return false;
}
+
+ that.update();
+
return false;
}
}).appendTo(that.controls);
@@ -628,15 +638,6 @@ IPA.details_facet = function(spec) {
on_error: on_error
});
- if (!that.validate()) {
- var dialog = IPA.message_dialog({
- title: IPA.messages.dialogs.validation_title,
- message: IPA.messages.dialogs.validation_message
- });
- dialog.open();
- return;
- }
-
var record = {};
that.save(record);
diff --git a/install/ui/dns.js b/install/ui/dns.js
index a73d4b205..4dbf3e0d2 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -168,6 +168,9 @@ IPA.dnszone_details_facet = function(spec) {
})
};
+ var record = {};
+ that.save(record);
+
var sections = that.sections.values;
for (var i=0; i<sections.length; i++) {
var section = sections[i];
@@ -177,7 +180,7 @@ IPA.dnszone_details_facet = function(spec) {
var field = section_fields[j];
if (!field.is_dirty()) continue;
- var values = field.save();
+ var values = record[field.name];
if (!values) continue;
var metadata = field.metadata;
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index b5c223614..e8c106ac7 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -440,6 +440,9 @@ IPA.hbacrule_details_facet = function(spec) {
})
};
+ var record = {};
+ that.save(record);
+
var sections = that.sections.values;
for (var i=0; i<sections.length; i++) {
var section = sections[i];
@@ -451,7 +454,7 @@ IPA.hbacrule_details_facet = function(spec) {
// association tables are never dirty, so call
// is_dirty() after checking table values
- var values = field.save();
+ var values = record[field.name];
if (!values) continue;
var metadata = field.metadata;
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index f2dd646ed..3c581387e 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -389,6 +389,9 @@ IPA.sudorule_details_facet = function(spec) {
})
};
+ var record = {};
+ that.save(record);
+
var sections = that.sections.values;
for (var i=0; i<sections.length; i++) {
var section = sections[i];
@@ -400,7 +403,7 @@ IPA.sudorule_details_facet = function(spec) {
// association tables are never dirty, so call
// is_dirty() after checking table values
- var values = field.save();
+ var values = record[field.name];
if (!values) continue;
var metadata = field.metadata;