Browse Source

AMBARI-1141. In some cases, clicking "Register and Confirm" button does not do anything. (Arun Kandregula via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431822 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
1103bc9392

+ 3 - 0
CHANGES.txt

@@ -674,6 +674,9 @@ AMBARI-666 branch (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+
+  AMBARI-1141. In some cases, clicking "Register and Confirm" button does
+  not do anything. (Arun Kandregula via yusaku)
  
   AMBARI-1140. Resuming deploy for Installer/Add Hosts does not work if the
   browser is shut down during the start phase of deploy.

+ 14 - 0
ambari-web/app/controllers/wizard.js

@@ -526,6 +526,20 @@ App.WizardController = Em.Controller.extend({
       }, this);
     }
     this.set('content.slaveGroupProperties', groupConfigProperties);
+  },
+
+  registerErrPopup: function (header, message) {
+    App.ModalPopup.show({
+      header: header,
+      secondary: false,
+      onPrimary: function () {
+        this.hide();
+      },
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
+        message: message
+      })
+    });
   }
 
 })

+ 4 - 1
ambari-web/app/controllers/wizard/step2_controller.js

@@ -216,7 +216,10 @@ App.WizardStep2Controller = Em.Controller.extend({
     }
 
     var requestId = App.router.get(this.get('content.controllerName')).launchBootstrap(bootStrapData);
-    if(requestId) {
+    if (requestId == '0') {
+      var controller = App.router.get(App.clusterStatus.wizardControllerName);
+      controller.registerErrPopup('Information', 'Host Registration is currently in progress.  Please try again later.');
+    } else if (requestId) {
       this.set('content.installOptions.bootRequestId', requestId);
       this.saveHosts();
     }

+ 2 - 16
ambari-web/app/controllers/wizard/step8_controller.js

@@ -1436,21 +1436,6 @@ App.WizardStep8Controller = Em.Controller.extend({
 
   },
 
-  registerErrPopup: function (header, message) {
-
-    App.ModalPopup.show({
-      header: header,
-      secondary: false,
-      onPrimary: function () {
-        this.hide();
-      },
-      bodyClass: Ember.View.extend({
-        template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
-        message: message
-      })
-    });
-  },
-
   /**
    * We need to do a lot of ajax calls(about 10 or more) async in special order.
    * To do this i generate array of ajax objects and then send requests step by step.
@@ -1493,7 +1478,8 @@ App.WizardStep8Controller = Em.Controller.extend({
 
     params.error = function (xhr, status, error) {
       var responseText = JSON.parse(xhr.responseText);
-      self.registerErrPopup("Error", responseText.message);
+      var controller = App.router.get(App.clusterStatus.wizardControllerName);
+      controller.registerErrPopup("Error", responseText.message);
       self.set('isSubmitDisabled', true);
       self.set('hasErrorOccurred', true);
     }

+ 2 - 0
ambari-web/app/routes/installer.js

@@ -25,6 +25,8 @@ module.exports = Em.Route.extend({
   enter: function (router) {
     console.log('in /installer:enter');
 
+    App.clusterStatus.set('wizardControllerName',App.router.get('installerController.name'));
+
     if (router.getAuthenticated()) {
       var name = 'Cluster Install Wizard';
       $('title').text('Ambari - ' + name);