Ver código fonte

AMBARI-2640. Going back to Customize Services page from the Install page resets certain directory values. (Aleksandr Kovalenko via yusaku)

Yusaku Sako 12 anos atrás
pai
commit
2b013ac35c

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

@@ -83,7 +83,7 @@ App.WizardStep7Controller = Em.Controller.extend({
     //STEP 5: Add custom configs
     App.config.addCustomConfigs(configs);
     //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty (configs -> serviceConfigs)
-    var serviceConfigs = App.config.renderConfigs(configs, this.get('allInstalledServiceNames'), this.get('selectedServiceNames'));
+    var serviceConfigs = App.config.renderConfigs(configs, storedConfigs, this.get('allInstalledServiceNames'), this.get('selectedServiceNames'));
     this.set('stepConfigs', serviceConfigs);
     this.activateSpecialConfigs();
     this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));

+ 4 - 2
ambari-web/app/utils/config.js

@@ -387,7 +387,7 @@ App.config = Em.Object.create({
    * @param selectedServiceNames
    * @return {Array}
    */
-  renderConfigs: function (configs, allInstalledServiceNames, selectedServiceNames) {
+  renderConfigs: function (configs, storedConfigs, allInstalledServiceNames, selectedServiceNames) {
     var renderedServiceConfigs = [];
     var localDB = {
       hosts: App.db.getHosts(),
@@ -414,7 +414,9 @@ App.config = Em.Object.create({
         _config.isOverridable = (_config.isOverridable === undefined) ? true : _config.isOverridable;
         serviceConfigProperty = App.ServiceConfigProperty.create(_config);
         this.updateHostOverrides(serviceConfigProperty, _config);
-        serviceConfigProperty.initialValue(localDB);
+        if (!storedConfigs) {
+          serviceConfigProperty.initialValue(localDB);
+        }
         this.tweakDynamicDefaults(localDB, serviceConfigProperty, _config);
         serviceConfigProperty.validate();
         configsByService.pushObject(serviceConfigProperty);