ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject [1/2] AMBARI-6858. Service config page: Advanced section should appear for each affiliated configType. (jaimin)
Date Fri, 15 Aug 2014 17:51:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 2ad28c632 -> 6afba61c6


http://git-wip-us.apache.org/repos/asf/ambari/blob/6afba61c/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index e922bda..c599c33 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -272,18 +272,12 @@ App.StackService.configCategories = function () {
         App.ServiceConfigCategory.create({ name: 'NAMENODE', displayName: 'NameNode'}),
         App.ServiceConfigCategory.create({ name: 'SECONDARY_NAMENODE', displayName: 'Secondary
NameNode'}),
         App.ServiceConfigCategory.create({ name: 'DATANODE', displayName: 'DataNode'}),
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced core-site', displayName: 'Custom
core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hdfs-site', displayName: 'Custom
hdfs-site.xml', siteFileName: 'hdfs-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hdfs-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'hdfs-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hadoop-env', displayName: 'hadoop-env.sh
content', siteFileName: 'hadoop-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
       break;
     case 'GLUSTERFS':
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced core-site', displayName : 'Custom
core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
       break;
     case 'MAPREDUCE':
@@ -291,11 +285,7 @@ App.StackService.configCategories = function () {
         App.ServiceConfigCategory.create({ name: 'HISTORYSERVER', displayName: 'History Server'}),
         App.ServiceConfigCategory.create({ name: 'JOBTRACKER', displayName: 'JobTracker'}),
         App.ServiceConfigCategory.create({ name: 'TASKTRACKER', displayName: 'TaskTracker'}),
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced mapred-site', displayName: 'Custom
mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced mapreduce-log4j', displayName:
'Custom log4j.properties', siteFileName: 'mapreduce-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced mapred-env', displayName: 'mapred-env.sh
content', siteFileName: 'mapred-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
       break;
     case 'YARN':
@@ -304,74 +294,39 @@ App.StackService.configCategories = function () {
         App.ServiceConfigCategory.create({ name: 'NODEMANAGER', displayName: 'Node Manager'}),
         App.ServiceConfigCategory.create({ name: 'APP_TIMELINE_SERVER', displayName: 'Application
Timeline Server'}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'CapacityScheduler', displayName: 'Scheduler',
isCapacityScheduler: true, isCustomView: true, siteFileName: 'capacity-scheduler.xml', siteFileNames:
['capacity-scheduler.xml', 'mapred-queue-acls.xml'], canAddProperty: App.supports.capacitySchedulerUi}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced yarn-site', displayName: 'Custom
yarn-site.xml', siteFileName: 'yarn-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced yarn-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'yarn-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced yarn-env', displayName: 'yarn-env.sh
content', siteFileName: 'yarn-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'CapacityScheduler', displayName: 'Scheduler',
isCustomView: true, siteFileName: 'capacity-scheduler.xml'})
       ]);
       break;
     case 'MAPREDUCE2':
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'HISTORYSERVER', displayName: 'History Server'}),
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedMapredSite', displayName: 'Custom
mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced mapred-env', displayName: 'mapred-env.sh
content', siteFileName: 'mapred-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'HISTORYSERVER', displayName: 'History Server'})
       ]);
       break;
     case 'HIVE':
