ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [2/3] ambari git commit: AMBARI-12496. Invalid Metrics Monitor issue message after page refresh on step 3 of Add Service Wizard (alexantonenko)
Date Wed, 22 Jul 2015 14:02:28 GMT
AMBARI-12496. Invalid Metrics Monitor issue message after page refresh on step 3 of Add Service
Wizard (alexantonenko)


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

Branch: refs/heads/trunk
Commit: c3017b90f12894916128b31ffdce6516d3be8beb
Parents: 2605a84
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Wed Jul 22 14:39:51 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Wed Jul 22 17:02:22 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/installer.js            |  4 ----
 .../app/controllers/main/service/add_controller.js |  1 +
 ambari-web/app/controllers/wizard.js               |  4 ++++
 ambari-web/app/routes/add_service_routes.js        |  2 ++
 ambari-web/test/controllers/wizard_test.js         | 17 +++++++++++++++++
 5 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c3017b90/ambari-web/app/controllers/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js
index a311e99..932da04 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -441,10 +441,6 @@ App.InstallerController = App.WizardController.extend({
     this.set("content.masterComponentHosts", masterComponentHosts);
   },
 
-  loadRecommendations: function () {
-    this.set("content.recommendations", this.getDBProperty('recommendations'));
-  },
-
   loadCurrentHostGroups: function () {
     this.set("content.recommendationsHostGroups", this.getDBProperty('recommendationsHostGroups'));
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3017b90/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js
index 777775d..79d3e87 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -88,6 +88,7 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs,
{
           this.loadHosts().done(function () {
             self.loadMasterComponentHosts();
             self.load('hosts');
+            self.loadRecommendations();
             dfd.resolve();
           });
           return dfd.promise();

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3017b90/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 4cc0c1e..33982f3 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -1317,5 +1317,9 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
   loadRequestIds: function() {
     var requestIds = this.getDBProperty('requestIds');
     this.set('content.requestIds', requestIds);
+  },
+
+  loadRecommendations: function () {
+    this.set("content.recommendations", this.getDBProperty('recommendations'));
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3017b90/ambari-web/app/routes/add_service_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js
index b908288..6f9a6a7 100644
--- a/ambari-web/app/routes/add_service_routes.js
+++ b/ambari-web/app/routes/add_service_routes.js
@@ -131,6 +131,7 @@ module.exports = App.WizardRoute.extend({
 
       var wizardStep5Controller = router.get('wizardStep5Controller');
       wizardStep5Controller.clearRecommendations(); // Force reload recommendation between
steps 1 and 2
+      addServiceController.setDBProperty('recommendations', undefined);
       router.transitionTo('step2');
     }
   }),
@@ -158,6 +159,7 @@ module.exports = App.WizardRoute.extend({
       var wizardStep6Controller = router.get('wizardStep6Controller');
       addServiceController.saveMasterComponentHosts(wizardStep5Controller);
       addServiceController.setDBProperty('slaveComponentHosts', undefined);
+      addServiceController.setDBProperty('recommendations', wizardStep5Controller.get('content.recommendations'));
       wizardStep6Controller.set('isClientsSet', false);
       router.transitionTo('step3');
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3017b90/ambari-web/test/controllers/wizard_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard_test.js b/ambari-web/test/controllers/wizard_test.js
index a3ce6f2..9ac1005 100644
--- a/ambari-web/test/controllers/wizard_test.js
+++ b/ambari-web/test/controllers/wizard_test.js
@@ -1481,5 +1481,22 @@ describe('App.WizardController', function () {
 
   });
 
+  describe('#loadRecommendations', function () {
+
+    beforeEach(function () {
+      sinon.stub(c, 'getDBProperty').returns({});
+    });
+
+    afterEach(function () {
+      c.getDBProperty.restore();
+    });
+
+    it('should set recommendations', function () {
+      c.set('content', {});
+      c.loadRecommendations();
+      expect(c.get('content.recommendations')).to.eql({});
+    });
+
+  });
 
 });


Mime
View raw message