ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-19701. Provide minimal call context from UI when making stack advisor calls. (rzang via yusaku)
Date Wed, 25 Jan 2017 18:47:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 5ddbb58ec -> 6a2aca64e


AMBARI-19701. Provide minimal call context from UI when making stack advisor calls. (rzang
via yusaku)


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

Branch: refs/heads/trunk
Commit: 6a2aca64e0d1eb789777e686829d7ec5babcd388
Parents: 5ddbb58
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Wed Jan 25 10:47:10 2017 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Wed Jan 25 10:47:46 2017 -0800

----------------------------------------------------------------------
 .../mixins/common/configs/enhanced_configs.js   | 22 +++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6a2aca64/ambari-web/app/mixins/common/configs/enhanced_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/enhanced_configs.js b/ambari-web/app/mixins/common/configs/enhanced_configs.js
index d1d8f9b..0e3f59b 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -214,7 +214,8 @@ App.EnhancedConfigsMixin = Em.Mixin.create(App.ConfigWithOverrideRecommendationP
       if (App.Service.find().someProperty('serviceName', 'HDFS') && !stepConfigs.someProperty('serviceName',
'HDFS')) {
         requiredTags.push({site: 'core-site', serviceName: 'HDFS'});
       }
-
+      
+      this.setUserContext(dataToSend);
       if (requiredTags.length) {
         this.loadAdditionalSites(requiredTags, stepConfigs, recommendations, dataToSend,
onComplete);
       } else {
@@ -308,6 +309,25 @@ App.EnhancedConfigsMixin = Em.Mixin.create(App.ConfigWithOverrideRecommendationP
     });
   },
 
+  setUserContext: function(dataToSend) {
+    var controllerName = this.get('content.controllerName');
+    var changes = dataToSend.changed_configurations;
+    if (changes) {
+      dataToSend['user-context'] = {"operation" : "EditConfig"};
+    } else {
+      if (!controllerName) {
+        dataToSend['user-context'] = {"operation" : "RecommendAttribute"};
+      } else if (controllerName == 'addServiceController') {
+        dataToSend['user-context'] = {
+          "operation" : "AddService",
+          "operation_details" : (this.get('content.services')|| []).filterProperty('isSelected').filterProperty('isInstalled',
false).mapProperty('serviceName').join(',')
+        };
+      } else if (controllerName == 'installerController'){
+        dataToSend['user-context'] = {"operation" : "ClusterCreate"};
+      }
+    }
+  },
+
   /**
    * Defines if there is any changes made by user.
    * Check all properties except recommended properties from popup


Mime
View raw message