Repository: ambari Updated Branches: refs/heads/branch-1.7.0 c72c01bb9 -> eec97e12b
AMBARI-7947 [Perf400] Hive and other tabs rendering too slow during Customize service wizard, addtional patch.(atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/eec97e12 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/eec97e12 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/eec97e12 Branch: refs/heads/branch-1.7.0 Commit: eec97e12b2ed8f642654ae537191a88074500e51 Parents: c72c01b Author: atkach <[email protected]> Authored: Sat Oct 25 22:52:02 2014 +0300 Committer: atkach <[email protected]> Committed: Sat Oct 25 22:52:02 2014 +0300 ---------------------------------------------------------------------- .../app/views/common/configs/services_config.js | 51 +++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/eec97e12/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 24086f7..0ac4837 100644 --- a/ambari-web/app/views/common/configs/services_config.js +++ b/ambari-web/app/views/common/configs/services_config.js @@ -349,37 +349,40 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, { */ filteredCategoryConfigs: function () { $('.popover').remove(); - if (this.get('state') !== 'inDOM') return this.get('categoryConfigs'); var filter = this.get('parentView.filter').toLowerCase(); var selectedFilters = this.get('parentView.columns').filterProperty('selected'); - var filteredResult = this.get('categoryConfigs').filter(function (config) { - var passesFilters = true; + var filteredResult = this.get('categoryConfigs') - selectedFilters.forEach(function (filter) { - if (config.get(filter.attributeName) !== filter.attributeValue) { - passesFilters = false; - } - }); + if (this.get('state') === 'inDOM') { + filteredResult = filteredResult.filter(function (config) { + var passesFilters = true; - if (!passesFilters) { - return false; - } + selectedFilters.forEach(function (filter) { + if (config.get(filter.attributeName) !== filter.attributeValue) { + passesFilters = false; + } + }); - var searchString = config.get('defaultValue') + config.get('description') + - config.get('displayName') + config.get('name') + config.get('value'); + if (!passesFilters) { + return false; + } - if (config.get('overrides')) { - config.get('overrides').forEach(function(overriddenConf){ - searchString += overriddenConf.get('value') + overriddenConf.get('group.name'); - }); - } + var searchString = config.get('defaultValue') + config.get('description') + + config.get('displayName') + config.get('name') + config.get('value'); - if (filter != null && typeof searchString === "string") { - return searchString.toLowerCase().indexOf(filter) > -1; - } else { - return true; - } - }); + if (config.get('overrides')) { + config.get('overrides').forEach(function (overriddenConf) { + searchString += overriddenConf.get('value') + overriddenConf.get('group.name'); + }); + } + + if (filter != null && typeof searchString === "string") { + return searchString.toLowerCase().indexOf(filter) > -1; + } else { + return true; + } + }); + } filteredResult = this.sortByIndex(filteredResult); if (filter && filteredResult.length ) {
