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-13811 Typing fast in 'name' filter field of the Hosts table misses trailing character. (atkach)
Date Tue, 10 Nov 2015 13:49:15 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 968e9379e -> 5f0832925


AMBARI-13811 Typing fast in 'name' filter field of the Hosts table misses trailing character.
(atkach)


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

Branch: refs/heads/branch-2.1
Commit: 5f0832925b1e851ca6962318ec82078a802e7be7
Parents: 968e937
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Tue Nov 10 15:46:31 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Tue Nov 10 15:46:31 2015 +0200

----------------------------------------------------------------------
 .../app/mixins/common/table_server_view_mixin.js  |  4 ++--
 .../mixins/common/table_server_view_mixin_test.js | 18 +++++++++++++++++-
 .../main/dashboard/config_history_view_test.js    |  1 +
 3 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5f083292/ambari-web/app/mixins/common/table_server_view_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/table_server_view_mixin.js b/ambari-web/app/mixins/common/table_server_view_mixin.js
index 339f28a..b1dabb2 100644
--- a/ambari-web/app/mixins/common/table_server_view_mixin.js
+++ b/ambari-web/app/mixins/common/table_server_view_mixin.js
@@ -80,7 +80,6 @@ App.TableServerViewMixin = Em.Mixin.create({
 
     var self = this;
     this.set('controller.resetStartIndex', false);
-    this.saveFilterConditions(iColumn, value, type, false);
     if (!this.get('filteringComplete')) {
       clearTimeout(this.get('timeOut'));
       this.set('timeOut', setTimeout(function () {
@@ -89,6 +88,8 @@ App.TableServerViewMixin = Em.Mixin.create({
     } else {
       clearTimeout(this.get('timeOut'));
       this.set('controller.resetStartIndex', true);
+      //save filter only when it's applied
+      this.saveFilterConditions(iColumn, value, type, false);
       this.refresh();
     }
   },
@@ -120,7 +121,6 @@ App.TableServerViewMixin = Em.Mixin.create({
    * success callback for updater request
    */
   updaterSuccessCb: function () {
-    clearTimeout(this.get('timeOut'));
     this.set('filteringComplete', true);
     this.propertyDidChange('pageContent');
     App.loadTimer.finish('Hosts Page');

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f083292/ambari-web/test/mixins/common/table_server_view_mixin_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/table_server_view_mixin_test.js b/ambari-web/test/mixins/common/table_server_view_mixin_test.js
index 4944a7b..b7b8236 100644
--- a/ambari-web/test/mixins/common/table_server_view_mixin_test.js
+++ b/ambari-web/test/mixins/common/table_server_view_mixin_test.js
@@ -149,7 +149,7 @@ describe('App.MainConfigHistoryView', function() {
       view.set('filteringComplete', false);
       view.updateFilter(1, '1', 'string');
       expect(view.get('controller.resetStartIndex')).to.be.false;
-      expect(view.saveFilterConditions.calledWith(1, '1', 'string', false)).to.be.true;
+      expect(view.saveFilterConditions.called).to.be.false;
       view.set('filteringComplete', true);
       this.clock.tick(view.get('filterWaitingTime'));
       expect(view.updateFilter.calledWith(1, '1', 'string')).to.be.true;
@@ -160,6 +160,7 @@ describe('App.MainConfigHistoryView', function() {
 
       view.updateFilter(1, '1', 'string');
       expect(view.get('controller.resetStartIndex')).to.be.true;
+      expect(view.saveFilterConditions.calledWith(1, '1', 'string', false)).to.be.true;
       expect(view.refresh.calledOnce).to.be.true;
     });
 
@@ -212,4 +213,19 @@ describe('App.MainConfigHistoryView', function() {
       expect(view.get('startIndex')).to.equal(1);
     });
   });
+
+  describe("#updaterSuccessCb()", function () {
+    beforeEach(function () {
+      sinon.stub(view, 'propertyDidChange');
+    });
+    afterEach(function () {
+      view.propertyDidChange.restore();
+    });
+    it("", function () {
+      view.set('filteringComplete', false);
+      view.updaterSuccessCb();
+      expect(view.propertyDidChange.calledWith('pageContent')).to.be.true;
+      expect(view.get('filteringComplete')).to.be.true;
+    });
+  });
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f083292/ambari-web/test/views/main/dashboard/config_history_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/dashboard/config_history_view_test.js b/ambari-web/test/views/main/dashboard/config_history_view_test.js
index 3372ca5..76ad4bd 100644
--- a/ambari-web/test/views/main/dashboard/config_history_view_test.js
+++ b/ambari-web/test/views/main/dashboard/config_history_view_test.js
@@ -256,6 +256,7 @@ describe('App.MainConfigHistoryView', function() {
     ];
     beforeEach(function () {
       sinon.stub(view, 'saveFilterConditions', Em.K);
+      view.set('filteringComplete', true);
     });
     afterEach(function () {
       view.saveFilterConditions.restore();


Mime
View raw message