Repository: ambari
Updated Branches:
  refs/heads/trunk ce98754d5 -> e585d2391


AMBARI-10699 When changing stack on installer, step 7 fails with js errors. 
(ababiichuk)


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

Branch: refs/heads/trunk
Commit: e585d23917c84ab01ee1033fb52e861fe47ff362
Parents: ce98754
Author: aBabiichuk <[email protected]>
Authored: Thu Apr 23 16:25:24 2015 +0300
Committer: aBabiichuk <[email protected]>
Committed: Thu Apr 23 16:25:24 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/app.js                                     | 10 ++++++++++
 ambari-web/app/controllers/main/service/add_controller.js |  2 +-
 ambari-web/app/controllers/main/service/info/configs.js   |  2 +-
 ambari-web/app/controllers/wizard.js                      |  2 +-
 ambari-web/app/mixins/common/configs/enhanced_configs.js  |  4 ++--
 .../mixins/main/service/configs/preload_requests_chain.js |  2 +-
 .../app/views/common/configs/overriddenProperty_view.js   |  2 +-
 .../app/views/common/configs/service_config_view.js       |  4 ++--
 .../common/configs/service_configs_by_category_view.js    |  2 +-
 ambari-web/app/views/common/controls_view.js              |  4 ++--
 10 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 3e33f91..abb826b 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -183,6 +183,16 @@ module.exports = Em.Application.create({
   }.property('currentStackName'),
 
   /**
+   * when working with enhanced configs we should rely on stack version
+   * as version that is below 2.2 doesn't supports it
+   * even if flag <code>supports.enhancedConfigs<code> is true
+   * @type {boolean}
+   */
+  isClusterSupportsEnhancedConfigs: function() {
+    return this.get('isHadoop22Stack') && App.get('supports.enhancedConfigs')
+  }.property('isHadoop22Stack'),
+
+  /**
    * If NameNode High Availability is enabled
    * Based on <code>clusterStatus.isInstalled</code>, stack version, 
<code>SNameNode</code> availability
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js 
b/ambari-web/app/controllers/main/service/add_controller.js
index e7a714c..5e5491e 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -115,7 +115,7 @@ App.AddServiceController = 
App.WizardController.extend(App.AddSecurityConfigs, {
           var self = this;
           var dfd = $.Deferred();
           this.loadKerberosDescriptorConfigs().done(function() {
-            if (App.get('supports.enhancedConfigs')) {
+            if (App.get('isClusterSupportsEnhancedConfigs')) {
               var serviceNames = App.StackService.find().filter(function(s) {
                 return s.get('isSelected') || s.get('isInstalled');
               }).mapProperty('serviceName');

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/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 336f951..de4e87e 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -338,7 +338,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.ServerValidatorM
     console.log("TRACE: Loading configure for service");
     var serviceName = this.get('content.serviceName');
     this.clearStep();
-    if (App.get('supports.enhancedConfigs')) {
+    if (App.get('isClusterSupportsEnhancedConfigs')) {
       this.setDependentServices(serviceName);
       this.loadConfigTheme(serviceName).always(function() {
         App.themesMapper.generateAdvancedTabs([serviceName]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js 
b/ambari-web/app/controllers/wizard.js
index 5e30777..0730add 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -1234,7 +1234,7 @@ App.WizardController = 
Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
    loadConfigThemes: function() {
     var self = this;
     var dfd = $.Deferred();
-    if (App.get('supports.enhancedConfigs') && 
!this.get('stackConfigsLoaded')) {
+    if (App.get('isClusterSupportsEnhancedConfigs') && 
!this.get('stackConfigsLoaded')) {
       var serviceNames = App.StackService.find().filter(function(s) {
         return s.get('isSelected') || s.get('isInstalled');
       }).mapProperty('serviceName');

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/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 7c78d0f..d159cf5 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -33,7 +33,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
    * @type {boolean}
    */
   hasChangedDependencies: function() {
-    return App.get('supports.enhancedConfigs') && 
this.get('_dependentConfigValues.length') > 0;
+    return App.get('isClusterSupportsEnhancedConfigs') && 
this.get('_dependentConfigValues.length') > 0;
   }.property('_dependentConfigValues.length'),
 
   /**
@@ -211,7 +211,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
         hosts: this.get('hostNames'),
         services: this.get('serviceNames')
       };
-      if (App.get('supports.enhancedConfigs') && changedConfigs) {
+      if (App.get('isClusterSupportsEnhancedConfigs') && changedConfigs) {
         if (changedConfigs) {
           dataToSend.recommend = 'configuration-dependencies';
           dataToSend.changed_configurations = changedConfigs;

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/mixins/main/service/configs/preload_requests_chain.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/mixins/main/service/configs/preload_requests_chain.js 
b/ambari-web/app/mixins/main/service/configs/preload_requests_chain.js
index 09e7b16..a6ee169 100644
--- a/ambari-web/app/mixins/main/service/configs/preload_requests_chain.js
+++ b/ambari-web/app/mixins/main/service/configs/preload_requests_chain.js
@@ -138,7 +138,7 @@ App.PreloadRequestsChainMixin = Em.Mixin.create({
       serviceName: this.get('content.serviceName'),
       serviceConfigVersions: versions
     };
-    if (App.get('supports.enhancedConfigs') && 
this.get('dependentServiceNames.length')) {
+    if (App.get('isClusterSupportsEnhancedConfigs') && 
this.get('dependentServiceNames.length')) {
       data.additionalParams = '|service_name.in(' +  
this.get('dependentServiceNames') + ')&is_current=true';
     }
     this.trackRequest(App.ajax.send({

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/views/common/configs/overriddenProperty_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/overriddenProperty_view.js 
b/ambari-web/app/views/common/configs/overriddenProperty_view.js
index ae09d47..0e8c8e7 100644
--- a/ambari-web/app/views/common/configs/overriddenProperty_view.js
+++ b/ambari-web/app/views/common/configs/overriddenProperty_view.js
@@ -77,7 +77,7 @@ App.ServiceConfigView.SCPOverriddenRowsView = 
Ember.View.extend({
       var group = 
controller.get('selectedService.configGroups').findProperty('name', 
controller.get('selectedConfigGroup.name'));
       group.get('properties').removeObject(scpToBeRemoved);
     }
-    if (App.get('supports.enhancedConfigs')) {
+    if (App.get('isClusterSupportsEnhancedConfigs')) {
       var deletedConfig = App.ConfigProperty.find().find(function(cp) {
         return cp.get('name') === scpToBeRemoved.get('name')
           && cp.get('fileName') === scpToBeRemoved.get('filename')

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/views/common/configs/service_config_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_config_view.js 
b/ambari-web/app/views/common/configs/service_config_view.js
index 1db6d59..515cab6 100644
--- a/ambari-web/app/views/common/configs/service_config_view.js
+++ b/ambari-web/app/views/common/configs/service_config_view.js
@@ -43,7 +43,7 @@ App.ServiceConfigView = Em.View.extend({
    */
   supportsConfigLayout: function() {
     var supportedControllers = ['wizardStep7Controller', 
'mainServiceInfoConfigsController', 'mainHostServiceConfigsController'];
-    if (!App.get('supports.enhancedConfigs')) {
+    if (!App.get('isClusterSupportsEnhancedConfigs')) {
       return false;
     }
     if (App.Tab.find().someProperty('serviceName', 
this.get('controller.selectedService.serviceName')) && 
supportedControllers.contains(this.get('controller.name'))) {
@@ -104,7 +104,7 @@ App.ServiceConfigView = Em.View.extend({
    * @returns {Ember.A}
    */
   tabs: function() {
-    if (!App.get('supports.enhancedConfigs')) {
+    if (!App.get('isClusterSupportsEnhancedConfigs')) {
       return Em.A([]);
     }
     var tabs = App.Tab.find().filterProperty('serviceName', 
this.get('controller.selectedService.serviceName'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/views/common/configs/service_configs_by_category_view.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/views/common/configs/service_configs_by_category_view.js 
b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
index 3153cf5..1187a4d 100644
--- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js
+++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
@@ -582,7 +582,7 @@ App.ServiceConfigsByCategoryView = 
Em.View.extend(App.UserPref, App.ConfigOverri
   removeProperty: function (event) {
     var serviceConfigProperty = event.contexts[0];
     this.get('serviceConfigs').removeObject(serviceConfigProperty);
-    if (App.get('supports.enhancedConfigs')) {
+    if (App.get('isClusterSupportsEnhancedConfigs')) {
       var deletedConfig = App.ConfigProperty.find().find(function(cp) {
         return cp.get('name') === serviceConfigProperty.get('name')
           && cp.get('fileName') === serviceConfigProperty.get('filename')

http://git-wip-us.apache.org/repos/asf/ambari/blob/e585d239/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js 
b/ambari-web/app/views/common/controls_view.js
index e0824c0..e6ce369 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -66,7 +66,7 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
    * do not apply recommended value if user change value by himself.
    */
   keyUp: function() {
-    if (App.get('supports.enhancedConfigs')) {
+    if (App.get('isClusterSupportsEnhancedConfigs')) {
       
this.get('controller').removeCurrentFromDependentList(this.get('serviceConfig') 
|| this.get('config'));
     }
   },
@@ -79,7 +79,7 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
    * @returns {$.Deferred}
    */
   sendRequestRorDependentConfigs: function(config) {
-    if (App.get('supports.enhancedConfigs') && 
['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name')))
 {
+    if (App.get('isClusterSupportsEnhancedConfigs') && 
['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name')))
 {
       var name = config.get('name');
       var controller = this.get('controller');
       var type = App.config.getConfigTagFromFileName(config.get('filename'));

Reply via email to