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-21299 Service widgets don't remove old data of metrics. (atkach)
Date Thu, 22 Jun 2017 11:24:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 965e4bd0f -> 5fc8ccc96


AMBARI-21299 Service widgets don't remove old data of metrics. (atkach)


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

Branch: refs/heads/trunk
Commit: 5fc8ccc9655e702c20f0a4ff569610afe5d08f45
Parents: 965e4bd
Author: Andrii Tkach <atkach@apache.org>
Authored: Wed Jun 21 20:59:33 2017 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Thu Jun 22 14:24:23 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/mixins/common/widgets/widget_mixin.js | 3 ++-
 ambari-web/test/mixins/common/widget_mixin_test.js   | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc8ccc9/ambari-web/app/mixins/common/widgets/widget_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index 23df0c4..e20fe7e 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -84,7 +84,6 @@ App.WidgetMixin = Ember.Mixin.create({
   contentColor: Em.computed.ifThenElse('value', 'green', 'grey'),
 
   beforeRender: function () {
-    this.get('metrics').clear();
     this.loadMetrics();
   },
 
@@ -98,6 +97,8 @@ App.WidgetMixin = Ember.Mixin.create({
       requestCounter = 0,
       self = this;
 
+    this.set('metrics', []);
+
     for (var i in requestData) {
       request = requestData[i];
       requestCounter++;

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc8ccc9/ambari-web/test/mixins/common/widget_mixin_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/widget_mixin_test.js b/ambari-web/test/mixins/common/widget_mixin_test.js
index fe972f9..48c7c3b 100644
--- a/ambari-web/test/mixins/common/widget_mixin_test.js
+++ b/ambari-web/test/mixins/common/widget_mixin_test.js
@@ -281,6 +281,7 @@ describe('App.WidgetMixin', function () {
     cases.forEach(function (item) {
       describe(item.title, function () {
         beforeEach(function() {
+          sinon.stub(mixinObject, 'loadMetrics');
           mixinObject.setProperties({
             isExportButtonHidden: false,
             childViews: item.childViews,
@@ -306,6 +307,7 @@ describe('App.WidgetMixin', function () {
         });
 
         afterEach(function() {
+          mixinObject.loadMetrics.restore();
           graph._showMessage.restore();
         });
 


Mime
View raw message