Repository: ambari Updated Branches: refs/heads/trunk 6eda8c66a -> 5c48015d6
AMBARI-7402 Incorrect behavior of filtering by custom date on Config History tab. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5c48015d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5c48015d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5c48015d Branch: refs/heads/trunk Commit: 5c48015d6b62e3052b2555fefc0cc4604c74a88a Parents: 6eda8c6 Author: aBabiichuk <ababiic...@cybervisiontech.com> Authored: Fri Sep 19 13:36:18 2014 +0300 Committer: aBabiichuk <ababiic...@cybervisiontech.com> Committed: Fri Sep 19 13:36:35 2014 +0300 ---------------------------------------------------------------------- ambari-web/app/views/common/filter_view.js | 8 +++++++- ambari-web/app/views/main/dashboard/config_history_view.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/5c48015d/ambari-web/app/views/common/filter_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/filter_view.js b/ambari-web/app/views/common/filter_view.js index 93c2d90..f279fd3 100644 --- a/ambari-web/app/views/common/filter_view.js +++ b/ambari-web/app/views/common/filter_view.js @@ -495,7 +495,13 @@ module.exports = { break; case 'range': return function (origin, compareValue){ - //TODO add filter by range value + if (compareValue[1] && compareValue[0]) { + return origin >= compareValue[0] && origin <= compareValue[1]; + } else if (compareValue[0]){ + return origin >= compareValue[0]; + } else if (compareValue[1]) { + return origin <= compareValue[1] + } return true; }; break; http://git-wip-us.apache.org/repos/asf/ambari/blob/5c48015d/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 436451e..792e31f 100644 --- a/ambari-web/app/views/main/dashboard/config_history_view.js +++ b/ambari-web/app/views/main/dashboard/config_history_view.js @@ -155,8 +155,8 @@ App.MainConfigHistoryView = App.TableView.extend({ startTimeBinding: "controller.modifiedFilter.actualValues.startTime", endTimeBinding: "controller.modifiedFilter.actualValues.endTime", onTimeChange: function () { - this.get('parentView').updateFilter(this.get('column'), [this.get('startTime'), this.get('endTime')], 'range'); - }.observes('startTime') + this.get('parentView').updateFilter(this.get('column'), [this.get('controller.modifiedFilter.actualValues.startTime'), this.get('controller.modifiedFilter.actualValues.endTime')], 'range'); + }.observes('controller.modifiedFilter.actualValues.startTime', 'controller.modifiedFilter.actualValues.endTime') }), authorFilterView: filters.createTextView({