-     serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'HIVE_METASTORE', displayName: 'Hive Metastore'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hive-site', displayName: 'Custom
hive-site.xml', siteFileName: 'hive-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hive-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'hive-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hive-exec-log4j', displayName:
'Custom hive-exec-log4j', siteFileName: 'hive-exec-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hive-env', displayName: 'hive-env.sh
content', siteFileName: 'hive-env.xml', canAddProperty: false})
+      serviceConfigCategories.pushObjects([
+        App.ServiceConfigCategory.create({ name: 'HIVE_METASTORE', displayName: 'Hive Metastore'})
       ]);
       break;
     case 'WEBHCAT':
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'WEBHCAT_SERVER', displayName: 'WebHCat
Server'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced webhcat-site', displayName: 'Custom
webhcat-site.xml', siteFileName: 'webhcat-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced webhcat-env', displayName: 'webhcat-env.sh
content', siteFileName: 'webhcat-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'WEBHCAT_SERVER', displayName: 'WebHCat
Server'})
       ]);
       break;
     case 'HBASE':
       serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'HBASE_MASTER', displayName: 'HBase Master'}),
         App.ServiceConfigCategory.create({ name: 'HBASE_REGIONSERVER', displayName: 'RegionServer'}),
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hbase-site', displayName: 'Custom
hbase-site.xml', siteFileName: 'hbase-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hbase-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'hbase-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced hbase-env', displayName: 'hbase-env.sh
content', siteFileName: 'hbase-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
       break;
     case 'ZOOKEEPER':
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'ZOOKEEPER_SERVER', displayName: 'ZooKeeper
Server'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced zookeeper-log4j', displayName:
'Custom log4j.properties', siteFileName: 'zookeeper-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced zoo.cfg', displayName: 'Custom
zoo.cfg', siteFileName: 'zoo.cfg', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced zookeeper-env', displayName: 'zookeeper-env.sh
content', siteFileName: 'zookeeper-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'ZOOKEEPER_SERVER', displayName: 'ZooKeeper
Server'})
       ]);
       break;
     case 'OOZIE':
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'OOZIE_SERVER', displayName: 'Oozie Server'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced oozie-site', displayName: 'Custom
oozie-site.xml', siteFileName: 'oozie-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced oozie-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'oozie-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced oozie-env', displayName: 'oozie-env.sh
content', siteFileName: 'oozie-env.xml', canAddProperty: false})
-      ]);
-      break;
-    case 'PIG':
-      serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Custom pig.properties',
siteFileName: 'pig-properties.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced pig-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'pig-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced pig-env', displayName: 'pig-env.sh
content', siteFileName: 'pig-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'OOZIE_SERVER', displayName: 'Oozie Server'})
       ]);
       break;
     case 'FALCON':
