ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-13332. User Timezone setting fixes (onechiporenko)
Date Thu, 08 Oct 2015 13:49:42 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 77281dd58 -> e28dce4d5


AMBARI-13332. User Timezone setting fixes (onechiporenko)


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

Branch: refs/heads/trunk
Commit: e28dce4d502119b280ebc9c3e8071f15e2eb3284
Parents: 77281dd
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Thu Oct 8 16:47:43 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Thu Oct 8 16:47:43 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/assets/test/tests.js             |  1 +
 ambari-web/app/config.js                        |  3 +-
 ambari-web/app/controllers.js                   |  1 +
 .../step7/pre_install_checks_controller.js      | 95 ++++++++++++++++++++
 .../app/controllers/wizard/step7_controller.js  | 40 ++++++---
 ambari-web/app/messages.js                      |  7 ++
 ambari-web/app/routes/installer.js              | 47 ++++++++++
 ambari-web/app/templates/wizard/step7.hbs       |  9 +-
 .../step7/pre_install_checks_controller_test.js | 84 +++++++++++++++++
 .../test/controllers/wizard/step7_test.js       | 13 ++-
 10 files changed, 285 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 06f1d2e..dc86bcf 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -115,6 +115,7 @@ var files = [
   'test/controllers/wizard/step5_test',
   'test/controllers/wizard/step6_test',
   'test/controllers/wizard/step7_test',
+  'test/controllers/wizard/step7/pre_install_checks_controller_test',
   'test/controllers/wizard/step8_test',
   'test/controllers/wizard/step9_test',
   'test/controllers/wizard/step10_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 0a53fdf..26f0553 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -76,7 +76,8 @@ App.supports = {
   enhancedConfigs: true,
   showPageLoadTime: false,
   skipComponentStartAfterInstall: false,
-  storeKDCCredentials: false
+  storeKDCCredentials: false,
+  preInstallChecks: false
 };
 
 if (App.enableExperimental) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 33d37dc..55b68a4 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -127,6 +127,7 @@ require('controllers/wizard/step4_controller');
 require('controllers/wizard/step5_controller');
 require('controllers/wizard/step6_controller');
 require('controllers/wizard/step7_controller');
