ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-14469 Upgrade Wizard popup displayed over login page. (atkach)
Date Tue, 22 Dec 2015 15:43:20 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e82d8f233 -> e7b17583b


AMBARI-14469 Upgrade Wizard popup displayed over login page. (atkach)


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

Branch: refs/heads/trunk
Commit: e7b17583b4c718026b507a4c9c4eb65bd3097cf4
Parents: e82d8f2
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Tue Dec 22 17:18:09 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Tue Dec 22 17:18:09 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/routes/add_host_routes.js      | 107 +++++++++++----------
 ambari-web/app/routes/stack_upgrade_routes.js |  92 +++++++++---------
 2 files changed, 101 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e7b17583/ambari-web/app/routes/add_host_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_host_routes.js b/ambari-web/app/routes/add_host_routes.js
index e302096..8a4641e 100644
--- a/ambari-web/app/routes/add_host_routes.js
+++ b/ambari-web/app/routes/add_host_routes.js
@@ -43,63 +43,64 @@ module.exports = App.WizardRoute.extend({
 
   enter: function (router) {
     var self = this;
+    router.get('mainController').dataLoading().done(function () {
+      Ember.run.next(function () {
+        var addHostController = router.get('addHostController');
+        App.router.get('updateController').set('isWorking', false);
+        App.ModalPopup.show({
+          classNames: ['full-width-modal'],
+          header: Em.I18n.t('hosts.add.header'),
+          bodyClass: App.AddHostView.extend({
+            controllerBinding: 'App.router.addHostController'
+          }),
+          primary: Em.I18n.t('form.cancel'),
+          secondary: null,
+          showFooter: false,
 
-    Ember.run.next(function () {
-      var addHostController = router.get('addHostController');
-      App.router.get('updateController').set('isWorking', false);
-      App.ModalPopup.show({
-        classNames: ['full-width-modal'],
-        header: Em.I18n.t('hosts.add.header'),
-        bodyClass: App.AddHostView.extend({
-          controllerBinding: 'App.router.addHostController'
-        }),
-        primary: Em.I18n.t('form.cancel'),
-        secondary: null,
-        showFooter: false,
-
-        onPrimary: function () {
-          this.hide();
-          App.router.get('updateController').set('isWorking', true);
-          router.transitionTo('hosts.index');
-        },
-        onClose: function () {
-          var popupContext = this;
-          if (addHostController.get('currentStep') == '6') {
-            App.ModalPopup.show({
-              header: Em.I18n.t('hosts.add.exit.header'),
-              body: Em.I18n.t('hosts.add.exit.body'),
-              onPrimary: function () {
-                self.leaveWizard(router, popupContext);
-              }
-            });
-          } else {
-            self.leaveWizard(router, this);
+          onPrimary: function () {
+            this.hide();
+            App.router.get('updateController').set('isWorking', true);
+            router.transitionTo('hosts.index');
+          },
+          onClose: function () {
+            var popupContext = this;
+            if (addHostController.get('currentStep') == '6') {
+              App.ModalPopup.show({
+                header: Em.I18n.t('hosts.add.exit.header'),
+                body: Em.I18n.t('hosts.add.exit.body'),
+                onPrimary: function () {
+                  self.leaveWizard(router, popupContext);
+                }
+              });
+            } else {
+              self.leaveWizard(router, this);
+            }
+          },
+          didInsertElement: function () {
+            this.fitHeight();
+          }
+        });
+        var currentClusterStatus = App.clusterStatus.get('value');
+        if (currentClusterStatus) {
+          switch (currentClusterStatus.clusterState) {
+            case 'ADD_HOSTS_DEPLOY_PREP_2' :
+              addHostController.setCurrentStep('4');
+              break;
+            case 'ADD_HOSTS_INSTALLING_3' :
+            case 'SERVICE_STARTING_3' :
+              addHostController.setCurrentStep('5');
+              break;
+            case 'ADD_HOSTS_INSTALLED_4' :
+              addHostController.setCurrentStep('6');
+              break;
+            default:
+              break;
           }
-        },
-        didInsertElement: function () {
-          this.fitHeight();
-        }
-      });
-      var currentClusterStatus = App.clusterStatus.get('value');
-      if (currentClusterStatus) {
-        switch (currentClusterStatus.clusterState) {
-          case 'ADD_HOSTS_DEPLOY_PREP_2' :
-            addHostController.setCurrentStep('4');
-            break;
-          case 'ADD_HOSTS_INSTALLING_3' :
-          case 'SERVICE_STARTING_3' :
-            addHostController.setCurrentStep('5');
-            break;
-          case 'ADD_HOSTS_INSTALLED_4' :
-            addHostController.setCurrentStep('6');
-            break;
-          default:
-            break;
         }
-      }
 
-      App.router.get('wizardWatcherController').setUser(addHostController.get('name'));
-      router.transitionTo('step' + addHostController.get('currentStep'));
+        App.router.get('wizardWatcherController').setUser(addHostController.get('name'));
+        router.transitionTo('step' + addHostController.get('currentStep'));
+      });
     });
 
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/e7b17583/ambari-web/app/routes/stack_upgrade_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/stack_upgrade_routes.js b/ambari-web/app/routes/stack_upgrade_routes.js
index 5332e5f..b10a89b 100644
--- a/ambari-web/app/routes/stack_upgrade_routes.js
+++ b/ambari-web/app/routes/stack_upgrade_routes.js
@@ -22,55 +22,57 @@ module.exports = App.WizardRoute.extend({
   route: 'stack/upgrade',
 
   enter: function (router) {
-    Ember.run.next(function () {
-      //if upgrade id is absent then upgrade is completed
-      if (Em.isNone(App.db.get('MainAdminStackAndUpgrade', 'upgradeId'))) {
-        router.transitionTo('main.admin.stackAndUpgrade.versions');
-        return null;
-      }
+    router.get('mainController').dataLoading().done(function () {
+      Ember.run.next(function () {
+        //if upgrade id is absent then upgrade is completed
+        if (Em.isNone(App.db.get('MainAdminStackAndUpgrade', 'upgradeId'))) {
+          router.transitionTo('main.admin.stackAndUpgrade.versions');
+          return null;
+        }
 
-      App.router.get('updateController').set('isWorking', false);
+        App.router.get('updateController').set('isWorking', false);
 
-      return App.ModalPopup.show({
-        classNames: ['full-width-modal'],
-        header: function () {
-          var controller = App.router.get('mainAdminStackAndUpgradeController');
-          if (controller.get('isDowngrade')) {
-            return Em.I18n.t('admin.stackUpgrade.dialog.downgrade.header').format(controller.get('upgradeVersion'));
-          } else {
-            return Em.I18n.t('admin.stackUpgrade.dialog.header').format(controller.get('upgradeTypeDisplayName'),
controller.get('upgradeVersion'));
-          }
-        }.property('App.router.mainAdminStackAndUpgradeController.upgradeVersion', 'App.router.mainAdminStackAndUpgradeController.isDowngrade'),
-        bodyClass: App.upgradeWizardView,
-        primary: Em.I18n.t('common.dismiss'),
-        secondary: null,
-        didInsertElement: function () {
-          this.fitHeight();
-          this.fitInnerHeight();
-        },
+        return App.ModalPopup.show({
+          classNames: ['full-width-modal'],
+          header: function () {
+            var controller = App.router.get('mainAdminStackAndUpgradeController');
+            if (controller.get('isDowngrade')) {
+              return Em.I18n.t('admin.stackUpgrade.dialog.downgrade.header').format(controller.get('upgradeVersion'));
+            } else {
+              return Em.I18n.t('admin.stackUpgrade.dialog.header').format(controller.get('upgradeTypeDisplayName'),
controller.get('upgradeVersion'));
+            }
+          }.property('App.router.mainAdminStackAndUpgradeController.upgradeVersion', 'App.router.mainAdminStackAndUpgradeController.isDowngrade'),
+          bodyClass: App.upgradeWizardView,
+          primary: Em.I18n.t('common.dismiss'),
+          secondary: null,
+          didInsertElement: function () {
+            this.fitHeight();
+            this.fitInnerHeight();
+          },
 
-        /**
-         * fir height of scrollable block inside of modal body
-         */
-        fitInnerHeight: function () {
-          var block = this.$().find('#modal > .modal-body');
-          var scrollable = this.$().find('#modal .scrollable-block');
+          /**
+           * fir height of scrollable block inside of modal body
+           */
+          fitInnerHeight: function () {
+            var block = this.$().find('#modal > .modal-body');
+            var scrollable = this.$().find('#modal .scrollable-block');
 
-          scrollable.css('max-height', Number(block.css('max-height').slice(0, -2)) - block.height());
-          block.css('max-height', 'none');
-        },
-        onPrimary: function () {
-          this.closeWizard();
-        },
-        onClose: function () {
-          this.closeWizard();
-        },
-        closeWizard: function () {
-          App.router.get('updateController').set('isWorking', true);
-          App.router.transitionTo('main.admin.stackAndUpgrade.versions');
-          this.hide();
-          location.reload();
-        }
+            scrollable.css('max-height', Number(block.css('max-height').slice(0, -2)) - block.height());
+            block.css('max-height', 'none');
+          },
+          onPrimary: function () {
+            this.closeWizard();
+          },
+          onClose: function () {
+            this.closeWizard();
+          },
+          closeWizard: function () {
+            App.router.get('updateController').set('isWorking', true);
+            App.router.transitionTo('main.admin.stackAndUpgrade.versions');
+            this.hide();
+            location.reload();
+          }
+        });
       });
     });
   }


Mime
View raw message