Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C547417832 for ; Wed, 25 Mar 2015 12:41:16 +0000 (UTC) Received: (qmail 18822 invoked by uid 500); 25 Mar 2015 12:41:16 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 18797 invoked by uid 500); 25 Mar 2015 12:41:16 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 18788 invoked by uid 99); 25 Mar 2015 12:41:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2015 12:41:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 553A6E18E4; Wed, 25 Mar 2015 12:41:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akovalenko@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-10199. RU: Config History table: text filters not working after typing '?' character. (akovalenko) Date: Wed, 25 Mar 2015 12:41:16 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk f73936a28 -> f5594591e AMBARI-10199. RU: Config History table: text filters not working after typing '?' character. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f5594591 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f5594591 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f5594591 Branch: refs/heads/trunk Commit: f5594591ebcd4f872002c004c787a75616ec19d4 Parents: f73936a Author: Aleksandr Kovalenko Authored: Wed Mar 25 14:10:26 2015 +0200 Committer: Aleksandr Kovalenko Committed: Wed Mar 25 14:10:26 2015 +0200 ---------------------------------------------------------------------- ambari-web/app/views/common/filter_view.js | 10 ++++++++-- .../app/views/main/dashboard/config_history_view.js | 4 +++- ambari-web/test/mappers/stack_service_mapper_test.js | 3 --- ambari-web/test/views/common/filter_view_test.js | 5 +++++ 4 files changed, 16 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f5594591/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 2145254..f1f18d8 100644 --- a/ambari-web/app/views/common/filter_view.js +++ b/ambari-web/app/views/common/filter_view.js @@ -28,6 +28,8 @@ var App = require('app'); +var validator = require('utils/validator'); + var wrapperView = Ember.View.extend({ classNames: ['view-wrapper'], layout: Ember.Handlebars.compile(' {{yield}}'), @@ -639,8 +641,12 @@ module.exports = { case 'string': default: return function (origin, compareValue) { - var regex = new RegExp(compareValue, "i"); - return regex.test(origin); + if (validator.isValidMatchesRegexp(compareValue)) { + var regex = new RegExp(compareValue, "i"); + return regex.test(origin); + } else { + return false; + } } } } http://git-wip-us.apache.org/repos/asf/ambari/blob/f5594591/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 0e4d788..19c4233 100644 --- a/ambari-web/app/views/main/dashboard/config_history_view.js +++ b/ambari-web/app/views/main/dashboard/config_history_view.js @@ -205,5 +205,7 @@ App.MainConfigHistoryView = App.TableView.extend(App.TableServerViewMixin, { */ colPropAssoc: function () { return this.get('controller.colPropAssoc'); - }.property('controller.colPropAssoc') + }.property('controller.colPropAssoc'), + + filter: Em.K }); http://git-wip-us.apache.org/repos/asf/ambari/blob/f5594591/ambari-web/test/mappers/stack_service_mapper_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/mappers/stack_service_mapper_test.js b/ambari-web/test/mappers/stack_service_mapper_test.js index 7a390d5..1b6ccfa 100644 --- a/ambari-web/test/mappers/stack_service_mapper_test.js +++ b/ambari-web/test/mappers/stack_service_mapper_test.js @@ -206,9 +206,6 @@ describe('App.stackServiceMapper', function () { App.stackServiceMapper.clearStackModels(); }); - afterEach(function () { - }); - it('should sort and map data about services with their components', function () { App.stackServiceMapper.map(data); var services = App.StackService.find(), http://git-wip-us.apache.org/repos/asf/ambari/blob/f5594591/ambari-web/test/views/common/filter_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/common/filter_view_test.js b/ambari-web/test/views/common/filter_view_test.js index e5ca1ad..1afd844 100644 --- a/ambari-web/test/views/common/filter_view_test.js +++ b/ambari-web/test/views/common/filter_view_test.js @@ -379,6 +379,11 @@ describe('filters.getFilterByType', function () { condition: 'hello', value: '', result: false + }, + { + condition: '?', + value: 'hello', + result: false } ];