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/08/10 13:02:46 UTC
ambari git commit: AMBARI-12687. Incorrect behavior of paging on
Alerts page (akovalenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 34e96e247 -> 6f8206cdb
AMBARI-12687. Incorrect behavior of paging on Alerts page (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6f8206cd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6f8206cd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6f8206cd
Branch: refs/heads/trunk
Commit: 6f8206cdb03d26bd8855e534ab05ef7327239088
Parents: 34e96e2
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Aug 10 13:24:12 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Aug 10 13:24:12 2015 +0300
----------------------------------------------------------------------
ambari-web/app/views/main/alert_definitions_view.js | 15 ---------------
.../test/views/main/alert_definitions_view_test.js | 10 +++-------
2 files changed, 3 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/6f8206cd/ambari-web/app/views/main/alert_definitions_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/alert_definitions_view.js b/ambari-web/app/views/main/alert_definitions_view.js
index dceaaf1..e93a45e 100644
--- a/ambari-web/app/views/main/alert_definitions_view.js
+++ b/ambari-web/app/views/main/alert_definitions_view.js
@@ -32,22 +32,7 @@ App.MainAlertDefinitionsView = App.TableView.extend({
willInsertElement: function () {
if (!this.get('controller.showFilterConditionsFirstLoad')) {
this.clearFilterCondition();
- this.clearStartIndex();
}
- this.removeObserver('filteredCount', this, 'updatePaging');
- this.removeObserver('displayLength', this, 'updatePaging');
- var startIndex = App.db.getStartIndex(this.get('controller.name'));
- this._super();
- this.set('startIndex', startIndex ? startIndex : 1);
- this.addObserver('filteredCount', this, 'updatePaging');
- this.addObserver('displayLength', this, 'updatePaging');
- },
-
- /**
- * Method is same as in the parentView, but observes are set in the <code>willInsertElement</code>
- * and not in the declaration
- */
- updatePaging: function () {
this._super();
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/6f8206cd/ambari-web/test/views/main/alert_definitions_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/alert_definitions_view_test.js b/ambari-web/test/views/main/alert_definitions_view_test.js
index b9796d1..0e8773c 100644
--- a/ambari-web/test/views/main/alert_definitions_view_test.js
+++ b/ambari-web/test/views/main/alert_definitions_view_test.js
@@ -41,26 +41,22 @@ describe('App.MainAlertDefinitionsView', function () {
beforeEach(function(){
sinon.stub(view, 'clearFilterCondition', Em.K);
- sinon.stub(view, 'clearStartIndex', Em.K);
});
afterEach(function(){
view.clearFilterCondition.restore();
- view.clearStartIndex.restore();
});
- it('should call clearFilterCondition, clearStartIndex if controller.showFilterConditionsFirstLoad is false', function () {
+ it('should call clearFilterCondition if controller.showFilterConditionsFirstLoad is false', function () {
view.set('controller', {showFilterConditionsFirstLoad: false, content: []});
view.willInsertElement();
expect(view.clearFilterCondition.calledOnce).to.be.true;
- expect(view.clearStartIndex.calledOnce).to.be.true;
});
- it('should not call clearFilterCondition, clearStartIndex if controller.showFilterConditionsFirstLoad is true', function () {
+ it('should not call clearFilterCondition if controller.showFilterConditionsFirstLoad is true', function () {
view.set('controller', {showFilterConditionsFirstLoad: true, content: []});
view.willInsertElement();
- expect(view.clearFilterCondition.called).to.be.false;
- expect(view.clearStartIndex.called).to.be.false;
+ expect(view.clearFilterCondition.calledOnce).to.be.false;
});
});