Repository: ambari Updated Branches: refs/heads/trunk 938fed1f3 -> bc28cd782
AMBARI-20415. JS error when filtering config history table (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bc28cd78 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bc28cd78 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bc28cd78 Branch: refs/heads/trunk Commit: bc28cd782d1d7cd92c693e3a4884b0ea66ef3484 Parents: 938fed1 Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Mon Mar 13 13:38:22 2017 +0200 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Mon Mar 13 16:40:38 2017 +0200 ---------------------------------------------------------------------- ambari-web/app/mixins/common/table_server_view_mixin.js | 6 ++++++ ambari-web/app/views/main/dashboard/config_history_view.js | 4 ++++ ambari-web/test/mixins/common/table_server_view_mixin_test.js | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/bc28cd78/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 d44a09e..a4e6db7 100644 --- a/ambari-web/app/mixins/common/table_server_view_mixin.js +++ b/ambari-web/app/mixins/common/table_server_view_mixin.js @@ -149,6 +149,12 @@ App.TableServerViewMixin = Em.Mixin.create({ this.refresh(); } }, + + /** + * Placeholder for `saveStartIndex` + */ + saveStartIndex: Em.K, + /** * when new filter applied page index should be reset to first page */ http://git-wip-us.apache.org/repos/asf/ambari/blob/bc28cd78/ambari-web/app/views/main/dashboard/config_history_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/config_history_view.js b/ambari-web/app/views/main/dashboard/config_history_view.js index 7bd9e4a..0acf556 100644 --- a/ambari-web/app/views/main/dashboard/config_history_view.js +++ b/ambari-web/app/views/main/dashboard/config_history_view.js @@ -231,6 +231,10 @@ App.MainConfigHistoryView = App.TableView.extend(App.TableServerViewMixin, { App.loadTimer.finish('Config History Page'); }, + saveStartIndex: function() { + App.db.setStartIndex(this.get('controller.name'), this.get('startIndex')); + }.observes('startIndex'), + /** * associations between host property and column index * @type {Array} http://git-wip-us.apache.org/repos/asf/ambari/blob/bc28cd78/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 ae750de..4c9db12 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 @@ -28,7 +28,6 @@ describe('App.MainConfigHistoryView', function() { filteredContent: [], refresh: Em.K, saveFilterConditions: Em.K, - saveStartIndex: sinon.spy(), controller: Em.Object.create({ name: 'mainConfigHistoryController', paginationProps: [ @@ -212,8 +211,10 @@ describe('App.MainConfigHistoryView', function() { describe('#resetStartIndex()', function() { beforeEach(function () { sinon.stub(view, 'updatePagination'); + sinon.spy(view, 'saveStartIndex'); }); afterEach(function () { + view.saveStartIndex.restore(); view.updatePagination.restore(); }); it('resetStartIndex is false and filteredCount is 0', function() {