Updated Branches: refs/heads/trunk 23754e344 -> 82adc3442
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/82adc344/ambari-web/app/data/site_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/site_properties.js b/ambari-web/app/data/site_properties.js new file mode 100644 index 0000000..bc68d25 --- /dev/null +++ b/ambari-web/app/data/site_properties.js @@ -0,0 +1,22 @@ +/** + * 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. + */ +module.exports = +{ + "configProperties": [ + ] +}; http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/82adc344/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index 3bce8c6..6918d62 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -26,25 +26,31 @@ var globalPropertyToServicesMap = null; App.config = Em.Object.create({ preDefinedServiceConfigs: function(){ - var configs = this.get('preDefinedConfigProperties'); + var configs = this.get('preDefinedGlobalProperties'); var services = []; require('data/service_configs').forEach(function(service){ service.configs = configs.filterProperty('serviceName', service.serviceName); services.push(service); }); return services; - }.property('preDefinedConfigProperties'), + }.property('preDefinedGlobalProperties'), configMapping: function() { if (App.get('isHadoop2Stack')) { return require('data/HDP2/config_mapping'); } return require('data/config_mapping'); }.property('App.isHadoop2Stack'), - preDefinedConfigProperties: function() { + preDefinedGlobalProperties: function() { if (App.get('isHadoop2Stack')) { - return require('data/HDP2/config_properties').configProperties; + return require('data/HDP2/global_properties').configProperties; } - return require('data/config_properties').configProperties; + return require('data/global_properties').configProperties; + }.property('App.isHadoop2Stack'), + preDefinedSiteProperties: function() { + if (App.get('isHadoop2Stack')) { + return require('data/HDP2/site_properties').configProperties; + } + return require('data/site_properties').configProperties; }.property('App.isHadoop2Stack'), preDefinedCustomConfigs: function () { if (App.get('isHadoop2Stack')) { @@ -162,7 +168,7 @@ App.config = Em.Object.create({ mergePreDefinedWithLoaded: function (configGroups, advancedConfigs, tags, serviceName) { var configs = []; var globalConfigs = []; - var preDefinedConfigs = this.get('preDefinedConfigProperties'); + var preDefinedConfigs = this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties')); var mappingConfigs = []; tags.forEach(function (_tag) { @@ -206,7 +212,7 @@ App.config = Em.Object.create({ if (configsPropertyDef) { this.handleSpecialProperties(serviceConfigObj); } else { - serviceConfigObj.isVisible = false; // if the global property is not defined on ui metadata config_properties.js then it shouldn't be a part of errorCount + serviceConfigObj.isVisible = false; // if the global property is not defined on ui metadata global_properties.js then it shouldn't be a part of errorCount } serviceConfigObj.id = 'puppet var'; serviceConfigObj.displayName = configsPropertyDef ? configsPropertyDef.displayName : null; @@ -240,14 +246,14 @@ App.config = Em.Object.create({ */ mergePreDefinedWithStored: function (storedConfigs, advancedConfigs) { var mergedConfigs = []; - var preDefinedConfigs = $.extend(true, [], this.get('preDefinedConfigProperties')); + var preDefinedConfigs = $.extend(true, [], this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties'))); var preDefinedNames = []; var storedNames = []; var names = []; var categoryMetaData = null; storedConfigs = (storedConfigs) ? storedConfigs : []; - preDefinedNames = this.get('preDefinedConfigProperties').mapProperty('name'); + preDefinedNames = preDefinedConfigs.mapProperty('name'); storedNames = storedConfigs.mapProperty('name'); names = preDefinedNames.concat(storedNames).uniq(); names.forEach(function (name) {
