ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-8236. Service Summary: Alerts and Health Checks shows no alerts under certain circumstances. (atkach via yusaku)
Date Sun, 09 Nov 2014 15:49:47 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 750aa57db -> 71eb72ebd


AMBARI-8236. Service Summary: Alerts and Health Checks shows no alerts under certain circumstances.
(atkach via yusaku)


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

Branch: refs/heads/branch-1.7.0
Commit: 71eb72ebd9a16c1b6e5e5a4f427dcb299bd7f25d
Parents: 750aa57
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Sun Nov 9 07:48:43 2014 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Sun Nov 9 07:48:43 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/views/main/service/info/summary.js  |  4 +++-
 .../test/views/main/service/info/summary_test.js   | 17 +++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/71eb72eb/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index b70147b..08ef48c 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -93,7 +93,9 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   /**
    * observes changes to alerts collection
    */
-  observeAlerts: function () {
+  observeAlerts: function (view, property) {
+    //alerts should be inserted only in build-in DOM view
+    if (view.state !== "inDOM") return;
     var newAlerts = this.get('alertsController.alerts'),
       currentAlerts = this.get('alerts'),
       alertsMap;

http://git-wip-us.apache.org/repos/asf/ambari/blob/71eb72eb/ambari-web/test/views/main/service/info/summary_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/info/summary_test.js b/ambari-web/test/views/main/service/info/summary_test.js
index e29e532..f64ee18 100644
--- a/ambari-web/test/views/main/service/info/summary_test.js
+++ b/ambari-web/test/views/main/service/info/summary_test.js
@@ -127,11 +127,12 @@ describe('App.MainServiceInfoSummaryView', function() {
   });
 
   describe("#observeAlerts()", function() {
+    var mock = {state: 'inDOM'};
     it("No alerts loaded", function() {
       var alerts = [];
       view.set('alertsController.alerts', []);
-      view.set('alerts', alerts)
-      view.observeAlerts();
+      view.set('alerts', alerts);
+      view.observeAlerts(mock);
 
       expect(alerts).to.be.empty;
       expect(view.get('alertsMap')).to.be.empty;
@@ -141,8 +142,8 @@ describe('App.MainServiceInfoSummaryView', function() {
       view.set('alertsController.alerts', [{
         id: 1
       }]);
-      view.set('alerts', alerts)
-      view.observeAlerts();
+      view.set('alerts', alerts);
+      view.observeAlerts(mock);
 
       expect(alerts[0]).to.be.eql({
         "id": 1
@@ -155,9 +156,9 @@ describe('App.MainServiceInfoSummaryView', function() {
     it("No new alerts", function() {
       var alerts = [{id: 1}];
       view.set('alertsController.alerts', []);
-      view.set('alerts', alerts)
+      view.set('alerts', alerts);
       view.set('alertsMap', {'1': {id: '1'}});
-      view.observeAlerts();
+      view.observeAlerts(mock);
 
       expect(alerts).to.be.empty;
       expect(view.get('alertsMap')).to.be.empty;
@@ -173,9 +174,9 @@ describe('App.MainServiceInfoSummaryView', function() {
       view.set('alertsController.alerts', [{
         id: 1
       }]);
-      view.set('alerts', alerts)
+      view.set('alerts', alerts);
       view.set('alertsMap', {'1': {id: '1'}});
-      view.observeAlerts();
+      view.observeAlerts(mock);
 
       expect(view.updateAlerts.calledWith(
         [{


Mime
View raw message