Ver código fonte

AMBARI-13011. Add service: js error while adding service (alexantonenko)

Alex Antonenko 10 anos atrás
pai
commit
6b3ff72dc5

+ 4 - 0
ambari-web/app/controllers/installer.js

@@ -233,6 +233,10 @@ App.InstallerController = App.WizardController.extend({
   loadStacks: function () {
     var stacks = this.get('content.stacks');
     var dfd = $.Deferred();
+    App.StackConfigProperty.find().clear();
+    App.Section.find().clear();
+    App.SubSection.find().clear();
+    App.Tab.find().clear();
     if (stacks && stacks.get('length')) {
       App.set('currentStackVersion', App.Stack.find().findProperty('isSelected').get('id'));
       dfd.resolve(true);

+ 5 - 11
ambari-web/app/controllers/main/service/add_controller.js

@@ -118,18 +118,12 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs, {
           var self = this;
           var dfd = $.Deferred();
           this.loadKerberosDescriptorConfigs().done(function() {
-            if (App.get('isClusterSupportsEnhancedConfigs')) {
-              var serviceNames = App.StackService.find().filter(function(s) {
-                return s.get('isSelected') || s.get('isInstalled');
-              }).mapProperty('serviceName');
-              self.loadConfigThemes().then(function() {
-                dfd.resolve();
-              });
-            }
-            else {
-              self.set('stackConfigsLoaded', true);
+            var serviceNames = App.StackService.find().filter(function(s) {
+              return s.get('isSelected') || s.get('isInstalled');
+            }).mapProperty('serviceName');
+            self.loadConfigThemes().then(function() {
               dfd.resolve();
-            }
+            });
             self.loadServiceConfigGroups();
             self.loadServiceConfigProperties();
           });

+ 1 - 1
ambari-web/app/controllers/wizard/step7_controller.js

@@ -906,7 +906,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
       if (!Em.isNone(mappedConfigValue) && ((installedServiceNames && installedServiceNames.contains(_config.serviceName) || nonServiceTab.someProperty('serviceName', _config.serviceName)))) {
         // prevent overriding already edited properties
         if (_config.savedValue != mappedConfigValue || _config.displayType == 'password') {
-          _config.value = mappedConfigValue;
+          _config.value = App.config.formatPropertyValue(_config, mappedConfigValue);
         }
         _config.savedValue = mappedConfigValue;
         _config.hasInitialValue = true;

+ 1 - 1
ambari-web/app/mixins/common/configs/configs_loader.js

@@ -148,7 +148,7 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, {
         data: {
           serviceName: this.get('content.serviceName'),
           serviceConfigVersions: versions,
-          additionalParams: App.get('isClusterSupportsEnhancedConfigs') && this.get('dependentServiceNames.length') ? '|service_name.in(' +  this.get('dependentServiceNames') + ')&is_current=true' : ''
+          additionalParams: this.get('dependentServiceNames.length') ? '|service_name.in(' +  this.get('dependentServiceNames') + ')&is_current=true' : ''
         },
         success: 'loadSelectedVersionsSuccess'
       }));

+ 2 - 4
ambari-web/app/views/common/controls_view.js

@@ -77,9 +77,7 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
    * do not apply recommended value if user change value by himself.
    */
   keyUp: function() {
-    if (App.get('isClusterSupportsEnhancedConfigs')) {
-      this.get('controller').removeCurrentFromDependentList(this.get('serviceConfig') || this.get('config'));
-    }
+    this.get('controller').removeCurrentFromDependentList(this.get('serviceConfig') || this.get('config'));
   },
 
   /**
@@ -91,7 +89,7 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
    */
   sendRequestRorDependentConfigs: function(config) {
     if (!config || !config.get('isValid')) return $.Deferred().resolve().promise();
-    if (App.get('isClusterSupportsEnhancedConfigs') && ['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name'))) {
+    if (['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name'))) {
       var name = config.get('name');
       var saveRecommended = (this.get('config.value') === this.get('config.recommendedValue'));
       var controller = this.get('controller');