This is an automated email from the ASF dual-hosted git repository.

ababiichuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new effd430  AMBARI-24221 Add Service Wizard: Next Button is not enabled 
while adding Ranger after fixing an erroneous property. (ababiichuk)
effd430 is described below

commit effd430630d247285175952bd34bbb76d9410975
Author: ababiichuk <ababiic...@hortonworks.com>
AuthorDate: Fri Jun 29 16:21:44 2018 +0300

    AMBARI-24221 Add Service Wizard: Next Button is not enabled while adding 
Ranger after fixing an erroneous property. (ababiichuk)
---
 .../app/controllers/wizard/step7_controller.js     | 35 +++++++++++++---------
 ambari-web/test/controllers/wizard/step7_test.js   |  4 +++
 2 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index 0a8e5b2..abb4a23 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -100,9 +100,13 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
    * Is installer controller used
    * @type {bool}
    */
-  isInstallWizard: function () {
-    return this.get('content.controllerName') === 'installerController';
-  }.property('content.controllerName'),
+  isInstallWizard: Em.computed.equal('content.controllerName', 
'installerController'),
+
+  /**
+   * Is add service controller used
+   * @type {bool}
+   */
+  isAddServiceWizard: Em.computed.equal('content.controllerName', 
'addServiceController'),
 
   /**
    * List of config groups
@@ -168,7 +172,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
    * @type {boolean}
    */
   supportsPreInstallChecks: function () {
-    return App.get('supports.preInstallChecks') && 'installerController' === 
this.get('content.controllerName');
+    return App.get('supports.preInstallChecks') && this.get('isInstallWizard');
   }.property('App.supports.preInstallChecks', 'wizardController.name'),
 
   /**
@@ -218,7 +222,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
    */
   installedServiceNames: function () {
     var serviceNames = 
this.get('content.services').filterProperty('isInstalled').mapProperty('serviceName');
-    if (this.get('content.controllerName') !== 'installerController') {
+    if (!this.get('isInstallWizard')) {
       serviceNames = serviceNames.filter(function (_serviceName) {
         return !App.get('services.noConfigTypes').contains(_serviceName);
       });
@@ -610,7 +614,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
     this.updateConfigAttributesFromThemes();
     this.checkHostOverrideInstaller();
     this.selectProperService();
-    var isInstallerWizard = (this.get("content.controllerName") === 
'installerController');
+    var isInstallerWizard = this.get('isInstallWizard');
     var isRangerServiceAbsent =  rangerService && 
!rangerService.get('isInstalled') && !rangerService.get('isSelected');
     if (isRangerServiceAbsent) {
       var isExternalRangerSetup;
@@ -1630,11 +1634,11 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
               this.hide();
               parent.hide();
               // go back to step 5: assign masters and disable default 
navigation warning
-              if ('installerController' === 
self.get('content.controllerName')) {
+              if (self.get('isInstallWizard')) {
                 App.router.get('installerController').gotoStep(5, true);
               }
               else {
-                if ('addServiceController' === 
self.get('content.controllerName')) {
+                if (self.get('isAddServiceWizard')) {
                   App.router.get('addServiceController').gotoStep(2, true);
                 }
               }
@@ -1801,21 +1805,24 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
   },
 
   postSubmit: function () {
-    var self = this;
     this.set('submitButtonClicked', true);
     if (this.get('isInstallWizard')) {
       this.serverSideValidationCallback();
     } else {
-      this.serverSideValidation().done(function () {
-        self.serverSideValidationCallback();
-      }).fail(function (value) {
+      this.serverSideValidation().done(() => {
+        this.serverSideValidationCallback();
+      }).fail(value => {
         if ("invalid_configs" === value) {
-          self.set('submitButtonClicked', false);
+          if (this.get('isAddServiceWizard')) {
+            this.get('configErrorList.issues').clear();
+            this.get('configErrorList.criticalIssues').clear();
+          }
+          this.set('submitButtonClicked', false);
           App.set('router.nextBtnClickInProgress', false);
         } else {
           // Failed due to validation mechanism failure.
           // Should proceed with other checks
-          self.serverSideValidationCallback();
+          this.serverSideValidationCallback();
         }
       });
     }
diff --git a/ambari-web/test/controllers/wizard/step7_test.js 
b/ambari-web/test/controllers/wizard/step7_test.js
index 302d8de..f308002 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -2105,4 +2105,8 @@ describe('App.InstallerStep7Controller', function () {
 
   });
 
+  App.TestAliases.testAsComputedEqual(installerStep7Controller, 
'isInstallWizard', 'content.controllerName', 'installerController');
+
+  App.TestAliases.testAsComputedEqual(installerStep7Controller, 
'isAddServiceWizard', 'content.controllerName', 'addServiceController');
+
 });

Reply via email to