You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/09/11 21:02:32 UTC

[12/26] git commit: AMBARI-7250 Hive and ATS properties are not available on backend but available on UI(upgrade stack 2.0 -> 2.1). (Buzhor Denys via atkach)

AMBARI-7250 Hive and ATS properties are not available on backend but available on UI(upgrade stack 2.0 -> 2.1). (Buzhor Denys via atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: 475d458973bf52870d6d13aa5ee5566e05c6f66c
Parents: a3724c6
Author: atkach <at...@hortonworks.com>
Authored: Wed Sep 10 21:18:44 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Wed Sep 10 21:18:44 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/data/site_properties.js |  2 +-
 ambari-web/app/utils/config.js         | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/475d4589/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
index cf837f0..02fa670 100644
--- a/ambari-web/app/data/site_properties.js
+++ b/ambari-web/app/data/site_properties.js
@@ -2528,7 +2528,7 @@ module.exports =
       "isVisible": true,
       "serviceName": "MISC",
       "filename": "cluster-env.xml",
-      "category": "Users and Groups",
+      "category": "Users and Groups"
     }
   ]
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/475d4589/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 1119287..16089d9 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -206,7 +206,7 @@ App.config = Em.Object.create({
 
   /**
    * Function should be used post-install as precondition check should not be done only after installer wizard
-   * @param siteNames {string|array}
+   * @param siteNames {String|Array}
    * @returns {Array}
    */
   getBySitename: function (siteNames) {
@@ -360,6 +360,13 @@ App.config = Em.Object.create({
 
         if (configsPropertyDef) {
           this.setServiceConfigUiAttributes(serviceConfigObj, configsPropertyDef);
+          // check if defined UI config present in config list obtained from server.
+          // in case when config is absent on server and defined UI config is required
+          // by server, this config should be ignored
+          var serverProperty = properties[serviceConfigObj.get('name')];
+          if (!serverProperty && serviceConfigObj.get('isRequiredByAgent')) {
+            continue;
+          }
         }
 
         if (!this.getBySitename(serviceConfigObj.get('filename')).someProperty('name', index)) {
@@ -470,7 +477,7 @@ App.config = Em.Object.create({
    * @param storedConfigs
    * @param advancedConfigs
    * @param selectedServiceNames
-   * @return {array}
+   * @return {Array}
    */
   mergePreDefinedWithStored: function (storedConfigs, advancedConfigs, selectedServiceNames) {
     var mergedConfigs = [];
@@ -584,6 +591,14 @@ App.config = Em.Object.create({
   addAdvancedConfigs: function (serviceConfigs, advancedConfigs, serviceName) {
     var miscConfigs = serviceConfigs.filterProperty('serviceName', 'MISC');
     var configsToVerifying = (serviceName) ? serviceConfigs.filterProperty('serviceName', serviceName).concat(miscConfigs) : serviceConfigs.slice();
+    var definedConfigs = (serviceName) ? this.get('preDefinedServiceConfigs').findProperty('serviceName', serviceName).get('configs') : [];
+
+    if (definedConfigs.length) {
+      advancedConfigs = advancedConfigs.filter(function(property) {
+        return !(definedConfigs.someProperty('name', property.name) && !serviceConfigs.someProperty('name', property.name));
+      }, this);
+    }
+
     advancedConfigs.forEach(function (_config) {
       var configType = this.getConfigTagFromFileName(_config.filename);
       var configCategory = 'Advanced ' + configType;