@@ -380,10 +335,7 @@ App.StackService.configCategories = function () {
         App.ServiceConfigCategory.create({ name: 'Falcon - Oozie integration', displayName:
'Falcon - Oozie integration'}),
         App.ServiceConfigCategory.create({ name: 'FalconStartupSite', displayName: 'Falcon
startup.properties'}),
         App.ServiceConfigCategory.create({ name: 'FalconRuntimeSite', displayName: 'Falcon
runtime.properties'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced falcon-startup.properties', displayName:
'Custom startup.properties', siteFileName: 'falcon-startup.properties.xml', canAddProperty:
true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced falcon-runtime.properties', displayName:
'Custom runtime.properties', siteFileName: 'falcon-runtime.properties.xml', canAddProperty:
true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced falcon-env', displayName: 'falcon-env.sh
content', siteFileName: 'falcon-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
       break;
     case 'STORM':
@@ -393,18 +345,12 @@ App.StackService.configCategories = function () {
         App.ServiceConfigCategory.create({ name: 'STORM_UI_SERVER', displayName: 'Storm UI
Server'}),
         App.ServiceConfigCategory.create({ name: 'STORM_REST_API', displayName: 'Storm REST
API Server'}),
         App.ServiceConfigCategory.create({ name: 'DRPC_SERVER', displayName: 'DRPC Server'}),
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced storm-site', displayName: 'Custom
storm.yaml', siteFileName: 'storm-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced storm-env', displayName: 'storm-env.sh
content', siteFileName: 'storm-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
       break;
     case 'TEZ':
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced tez-site', displayName: 'Custom
tez-site.xml', siteFileName: 'tez-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'Advanced tez-env', displayName: 'tez-env.sh
content', siteFileName: 'tez-env.xml', canAddProperty: false})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
       break;
     case 'FLUME':
@@ -412,34 +358,62 @@ App.StackService.configCategories = function () {
         App.ServiceConfigCategory.create({ name: 'FLUME_HANDLER', displayName: 'flume.conf',
siteFileName: 'flume-conf', canAddProperty: false})
       ]);
       break;
+    case 'PIG':
+      break;
     case 'SQOOP':
-      serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'Advanced sqoop-env', displayName: 'sqoop-env.sh
content', siteFileName: 'sqoop-env.xml', canAddProperty: false})
-      ]);
       break;
     case 'HCATALOG':
       break;
     default:
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'})
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'})
       ]);
-      var configTypes = Object.keys(this.get('configTypes')).without('core-site').without('global');
-      configTypes.forEach(function (type) {
-        var displayName = 'Custom ' + type;
-        var canAddProperty = true;
-        var siteFileName = type + '.xml';
-        if (type.endsWith('-env') || type.endsWith('-log4j')){
-          var content =  this.get('configs').findProperty('name',"content");
-          if (!content) {
-            return;
-          }
-          canAddProperty = false;
-          displayName = content.get('description');
-        }
-        serviceConfigCategories.pushObject(App.ServiceConfigCategory.create({ name: 'Advanced
' + type, displayName: displayName, siteFileName: siteFileName,
-          canAddProperty: canAddProperty}));
-      }, this);
   }
+  serviceConfigCategories.pushObject(App.ServiceConfigCategory.create({ name: 'Advanced',
displayName: 'Advanced'}));
+
+  var configTypes = Object.keys(this.get('configTypes'));
+  if (this.get('serviceName') !== 'HDFS') {
+    configTypes = configTypes.without('core-site');
+  }
+  //Falcon has dependency on oozie-site but oozie-site advanced/custom section should not
be shown on Falcon page
+  if (this.get('serviceName') !== 'OOZIE') {
+    configTypes = configTypes.without('oozie-site');
+  }
+
+  //Hive has dependency on tez-site but tez-site advanced/custom section should not be shown
on Hive page
+  if (this.get('serviceName') !== 'TEZ') {
+    configTypes = configTypes.without('tez-site');
+  }
+
+  //oozie has dependency on yarn-site but yarn-site advanced/custom section should not be
shown on Oozie page
+  if (this.get('serviceName') !== 'YARN') {
+    configTypes = configTypes.without('yarn-site');
+  }
+
+
+  // Add Advanced section for every configType to all the services
+  configTypes.forEach(function (type) {
+    var displayName = 'Advanced ' + type;
+    var canAddProperty = false;
+    var advancedSection;
+    advancedSection = App.ServiceConfigCategory.create({ name: 'Advanced ' + type, displayName:
displayName,
+      canAddProperty: canAddProperty});
+    serviceConfigCategories.pushObject(advancedSection);
+  }, this);
+
+  // Add custom section for every configType to all the services
+  configTypes.forEach(function (type) {
+    var displayName = 'Custom ' + type;
+    var canAddProperty = true;
+    var customSection;
+    var siteFileName = type + '.xml';
+    var configTypesWithNoCustomSection = ['capacity-scheduler','mapred-queue-acls','flume-conf',
'pig-properties'];
+    if (type.endsWith('-env') || type.endsWith('-log4j') || configTypesWithNoCustomSection.contains(type))
{
+      return;
+    }
+    customSection = App.ServiceConfigCategory.create({ name: displayName, displayName: displayName,
siteFileName: siteFileName,
+      canAddProperty: canAddProperty});
+    serviceConfigCategories.pushObject(customSection);
+  }, this);
   return serviceConfigCategories;
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/6afba61c/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index c69695e..b18bff6 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -94,13 +94,28 @@ App.config = Em.Object.create({
     return this.get('filenameExceptions').contains(fileName) ? fileName : fileName + '.xml';
   },
 
+  /**
+   *
+   * Returns the configuration tagName from supplied filename
+   *
+   * Example:
+   *   App.config.getConfigTagFromFileName('core-site.xml') // returns core-site
+   *   App.config.getConfigTagFromFileName('zoo.cfg') // returns zoo.cfg
+   *
+   * @param {String} fileName
+   * @method getConfigTagFromFileName
+   **/
+  getConfigTagFromFileName: function(fileName) {
+    return fileName.endsWith('.xml') ? fileName.slice(0,-4) : filename;
+  },
+
   setPreDefinedServiceConfigs: function () {
     var configs = this.get('preDefinedSiteProperties');
     var services = [];
     var nonServiceTab = require('data/service_configs');
     var stackServices = App.StackService.find().filterProperty('id');
     // Only include services that has configTypes related to them for service configuration
page
-    // Also Remove HCatalog from this list. HCatalog has and hive-site related to it but
none of them should be exposed under HCatalog Service
+    // Also Remove HCatalog from this list. HCatalog has hive-site affiliated to it but none
of the properties of it should be exposed under HCatalog Service
     // HCatalog should be eventually made a part of Hive Service. See AMBARI-6302 description
for further details
     var servicesWithConfigTypes = stackServices.filter(function (service) {
       var configtypes = service.get('configTypes');
@@ -145,17 +160,18 @@ App.config = Em.Object.create({
    * Create array of service properties for Log4j files
    * @returns {Array}
    */
-  createContentProperties: function () {
+  createContentProperties: function (configs) {
     var services = App.StackService.find();
     var contentProperties = [];
     services.forEach(function (service) {
       if (service.get('configTypes')) {
         Object.keys(service.get('configTypes')).forEach(function (type) {
-          if (type.endsWith('-log4j') || type.endsWith('-env')) {
+          var contentProperty = configs.filterProperty('filename',type + '.xml').someProperty('name','content');
+          if (contentProperty && (type.endsWith('-log4j') || type.endsWith('-env')))
{
             var property = {
               "id": "site property",
               "name": "content",
-              "displayName": "content",
+              "displayName": type.endsWith('-env') ? type + ' template' : "content",
               "value": "",
               "defaultValue": "",
               "description": type + " properties",
@@ -163,7 +179,7 @@ App.config = Em.Object.create({
               "isOverridable": true,
               "isRequired": false,
               "isVisible": true,
-              "showLabel": false,
+              "showLabel": type.endsWith('-env'),
               "serviceName": service.get('serviceName'),
               "filename": type + '.xml',
               "category": "Advanced " + type
@@ -263,12 +279,14 @@ App.config = Em.Object.create({
       }
     } else {
       var advancedProperty = null;
+      var configType = this.getConfigTagFromFileName(config.filename);
       if (isAdvanced) {
-        advancedProperty = advancedConfigs.findProperty('name', config.name);
+        advancedProperty = advancedConfigs.filterProperty('filename', config.filename).findProperty('name',
config.name);
+      }
+      config.category = config.category ? config.category : 'Advanced ' + configType;
+      if (isAdvanced) {
+        config.description = advancedProperty.description;
       }
-
-      config.category = config.category ? config.category : 'Advanced';
-      config.description = isAdvanced && advancedProperty.description;
     }
   },
 
@@ -298,7 +316,7 @@ App.config = Em.Object.create({
    */
   mergePreDefinedWithLoaded: function (configGroups, advancedConfigs, tags, serviceName)
{
     var configs = [];
-    var contentProperties = this.createContentProperties();
+    var contentProperties = this.createContentProperties(advancedConfigs);
     var preDefinedConfigs = this.get('preDefinedSiteProperties').concat(contentProperties);
     var mappingConfigs = [];
     var filenameExceptions = this.get('filenameExceptions');
@@ -426,7 +444,7 @@ App.config = Em.Object.create({
       siteStart = [];
 
     var preDefinedSiteProperties = this.get('preDefinedSiteProperties').mapProperty('name');
-    var contentProperties = this.createContentProperties().mapProperty('name');
+    var contentProperties = this.createContentProperties(siteConfigs).mapProperty('name');
     var siteProperties = preDefinedSiteProperties.concat(contentProperties);
     siteProperties.forEach(function (name) {
       var _site = siteConfigs.filterProperty('name', name);
@@ -456,7 +474,7 @@ App.config = Em.Object.create({
    */
   mergePreDefinedWithStored: function (storedConfigs, advancedConfigs, selectedServiceNames)
{
     var mergedConfigs = [];
-    var contentProperties = this.createContentProperties();
+    var contentProperties = this.createContentProperties(advancedConfigs);
     var preDefinedConfigs = this.get('preDefinedSiteProperties').concat(contentProperties);
 
     storedConfigs = (storedConfigs) ? storedConfigs : [];
@@ -492,7 +510,7 @@ App.config = Em.Object.create({
           configData.supportsFinal = stored.supportsFinal;
           configData.isRequired = (configData.isRequired !== undefined) ? configData.isRequired
: true;
           configData.isRequiredByAgent = (configData.isRequiredByAgent !== undefined) ? configData.isRequiredByAgent
: true;
-          configData.showLabel = stored.showLabel !== false;
+          configData.showLabel = !!stored.showLabel;
         }
         else if (!preDefined && stored) {
           configData = this.addUserProperty(stored, isAdvanced, advancedConfigs);
@@ -523,9 +541,9 @@ App.config = Em.Object.create({
             configData.overrides = storedCfg.overrides;
             configData.filename = storedCfg.filename;
             configData.description = storedCfg.description;
-            configData.description = storedCfg.showLabel !== false;
             configData.isFinal = storedCfg.isFinal;
             configData.supportsFinal = storedCfg.supportsFinal;
+            configData.showLabel = !!storedCfg.showLabel;
           } else if (isAdvanced) {
             advanced = advancedConfigs.filterProperty('filename', configData.filename).findProperty('name',
configData.name);
             this.setPropertyFromStack(configData, advanced);
@@ -564,9 +582,11 @@ App.config = Em.Object.create({
    * @param serviceName
    */
   addAdvancedConfigs: function (serviceConfigs, advancedConfigs, serviceName) {
-    var configsToVerifying = (serviceName) ? serviceConfigs.filterProperty('serviceName',
serviceName) : serviceConfigs.slice();
+    var miscConfigs = serviceConfigs.filterProperty('serviceName', 'MISC');
+    var configsToVerifying = (serviceName) ? serviceConfigs.filterProperty('serviceName',
serviceName).concat(miscConfigs) : serviceConfigs.slice();
     advancedConfigs.forEach(function (_config) {
-      var configCategory = 'Advanced';
+      var configType = this.getConfigTagFromFileName(_config.filename);
+      var configCategory = 'Advanced ' + configType;
       var categoryMetaData = null;
       if (_config) {
         if (this.get('configMapping').computed().someProperty('name', _config.name)) {
@@ -1105,7 +1125,6 @@ App.config = Em.Object.create({
       defaultValue: stored.defaultValue,
       displayType: stringUtils.isSingleLine(stored.value) ? 'advanced' : 'multiLine',
       filename: stored.filename,
-      category: 'Advanced',
       isUserProperty: stored.isUserProperty === true,
       hasInitialValue: !!stored.hasInitialValue,
       isOverridable: true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/6afba61c/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 6646f9d..abdaacf 100644
--- a/ambari-web/app/views/common/configs/services_config.js
+++ b/ambari-web/app/views/common/configs/services_config.js
@@ -104,7 +104,8 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
   // default,
   // cacheable )
   categoryConfigs: function () {
-    return this.get('serviceConfigs').filterProperty('category', this.get('category.name')).filterProperty('isVisible',
true);
+    var categoryConfigs = this.get('serviceConfigs').filterProperty('category', this.get('category.name'));
+    return this.orderContentAtLast(categoryConfigs).filterProperty('isVisible', true);
   }.property('serviceConfigs.@each', 'categoryConfigsAll.@each.isVisible').cacheable(),
 
   /**
@@ -119,6 +120,31 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
   }.property('serviceConfigs.@each').cacheable(),
 
   /**
+   * Re-order the configs to list content displayType properties at last in the category
+   * @param categoryConfigs
+   */
+  orderContentAtLast: function(categoryConfigs) {
+    var contentProperties =  categoryConfigs.filterProperty('displayType','content');
+    var self = this;
+    if (!contentProperties.length) {
+      return categoryConfigs
+    } else {
+      var comparator;
+      return categoryConfigs.sort(function(a,b){
+        var aContent = contentProperties.someProperty('name', a.get('name'));
+        var bContent = contentProperties.someProperty('name', b.get('name'));
+        if (aContent && bContent) {
+          return 0;
+        } else if (aContent){
+          return 1;
+        } else {
+          return -1;
+        }
+      });
+    }
+  },
+
+  /**
    * Warn/prompt user to adjust Service props when changing user/groups in Misc
    * Is triggered when user ended editing text field
    */


Mime
View raw message