ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [1/2] git commit: AMBARI-7031 FE: Next button not enabled when only /validation ERRORs are there
Date Wed, 27 Aug 2014 11:41:25 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 926acf4fc -> 8d8583bd5


AMBARI-7031 FE: Next button not enabled when only /validation ERRORs are there


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4430ebf0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4430ebf0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4430ebf0

Branch: refs/heads/trunk
Commit: 4430ebf070ddef99bcb5ba610e13d5f39f5cd910
Parents: 926acf4
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Wed Aug 27 14:32:45 2014 +0300
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Wed Aug 27 14:34:22 2014 +0300

----------------------------------------------------------------------
 .../app/controllers/main/service/info/configs.js   |  4 +++-
 ambari-web/app/mixins/common/serverValidator.js    | 17 +++++------------
 2 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4430ebf0/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index dce4c35..8eee9cb 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1095,11 +1095,13 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
           App.showConfirmationPopup(function () {
             self.saveConfigs();
           }, Em.I18n.t('services.service.config.confirmDirectoryChange').format(displayName),
function () {
-            self.set('isApplyingChanges', false)
+            self.set('isApplyingChanges', false);
           });
         } else {
           self.saveConfigs();
         }
+      }).fail(function() {
+        self.set('isApplyingChanges', false);
       });
     } else {
       status = 'started';

http://git-wip-us.apache.org/repos/asf/ambari/blob/4430ebf0/ambari-web/app/mixins/common/serverValidator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/serverValidator.js b/ambari-web/app/mixins/common/serverValidator.js
index 462ff62..3a1dbed 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -236,8 +236,8 @@ App.ServerValidatorMixin = Em.Mixin.create({
               if ((property.get('filename') == item['config-type'] + '.xml') && (property.get('name')
== item['config-name'])) {
                 if (item.level == "ERROR") {
                   self.set('configValidationError', true);
-                  property.set('errorMessage', item.message);
-                  property.set('error', true);
+                  property.set('warnMessage', item.message);
+                  property.set('warn', true);
                 } else if (item.level == "WARN") {
                   self.set('configValidationWarning', true);
                   property.set('warnMessage', item.message);
@@ -264,21 +264,14 @@ App.ServerValidatorMixin = Em.Mixin.create({
    * @returns {*}
    */
   warnUser: function(deferred) {
-    var self = this;
     if (this.get('configValidationFailed')) {
-      this.set('isSubmitDisabled', false);
-      this.set("isApplyingChanges", false);
       deferred.reject();
       return App.showAlertPopup(Em.I18n.t('installer.step7.popup.validation.failed.header'),
Em.I18n.t('installer.step7.popup.validation.request.failed.body'));
     } else if (this.get('configValidationWarning') || this.get('configValidationError'))
{
       // Motivation: for server-side validation warnings and EVEN errors allow user to continue
wizard
-      this.set('isSubmitDisabled', true);
-      this.set("isApplyingChanges", false);
-      return App.showConfirmationPopup(function () {
-        self.set('isSubmitDisabled', false);
-        self.set("isApplyingChanges", true);
-        deferred.resolve();
-      }, Em.I18n.t('installer.step7.popup.validation.warning.body'));
+      return App.showConfirmationPopup(function () { deferred.resolve(); },
+          Em.I18n.t('installer.step7.popup.validation.warning.body'),
+          function () { deferred.reject(); });
     } else {
       deferred.resolve();
     }


Mime
View raw message