From 916d08719b355bec6b8be5e8dd702883037c5eec Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 26 Oct 2011 18:21:11 -0500 Subject: Fixed inconsistent details facet validation. The details facet validation has been moved out of update() such that all subclasses perform consistent validation. Ticket #1455 --- install/ui/details.js | 25 +++++++++++++------------ install/ui/dns.js | 5 ++++- install/ui/hbac.js | 5 ++++- install/ui/sudo.js | 5 ++++- 4 files changed, 25 insertions(+), 15 deletions(-) (limited to 'install/ui') 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