ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
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 GMT
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 <akovalenko@hortonworks.com>
Authored: Wed Mar 25 14:10:26 2015 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
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('<a href="#" {{action "clearFilter" target="view"}}
class="ui-icon ui-icon-circle-close"></a> {{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
       }
     ];
 


Mime
View raw message