ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject git commit: AMBARI-6604. Adding custom config in yarn-site does not show final checkbox
Date Thu, 24 Jul 2014 23:56:59 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 0fc60a40b -> f2eae8960


AMBARI-6604. Adding custom config in yarn-site does not show final checkbox


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

Branch: refs/heads/trunk
Commit: f2eae89604228bafb4a8a5d81081a517aa199982
Parents: 0fc60a4
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Thu Jul 24 16:17:21 2014 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Thu Jul 24 16:56:49 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js |  4 ++--
 ambari-web/app/controllers/wizard.js                    |  4 ++--
 ambari-web/app/views/common/configs/services_config.js  | 12 ++++++++++++
 3 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f2eae896/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 418e830..a141065 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -665,10 +665,10 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
    */
   setSupportsFinal: function (serviceConfigProperty) {
     var fileName = serviceConfigProperty.get('filename');
-    var matchingConfigTypes = this.get('configTypesInfo').supportsFinal.filter(function(configType)
{
+    var matchingConfigType = this.get('configTypesInfo').supportsFinal.find(function(configType)
{
       return fileName.startsWith(configType);
     });
-    serviceConfigProperty.set('supportsFinal', matchingConfigTypes.length > 0);
+    serviceConfigProperty.set('supportsFinal', !!matchingConfigType);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2eae896/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 805e94b..2bd9ec5 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -796,10 +796,10 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, {
         var supportsFinal = App.config.getConfigTypesInfoFromService(service).supportsFinal;
 
         function shouldSupportFinal(filename) {
-          var matchingConfigTypes = supportsFinal.filter(function (configType) {
+          var matchingConfigType = supportsFinal.find(function (configType) {
             return filename.startsWith(configType);
           });
-          return (matchingConfigTypes.length > 0);
+          return !!matchingConfigType;
         }
 
         properties.forEach(function (property) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2eae896/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 ac8c05f..4cb5d15 100644
--- a/ambari-web/app/views/common/configs/services_config.js
+++ b/ambari-web/app/views/common/configs/services_config.js
@@ -493,6 +493,17 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
       var configsOfFile = service.get('configs').filterProperty('filename', siteFileName);
       var siteFileProperties = App.config.get('configMapping').all().filterProperty('filename',
siteFileName);
 
+      function shouldSupportFinal(filename) {
+        var stackService = App.StackService.find().findProperty('serviceName', serviceName);
+        var supportsFinal = App.config.getConfigTypesInfoFromService(stackService).supportsFinal;
+        var matchingConfigType = supportsFinal.find(function (configType) {
+          return filename.startsWith(configType);
+        });
+        return !!matchingConfigType;
+      }
+
+      var supportsFinal = shouldSupportFinal(siteFileName);
+
       function isDuplicatedConfigKey(name) {
         return siteFileProperties.findProperty('name', name) || configsOfFile.findProperty('name',
name);
       }
@@ -510,6 +521,7 @@ App.ServiceConfigsByCategoryView = Ember.View.extend(App.UserPref, {
           id: 'site property',
           serviceName: serviceName,
           defaultValue: null,
+          supportsFinal: supportsFinal,
           filename: siteFileName || '',
           isUserProperty: true,
           isNotSaved: true


Mime
View raw message