ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: Revert "AMBARI-8249. Usability: Configs Tab UI responsiveness issues (alexantonenko)" Reverting due to UT failures. This reverts commit ae0d8257440f7399f457ebbf71e03f1198296727.
Date Mon, 10 Nov 2014 18:24:12 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4e255b717 -> f8106748a


Revert "AMBARI-8249. Usability: Configs Tab UI responsiveness issues (alexantonenko)"
Reverting due to UT failures.
This reverts commit ae0d8257440f7399f457ebbf71e03f1198296727.


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

Branch: refs/heads/trunk
Commit: f8106748a6b9088a97efbbf8a7bad6bd0bbb6d9c
Parents: 4e255b7
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Mon Nov 10 10:23:56 2014 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Mon Nov 10 10:23:56 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/models/service_config.js         |  1 -
 .../common/configs/service_config_category.hbs  |  4 ++--
 .../app/views/common/configs/services_config.js | 20 ++++++++++----------
 3 files changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f8106748/ambari-web/app/models/service_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js
index 300c2c6..a3ffc3e 100644
--- a/ambari-web/app/models/service_config.js
+++ b/ambari-web/app/models/service_config.js
@@ -194,7 +194,6 @@ App.ServiceConfigProperty = Ember.Object.extend({
   serviceValidator: null,
   isNotSaved: false, // user property was added but not saved
   hasInitialValue: false, //if true then property value is defined and saved to server
-  isHiddenByFilter: false, //if true then hide this property (filtered out)
   /**
    * Usage example see on <code>App.ServiceConfigRadioButtons.handleDBConnectionProperty()</code>
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/f8106748/ambari-web/app/templates/common/configs/service_config_category.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs
index 1ad4384..a03c9af 100644
--- a/ambari-web/app/templates/common/configs/service_config_category.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_category.hbs
@@ -25,8 +25,8 @@
   <div class="accordion-inner service-config-section">
     <form class="form-horizontal" autocomplete="off">
 
-      {{#each view.categoryConfigs}}
-        <div {{bindAttr class=":entry-row isHiddenByFilter:hide isOverridden:overridden-property
hasCompareDiffs:overridden-property"}}>
+      {{#each view.filteredCategoryConfigs}}
+        <div {{bindAttr class=":entry-row isOverridden:overridden-property hasCompareDiffs:overridden-property"}}>
           {{#if showLabel}}
             <span {{bindAttr class="errorMessage:error: :control-group :control-label-span"}}>
               <label class="control-label">

http://git-wip-us.apache.org/repos/asf/ambari/blob/f8106748/ambari-web/app/views/common/configs/services_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/services_config.js b/ambari-web/app/views/common/configs/services_config.js
index dd16117..23bb6e8 100644
--- a/ambari-web/app/views/common/configs/services_config.js
+++ b/ambari-web/app/views/common/configs/services_config.js
@@ -350,10 +350,10 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
     $('.popover').remove();
     var filter = this.get('parentView.filter').toLowerCase();
     var selectedFilters = this.get('parentView.columns').filterProperty('selected');
-    var filteredResult = this.get('categoryConfigs');
+    var filteredResult = this.get('categoryConfigs')
 
     if (selectedFilters.length > 0 || filter.length > 0 || this.get('state') === 'inDOM')
{
-      filteredResult.forEach(function (config) {
+      filteredResult = filteredResult.filter(function (config) {
         var passesFilters = true;
 
         selectedFilters.forEach(function (filter) {
@@ -363,7 +363,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
         });
 
         if (!passesFilters) {
-          config.set('isHiddenByFilter', true);
+          return false;
         }
 
         var searchString = config.get('defaultValue') + config.get('description') +
@@ -376,14 +376,13 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
         }
 
         if (filter != null && typeof searchString === "string") {
-          config.set('isHiddenByFilter', !(searchString.toLowerCase().indexOf(filter) >
-1));
+          return searchString.toLowerCase().indexOf(filter) > -1;
         } else {
-          config.set('isHiddenByFilter', false);
+          return true;
         }
       });
     }
     filteredResult = this.sortByIndex(filteredResult);
-    filteredResult = filteredResult.filterProperty('isHiddenByFilter', false);
 
     if (filter && filteredResult.length ) {
       if (typeof this.get('category.collapsedByDefault') === 'undefined') {
@@ -401,7 +400,8 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
 
     var categoryBlock = $('.' + this.get('category.name').split(' ').join('.') + '>.accordion-body');
     filteredResult.length && !this.get('category.isCollapsed') ? categoryBlock.show()
: categoryBlock.hide();
-  }.observes('categoryConfigs', 'parentView.filter', 'parentView.columns.@each.selected'),
+    return filteredResult;
+  }.property('categoryConfigs', 'parentView.filter', 'parentView.columns.@each.selected').cacheable(),
 
   /**
    * sort configs in current category by index
@@ -440,8 +440,8 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
    * Should we show config group or not
    */
   isShowBlock: function () {
-    return this.get('category.customCanAddProperty') || this.get('categoryConfigs').filterProperty('isHiddenByFilter',
false).length > 0;
-  }.property('category.customCanAddProperty', 'categoryConfigs.@each.isHiddenByFilter'),
+    return this.get('category.customCanAddProperty') || this.get('filteredCategoryConfigs').length
> 0;
+  }.property('category.customCanAddProperty', 'filteredCategoryConfigs.length'),
 
   didInsertElement: function () {
     var isCollapsed = this.get('category.isCollapsed') == undefined ? (this.get('category.name').indexOf('Advanced')
!= -1 || this.get('category.name').indexOf('CapacityScheduler') != -1) : this.get('category.isCollapsed');
@@ -850,4 +850,4 @@ App.ServiceConfigTab = Ember.View.extend({
     var serviceName = this.get('controller.selectedService.serviceName');
     this.$('a[href="#' + serviceName + '"]').tab('show');
   }
-});
+});
\ No newline at end of file


Mime
View raw message