ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-7657. Slider View: No items are displayed in Apps table after Clear Filters action. (Max Shepel via akovalenko)
Date Mon, 06 Oct 2014 18:29:00 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 94d76a414 -> af9ceed0f


AMBARI-7657. Slider View: No items are displayed in Apps table after Clear Filters action.
(Max Shepel via akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/af9ceed0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/af9ceed0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/af9ceed0

Branch: refs/heads/trunk
Commit: af9ceed0f62ea58813207c04cc45a72f224b508c
Parents: 94d76a4
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Oct 6 21:22:57 2014 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Oct 6 21:22:57 2014 +0300

----------------------------------------------------------------------
 .../ui/app/views/common/filter_view.js          |  2 +-
 .../resources/ui/app/views/common/table_view.js |  2 +-
 .../resources/ui/app/views/slider_apps_view.js  |  3 +-
 .../ui/test/unit/views/slider_apps_view_test.js | 37 ++++++++++++++++++++
 4 files changed, 41 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/af9ceed0/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js b/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
index 2d357e3..64f2413 100644
--- a/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
+++ b/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
@@ -271,7 +271,7 @@ module.exports = {
       attributeBindings: ['disabled','multiple'],
       disabled: false
     });
-    config.emptyValue = Em.I18n.t('any');
+    config.emptyValue = config.emptyValue || Em.I18n.t('any');
 
     return wrapperView.extend(config);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/af9ceed0/contrib/views/slider/src/main/resources/ui/app/views/common/table_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/common/table_view.js b/contrib/views/slider/src/main/resources/ui/app/views/common/table_view.js
index cb78c88..4d5df4a 100644
--- a/contrib/views/slider/src/main/resources/ui/app/views/common/table_view.js
+++ b/contrib/views/slider/src/main/resources/ui/app/views/common/table_view.js
@@ -356,7 +356,7 @@ App.TableView = Em.View.extend({
     var assoc = this.get('colPropAssoc');
     if (filterConditions.length) {
       result = content.filter(function (item) {
-         var match = true;
+        var match = true;
         filterConditions.forEach(function (condition) {
           var filterFunc = filters.getFilterByType(condition.type, false);
           if (match && condition.value != condition.defaultValue) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/af9ceed0/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js
index 307dad4..787378b 100644
--- a/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js
+++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js
@@ -120,7 +120,8 @@ App.SliderAppsView = App.TableView.extend({
     }.property('parentView.statusList'),
     onChangeValue: function(){
       this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string',
this.get('defaultValue'));
-    }
+    },
+    emptyValue: 'All Status'
   }),
 
   typeFilterView: filters.createTextView({

http://git-wip-us.apache.org/repos/asf/ambari/blob/af9ceed0/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_apps_view_test.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_apps_view_test.js
b/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_apps_view_test.js
new file mode 100644
index 0000000..a3cd020
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_apps_view_test.js
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+moduleFor('view:SliderApps', 'App.SliderAppsView', {
+  needs: ['controller:SliderApps']
+});
+
+test('clearFilters', function () {
+
+  var view = this.subject({
+    content: [{}],
+    filteredContent: [{}],
+    endIndex: 2
+  });
+
+  Em.run(function () {
+    view.clearFilters();
+  });
+
+  equal(view.get('pageContent.length'), 1, 'all content items should be displayed');
+
+});


Mime
View raw message