You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2015/10/23 20:09:37 UTC

ambari git commit: AMBARI-13546. Flume graph popups are closing only from second time. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 0c1d4b928 -> e4404a19a


AMBARI-13546. Flume graph popups are closing only from second time. (akovalenko)


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

Branch: refs/heads/trunk
Commit: e4404a19a77b42ce8df37a267147339b9a8fe25a
Parents: 0c1d4b9
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Fri Oct 23 20:59:30 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Fri Oct 23 21:08:54 2015 +0300

----------------------------------------------------------------------
 .../app/views/common/chart/linear_time.js       |  6 ++---
 .../test/views/common/chart/linear_time_test.js | 25 ++++++++++++--------
 2 files changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e4404a19/ambari-web/app/views/common/chart/linear_time.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js
index f6e71a3..96ce4cb 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -830,8 +830,7 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
 
       onPrimary: function () {
         self.setProperties({
-          currentTimeIndex: self.get('controller.isServiceWithEnhancedWidgets') === false ?
-            self.get('parentView.currentTimeRangeIndex') : self.get('parentView.parentView.currentTimeRangeIndex'),
+          currentTimeIndex: !Em.isNone(self.get('parentView.currentTimeRangeIndex')) ? self.get('parentView.currentTimeRangeIndex') : self.get('parentView.parentView.currentTimeRangeIndex'),
           isPopup: false
         });
         this._super();
@@ -898,8 +897,7 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
   // should be set by time range control dropdown list when create current graph
   currentTimeIndex: 0,
   setCurrentTimeIndexFromParent: function () {
-    var index = this.get('controller.isServiceWithEnhancedWidgets') === false ?
-      this.get('parentView.currentTimeRangeIndex') : this.get('parentView.parentView.currentTimeRangeIndex');
+    var index = !Em.isNone(this.get('parentView.currentTimeRangeIndex')) ? this.get('parentView.currentTimeRangeIndex') : this.get('parentView.parentView.currentTimeRangeIndex');
     this.set('currentTimeIndex', index);
   }.observes('parentView.parentView.currentTimeRangeIndex', 'parentView.currentTimeRangeIndex'),
   timeUnitSeconds: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e4404a19/ambari-web/test/views/common/chart/linear_time_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/chart/linear_time_test.js b/ambari-web/test/views/common/chart/linear_time_test.js
index 0d4b200..b8475e8 100644
--- a/ambari-web/test/views/common/chart/linear_time_test.js
+++ b/ambari-web/test/views/common/chart/linear_time_test.js
@@ -229,18 +229,22 @@ describe('App.ChartLinearTimeView', function () {
     var view,
       cases = [
       {
-        isServiceWithEnhancedWidgets: false,
-        currentTimeIndex: 1,
-        title: 'service with enhanced widgets'
+        parent: 1,
+        child: 2,
+        result: 2,
+        title: 'child and parent have currentTimeRangeIndex'
       },
       {
-        isServiceWithEnhancedWidgets: true,
-        currentTimeIndex: 2,
-        title: 'service without enhanced widgets'
+        parent: undefined,
+        child: 2,
+        result: 2,
+        title: 'only child has currentTimeRangeIndex'
       },
       {
-        currentTimeIndex: 2,
-        title: 'other view'
+        parent: 1,
+        child: undefined,
+        result: 1,
+        title: 'only parent has currentTimeRangeIndex'
       }
     ];
 
@@ -258,9 +262,10 @@ describe('App.ChartLinearTimeView', function () {
 
     cases.forEach(function (item) {
       it(item.title, function () {
-        view.set('controller.isServiceWithEnhancedWidgets', item.isServiceWithEnhancedWidgets);
+        view.set('parentView.currentTimeRangeIndex', item.child);
+        view.set('parentView.parentView.currentTimeRangeIndex', item.parent);
         view.propertyDidChange('parentView.currentTimeRangeIndex');
-        expect(view.get('currentTimeIndex')).to.equal(item.currentTimeIndex);
+        expect(view.get('currentTimeIndex')).to.equal(item.result);
       });
     });