You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2017/02/09 18:07:37 UTC

ambari git commit: AMBARI-19942 Unexpected paging behavior on Hosts page. (atkach)

Repository: ambari
Updated Branches:
  refs/heads/trunk dbb356774 -> 00e18721e


AMBARI-19942 Unexpected paging behavior on Hosts page. (atkach)


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

Branch: refs/heads/trunk
Commit: 00e18721ee47ae227e848bf4e68d3e8a4a2c40e3
Parents: dbb3567
Author: Andrii Tkach <at...@apache.org>
Authored: Thu Feb 9 18:22:27 2017 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Thu Feb 9 20:07:14 2017 +0200

----------------------------------------------------------------------
 ambari-web/app/views/main/host.js       |  1 +
 ambari-web/test/views/main/host_test.js | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/00e18721/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index 9183f6b..8959dde 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -174,6 +174,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
     }
     this._super();
     this.set('startIndex', this.get('controller.startIndex'));
+    this.set('displayLength', this.get('controller.paginationProps').findProperty('name', 'displayLength').value);
     this.addObserver('pageContent.@each.selected', this, this.selectedHostsObserver);
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/00e18721/ambari-web/test/views/main/host_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/host_test.js b/ambari-web/test/views/main/host_test.js
index 50279e6..a5fce45 100644
--- a/ambari-web/test/views/main/host_test.js
+++ b/ambari-web/test/views/main/host_test.js
@@ -29,7 +29,14 @@ function getView() {
         },
         updateHost: Em.K
       }),
-      name: 'ctrl1'
+      name: 'ctrl1',
+      startIndex: 1,
+      paginationProps: [
+        {
+          name: 'displayLength',
+          value: 100
+        }
+      ]
     })
   });
 }
@@ -344,11 +351,15 @@ describe('App.MainHostView', function () {
     beforeEach(function() {
       sinon.stub(view, 'clearFilterConditionsFromLocalStorage').returns(true);
       sinon.stub(view, 'addObserver');
+      sinon.stub(view, 'saveStartIndex');
+      sinon.stub(view, 'updatePaging');
     });
 
     afterEach(function() {
       view.clearFilterConditionsFromLocalStorage.restore();
       view.addObserver.restore();
+      view.saveStartIndex.restore();
+      view.updatePaging.restore();
     });
 
     it("filterChangeHappened should be true", function() {
@@ -363,6 +374,11 @@ describe('App.MainHostView', function () {
       expect(view.get('startIndex')).to.be.equal(10);
     });
 
+    it("displayLength should be 10", function() {
+      view.willInsertElement();
+      expect(view.get('displayLength')).to.be.equal(100);
+    });
+
     it("addObserver should be called", function() {
       view.willInsertElement();
       expect(view.addObserver.calledWith('pageContent.@each.selected', view, view.selectedHostsObserver)).to.be.true;