Browse Source

AMBARI-2840 YARN and ZK data directory names have ',' at end

atkach 11 years ago
parent
commit
493c8ddc42

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

@@ -698,11 +698,6 @@ App.WizardController = Em.Controller.extend({
       }
 
       _content.get('configs').forEach(function (_configProperties) {
-        var displayType = _configProperties.get('displayType');
-        if (displayType === 'directories' || displayType === 'directory') {
-          var value = _configProperties.get('value').split(/\s+/g).join(',');
-          _configProperties.set('value', value);
-        }
         var overrides = _configProperties.get('overrides');
         var overridesArray = [];
         if(overrides!=null){
@@ -726,6 +721,7 @@ App.WizardController = Em.Controller.extend({
           serviceName: _configProperties.get('serviceName'),
           domain:  _configProperties.get('domain'),
           filename: _configProperties.get('filename'),
+          displayType: _configProperties.get('displayType'),
           overrides: overridesArray
         };
         serviceConfigProperties.push(configProperty);

+ 0 - 9
ambari-web/app/controllers/wizard/step7_controller.js

@@ -93,15 +93,6 @@ App.WizardStep7Controller = Em.Controller.extend({
     this.set('stepConfigs', serviceConfigs);
     this.activateSpecialConfigs();
     this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
-    this.get('stepConfigs').forEach(function(stepConfig) {
-      stepConfig.get('configs').forEach(function(config) {
-        var displayType = config.get('displayType');
-        if (displayType == 'directory' || displayType == 'directories') {
-          var value = config.get('value').replace(/,/g, "\n");
-          config.set('value', value);
-        }
-      });
-    });
   },
 
    /**

+ 13 - 4
ambari-web/app/controllers/wizard/step8_controller.js

@@ -63,10 +63,6 @@ App.WizardStep8Controller = Em.Controller.extend({
     return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
   }.property('content.services').cacheable(),
 
-  configMapping: function() {
-    return App.config.get('configMapping').all();
-  }.property('App.config.configMapping'),
-
   clearStep: function () {
     this.get('services').clear();
     this.get('configs').clear();
@@ -81,12 +77,25 @@ App.WizardStep8Controller = Em.Controller.extend({
       this.set('securityEnabled', App.router.get('mainAdminSecurityController').getUpdatedSecurityStatus());
     }
     this.clearStep();
+    this.formatDirectories();
     this.loadGlobals();
     this.loadConfigs();
     this.loadClusterInfo();
     this.loadServices();
     this.set('isSubmitDisabled', false);
   },
+  /**
+   * replace whitespace character with coma between directories
+   */
+  formatDirectories: function(){
+    this.get('content.serviceConfigProperties').forEach(function(_configProperty){
+      var displayType = _configProperty.displayType;
+      if (displayType === 'directories' || displayType === 'directory') {
+        var value = _configProperty.value.trim().split(/\s+/g).join(',');
+        _configProperty.value = value;
+      }
+    });
+  },
 
   loadGlobals: function () {
     var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');