+require('controllers/wizard/step7/pre_install_checks_controller');
 require('controllers/wizard/step8_controller');
 require('controllers/wizard/step9_controller');
 require('controllers/wizard/step10_controller');

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/controllers/wizard/step7/pre_install_checks_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7/pre_install_checks_controller.js b/ambari-web/app/controllers/wizard/step7/pre_install_checks_controller.js
new file mode 100644
index 0000000..493b39e
--- /dev/null
+++ b/ambari-web/app/controllers/wizard/step7/pre_install_checks_controller.js
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+/**
+ * @class PreInstallChecksController
+ * @type {Em.Controller}
+ */
+App.PreInstallChecksController = Em.Controller.extend({
+
+  name: 'preInstallChecksController',
+
+  /**
+   * Detects when pre install checks where run
+   *
+   * @type {boolean}
+   */
+  preInstallChecksWhereRun: false,
+
+  /**
+   * Set initial settings
+   *
+   * @method loadStep
+   */
+  loadStep: function () {
+    this.set('preInstallChecksWhereRun', false);
+  },
+
+  /**
+   * Show warning-popup for user that pre install checks where not run
+   * User may skip run (primary) or execute them (secondary)
+   *
+   * @param {function} afterChecksCallback function called on primary-click
+   * @returns {App.ModalPopup}
+   * @method notRunChecksWarnPopup
+   */
+  notRunChecksWarnPopup: function (afterChecksCallback) {
+    Em.assert('`afterChecksCallback` should be a function, you have provided ' + Em.typeOf(afterChecksCallback),
'function' === Em.typeOf(afterChecksCallback));
+    var self = this;
+    return App.ModalPopup.show({
+
+      header: Em.I18n.t('installer.step7.preInstallChecks.notRunChecksWarnPopup.header'),
+      body: Em.I18n.t('installer.step7.preInstallChecks.notRunChecksWarnPopup.body'),
+      primary: Em.I18n.t('installer.step7.preInstallChecks.notRunChecksWarnPopup.primary'),
+      secondary: Em.I18n.t('installer.step7.preInstallChecks.notRunChecksWarnPopup.secondary'),
+
+      onPrimary: function () {
+        this._super();
+        afterChecksCallback();
+      },
+
+      onSecondary: function () {
+        this._super();
+        self.runPreInstallChecks();
+      }
+
+    });
+  },
+
+  /**
+   * Run pre install checks
+   *
+   * @method runPreInstallChecks
+   */
+  runPreInstallChecks: function () {
+    this.set('preInstallChecksWhereRun', true);
+    return App.ModalPopup.show({
+
+      header: Em.I18n.t('installer.step7.preInstallChecks.checksPopup.header'),
+      secondary: '',
+
+      body: Em.View.extend({
+
+      })
+
+    });
+  }
+
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index ff0e2ce..973f6c5 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -119,6 +119,14 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin,
App.E
   }.property('wizardController.stackConfigsLoaded', 'isAppliedConfigLoaded'),
 
   /**
+   * PreInstall Checks allowed only for Install
+   * @type {boolean}
+   */
+  supportsPreInstallChecks: function () {
+    return App.get('supports.preInstallChecks') && 'installerController' === this.get('content.controllerName');
+  }.property('App.supports.preInstallChecks', 'wizardController.name'),
+
+  /**
    * Number of errors in the configs in the selected service
    * @type {number}
    */
@@ -1414,22 +1422,33 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin,
App.E
    */
   submit: function () {
     if (this.get('isSubmitDisabled')) {
-      return;
+      return false;
     }
+    var preInstallChecksController = App.router.get('preInstallChecksController');
+    if (this.get('supportsPreInstallChecks')) {
+      if (preInstallChecksController.get('preInstallChecksWhereRun')) {
+        return this.postSubmit();
+      }
+      return preInstallChecksController.notRunChecksWarnPopup(this.postSubmit.bind(this));
+    }
+    return this.postSubmit();
+  },
+
+  postSubmit: function () {
     var self = this;
     this.set('submitButtonClicked', true);
     this.serverSideValidation().done(function() {
       self.serverSideValidationCallback();
     })
-    .fail(function (value) {
-      if ("invalid_configs" == value) {
-        self.set('submitButtonClicked', false);
-      } else {
-        // Failed due to validation mechanism failure.
-        // Should proceed with other checks
-        self.serverSideValidationCallback();
-      }
-    });
+      .fail(function (value) {
+        if ("invalid_configs" == value) {
+          self.set('submitButtonClicked', false);
+        } else {
+          // Failed due to validation mechanism failure.
+          // Should proceed with other checks
+          self.serverSideValidationCallback();
+        }
+      });
   },
 
   /**
@@ -1461,4 +1480,5 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin,
App.E
       }
     }
   }
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 80902ce..e4a9ba2 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -804,6 +804,13 @@ Em.I18n.translations = {
   'installer.step7.misc.notification.use_tls':'Use TLS',
   'installer.step7.misc.notification.use_ssl':'Use SSL',
 
+  'installer.step7.preInstallChecks':'Pre Install Checks',
+  'installer.step7.preInstallChecks.notRunChecksWarnPopup.header':'Skipping Pre Install Checks',
+  'installer.step7.preInstallChecks.notRunChecksWarnPopup.body':'Skipping Pre Install Checks
is not recommended.',
+  'installer.step7.preInstallChecks.notRunChecksWarnPopup.primary':'Ignore and Proceed',
+  'installer.step7.preInstallChecks.notRunChecksWarnPopup.secondary':'Run Pre Install Checks',
+  'installer.step7.preInstallChecks.checksPopup.header':'Pre Install Checks',
+
 
   'installer.step8.header': 'Review',
   'installer.step8.body': 'Please review the configuration before installation',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/routes/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js
index a88b79b..013a934 100644
--- a/ambari-web/app/routes/installer.js
+++ b/ambari-web/app/routes/installer.js
@@ -99,35 +99,42 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   step0: Em.Route.extend({
     route: '/step0',
     connectOutlets: function (router) {
+      console.time('step0 connectOutlets');
       console.log('in installer.step0:connectOutlets');
       var controller = router.get('installerController');
       controller.setCurrentStep('0');
       controller.loadAllPriorSteps().done(function () {
         controller.connectOutlet('wizardStep0', controller.get('content'));
+        console.timeEnd('step0 connectOutlets');
       });
     },
 
     next: function (router) {
+      console.time('step0 next');
       var installerController = router.get('installerController');
       installerController.save('cluster');
       App.db.setStacks(undefined);
       installerController.set('content.stacks',undefined);
       router.transitionTo('step1');
+      console.timeEnd('step0 next');
     }
   }),
 
   step1: Em.Route.extend({
     route: '/step1',
     connectOutlets: function (router) {
+      console.time('step1 connectOutlets');
       console.log('in installer.step1:connectOutlets');
       var controller = router.get('installerController');
       controller.setCurrentStep('1');
       controller.loadAllPriorSteps().done(function () {
         controller.connectOutlet('wizardStep1', controller.get('content'));
+        console.timeEnd('step1 connectOutlets');
       });
     },
     back: Em.Router.transitionTo('step0'),
     next: function (router) {
+      console.time('step1 next');
       var wizardStep1Controller = router.get('wizardStep1Controller');
       var installerController = router.get('installerController');
       installerController.validateJDKVersion(function() {
@@ -136,6 +143,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
           installerController.setStacks();
           installerController.clearInstallOptions();
           router.transitionTo('step2');
+          console.timeEnd('step1 next');
         });
       }, function() {});
     }
@@ -144,27 +152,32 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   step2: Em.Route.extend({
     route: '/step2',
     connectOutlets: function (router, context) {
+      console.time('step2 connectOutlets');
       router.setNavigationFlow('step2');
 
       var controller = router.get('installerController');
       controller.setCurrentStep('2');
       controller.loadAllPriorSteps().done(function () {
         controller.connectOutlet('wizardStep2', controller.get('content'));
+        console.timeEnd('step2 connectOutlets');
       });
     },
     back: Em.Router.transitionTo('step1'),
     next: function (router) {
+      console.time('step2 next');
       var controller = router.get('installerController');
       controller.save('installOptions');
       //hosts was saved to content.hosts inside wizardStep2Controller
       controller.save('hosts');
       router.transitionTo('step3');
+      console.timeEnd('step2 next');
     }
   }),
 
   step3: Em.Route.extend({
     route: '/step3',
     connectOutlets: function (router) {
+      console.time('step3 connectOutlets');
       console.log('in installer.step3:connectOutlets');
       var controller = router.get('installerController');
       controller.setCurrentStep('3');
@@ -172,12 +185,14 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
         var wizardStep3Controller = router.get('wizardStep3Controller');
         wizardStep3Controller.set('wizardController', controller);
         controller.connectOutlet('wizardStep3', controller.get('content'));
+        console.timeEnd('step3 connectOutlets');
       });
     },
     back: function (router) {
       router.transitionTo('step2');
     },
     next: function (router, context) {
+      console.time('step3 next');
       if (!router.transitionInProgress) {
         router.set('transitionInProgress', true);
         var installerController = router.get('installerController');
@@ -189,6 +204,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
           installedServiceNames: undefined
         });
         router.transitionTo('step4');
+        console.timeEnd('step3 next');
       }
     },
     exit: function (router) {
@@ -210,6 +226,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   step4: Em.Route.extend({
     route: '/step4',
     connectOutlets: function (router, context) {
+      console.time('step4 connectOutlets');
       router.setNavigationFlow('step4');
       var controller = router.get('installerController');
       controller.setCurrentStep('4');
@@ -217,11 +234,13 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
         var wizardStep4Controller = router.get('wizardStep4Controller');
         wizardStep4Controller.set('wizardController', controller);
         controller.connectOutlet('wizardStep4', App.StackService.find().filterProperty('isInstallable',
true));
+        console.timeEnd('step4 connectOutlets');
       });
     },
     back: Em.Router.transitionTo('step3'),
 
     next: function (router) {
+      console.time('step4 next');
       var controller = router.get('installerController');
       var wizardStep4Controller = router.get('wizardStep4Controller');
       controller.saveServices(wizardStep4Controller);
@@ -232,12 +251,14 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
         masterComponentHosts: undefined
       });
       router.transitionTo('step5');
+      console.timeEnd('step4 next');
     }
   }),
 
   step5: Em.Route.extend({
     route: '/step5',
     connectOutlets: function (router, context) {
+      console.time('step5 connectOutlets');
       router.setNavigationFlow('step5');
 
       var controller = router.get('installerController');
@@ -250,10 +271,12 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
       controller.setCurrentStep('5');
       controller.loadAllPriorSteps().done(function () {
         controller.connectOutlet('wizardStep5', controller.get('content'));
+        console.timeEnd('step5 connectOutlets');
       });
     },
     back: Em.Router.transitionTo('step4'),
     next: function (router) {
+      console.time('step5 next');
       var controller = router.get('installerController');
       var wizardStep5Controller = router.get('wizardStep5Controller');
       var wizardStep6Controller = router.get('wizardStep6Controller');
@@ -264,12 +287,14 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
       });
       wizardStep6Controller.set('isClientsSet', false);
       router.transitionTo('step6');
+      console.timeEnd('step5 next');
     }
   }),
 
   step6: Em.Route.extend({
     route: '/step6',
     connectOutlets: function (router, context) {
+      console.time('step6 connectOutlets');
       router.setNavigationFlow('step6');
 
       var controller = router.get('installerController');
@@ -277,11 +302,13 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
       controller.setCurrentStep('6');
       controller.loadAllPriorSteps().done(function () {
         controller.connectOutlet('wizardStep6', controller.get('content'));
+        console.timeEnd('step6 connectOutlets');
       });
     },
     back: Em.Router.transitionTo('step5'),
 
     next: function (router) {
+      console.time('step6 next');
       var controller = router.get('installerController');
       var wizardStep6Controller = router.get('wizardStep6Controller');
       var wizardStep7Controller = router.get('wizardStep7Controller');
@@ -298,6 +325,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
               recommendationsConfigs: null
             });
             router.transitionTo('step7');
+            console.timeEnd('step6 next');
           }
         });
       }
@@ -307,19 +335,25 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   step7: Em.Route.extend({
     route: '/step7',
     enter: function (router) {
+      console.time('step7 enter');
       console.log('in /wizardStep7Controller:enter');
       var controller = router.get('installerController');
       controller.setCurrentStep('7');
+      console.timeEnd('step7 enter');
     },
     connectOutlets: function (router, context) {
+      console.time('step7 connectOutlets');
       var controller = router.get('installerController');
+      router.get('preInstallChecksController').loadStep();
       var wizardStep7Controller = router.get('wizardStep7Controller');
       controller.loadAllPriorSteps().done(function () {
         wizardStep7Controller.set('wizardController', controller);
         controller.connectOutlet('wizardStep7', controller.get('content'));
+        console.timeEnd('step7 connectOutlets');
       });
     },
     back: function (router) {
+      console.time('step7 back');
       var step = router.get('installerController.content.skipSlavesStep') ? 'step5' : 'step6';
       var wizardStep7Controller = router.get('wizardStep7Controller');
 
@@ -332,8 +366,10 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
       } else {
         goToNextStep();
       }
+      console.timeEnd('step7 back');
     },
     next: function (router) {
+      console.time('step7 next');
       if(!router.transitionInProgress) {
         router.set('transitionInProgress', true);
         var controller = router.get('installerController');
@@ -346,6 +382,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
         }, {
           alwaysCallback: function() {
             router.transitionTo('step8');
+            console.timeEnd('step7 next');
           }
         });
       }
@@ -355,6 +392,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   step8: Em.Route.extend({
     route: '/step8',
     connectOutlets: function (router, context) {
+      console.time('step8 connectOutlets');
       console.log('in installer.step8:connectOutlets');
       var controller = router.get('installerController');
       controller.setCurrentStep('8');
@@ -362,10 +400,12 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
         var wizardStep8Controller = router.get('wizardStep8Controller');
         wizardStep8Controller.set('wizardController', controller);
         controller.connectOutlet('wizardStep8', controller.get('content'));
+        console.timeEnd('step8 connectOutlets');
       });
     },
     back: Em.Router.transitionTo('step7'),
     next: function (router) {
+      console.time('step8 next');
       if (!router.transitionInProgress) {
         router.set('transitionInProgress', true);
         var installerController = router.get('installerController');
@@ -377,6 +417,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
           installerController.saveClusterState('CLUSTER_INSTALLING_3');
           wizardStep8Controller.set('servicesInstalled', true);
           router.transitionTo('step9');
+          console.timeEnd('step8 next');
         });
       }
     }
@@ -385,6 +426,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   step9: Em.Route.extend({
     route: '/step9',
     connectOutlets: function (router, context) {
+      console.time('step9 connectOutlets');
       console.log('in installer.step9:connectOutlets');
       var controller = router.get('installerController'),
           wizardStep9Controller = router.get('wizardStep9Controller');
@@ -396,11 +438,13 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
           }
           wizardStep9Controller.set('wizardController', controller);
           controller.connectOutlet('wizardStep9', controller.get('content'));
+          console.timeEnd('step9 connectOutlets');
         });
       });
     },
     back: Em.Router.transitionTo('step8'),
     retry: function (router) {
+      console.time('step9 retry');
       var installerController = router.get('installerController');
       var wizardStep9Controller = router.get('wizardStep9Controller');
       if (wizardStep9Controller.get('showRetry')) {
@@ -416,6 +460,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
         } else {
           wizardStep9Controller.navigateStep();
         }
+        console.timeEnd('step9 retry');
       }
     },
     unroutePath: function (router, context) {
@@ -428,6 +473,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
       }
     },
     next: function (router) {
+      console.time('step9 next');
       if(!router.transitionInProgress) {
         router.set('transitionInProgress', true);
         var installerController = router.get('installerController');
@@ -435,6 +481,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
         installerController.saveInstalledHosts(wizardStep9Controller);
         installerController.saveClusterState('CLUSTER_INSTALLED_4');
         router.transitionTo('step10');
+        console.timeEnd('step9 next');
       }
     }
   }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/app/templates/wizard/step7.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step7.hbs b/ambari-web/app/templates/wizard/step7.hbs
index ad723d2..130f6cf 100644
--- a/ambari-web/app/templates/wizard/step7.hbs
+++ b/ambari-web/app/templates/wizard/step7.hbs
@@ -32,7 +32,12 @@
 
   <div class="btn-area">
     <a class="btn installer-back-btn" {{action back}}>&larr; {{t common.back}}</a>
-    <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}}
-      {{action submit target="controller"}}>{{t common.next}} &rarr;</a>
+    <div class="pull-right">
+      {{#if App.supports.preInstallChecks}}
+        <a class="btn" {{action runPreInstallChecks target="App.router.preInstallChecksController"}}
{{bindAttr disabled="isSubmitDisabled"}}><i class="icon-exclamation"></i> {{t
installer.step7.preInstallChecks}}</a>
+      {{/if}}
+      <a class="btn btn-success" {{bindAttr disabled="isSubmitDisabled"}}
+        {{action submit target="controller"}}>{{t common.next}} &rarr;</a>
+    </div>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/test/controllers/wizard/step7/pre_install_checks_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7/pre_install_checks_controller_test.js
b/ambari-web/test/controllers/wizard/step7/pre_install_checks_controller_test.js
new file mode 100644
index 0000000..a3fba1c
--- /dev/null
+++ b/ambari-web/test/controllers/wizard/step7/pre_install_checks_controller_test.js
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+var preInstallChecksController;
+
+describe('App.PreInstallChecksController', function () {
+
+  beforeEach(function () {
+    preInstallChecksController = App.PreInstallChecksController.create();
+  });
+
+  describe('#loadStep', function () {
+
+    beforeEach(function () {
+      preInstallChecksController.set('preInstallChecksWhereRun', true);
+    });
+
+    it('should set `preInstallChecksWhereRun` to false', function () {
+      preInstallChecksController.loadStep();
+      expect(preInstallChecksController.get('preInstallChecksWhereRun')).to.be.false;
+    });
+
+  });
+
+  describe('#runPreInstallChecks', function () {
+
+    it('should set `preInstallChecksWhereRun` to true', function () {
+      preInstallChecksController.runPreInstallChecks();
+      expect(preInstallChecksController.get('preInstallChecksWhereRun')).to.be.true;
+    });
+
+  });
+
+  describe('#notRunChecksWarnPopup', function () {
+
+    it('should throw error', function () {
+      expect(function () {
+        preInstallChecksController.notRunChecksWarnPopup()
+      }).to.throw('`afterChecksCallback` should be a function');
+    });
+
+    describe('popup', function () {
+
+      var popup;
+
+      beforeEach(function () {
+        popup = preInstallChecksController.notRunChecksWarnPopup(Em.K);
+        sinon.spy(preInstallChecksController, 'runPreInstallChecks');
+      });
+
+      afterEach(function () {
+        preInstallChecksController.runPreInstallChecks.restore();
+      });
+
+      it('#onPrimary', function (done) {
+        preInstallChecksController.notRunChecksWarnPopup(done).onPrimary();
+      });
+
+      it('#onSecondary', function () {
+        popup.onSecondary();
+        expect(preInstallChecksController.runPreInstallChecks.calledOnce).to.be.true;
+      });
+
+    });
+
+  });
+
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e28dce4d/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index f59398f..4be0891 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -324,9 +324,18 @@ describe('App.InstallerStep7Controller', function () {
   });
 
   describe('#submit', function () {
-    it('should return undefined if submit disabled', function () {
+
+    beforeEach(function () {
+      sinon.stub(App, 'get').withArgs('supports.preInstallChecks').returns(false);
+    });
+
+    afterEach(function () {
+      App.get.restore();
+    });
+
+    it('should return false if submit disabled', function () {
       installerStep7Controller.set('isSubmitDisabled',true);
-      expect(installerStep7Controller.submit()).to.be.undefined;
+      expect(installerStep7Controller.submit()).to.be.false;
     });
     it('sumbit button should be unclicked if no configs', function () {
       installerStep7Controller.set('isSubmitDisabled',false);


Mime
View raw message