Procházet zdrojové kódy

AMBARI-11682. Yarn "Capacity Scheduler"-config has Undo-button on the installer (onechiporenko)

Oleg Nechiporenko před 10 roky
rodič
revize
d46949d918

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

@@ -1434,8 +1434,12 @@ App.config = Em.Object.create({
       var savedIsFinal = fileConfigs.someProperty('savedIsFinal', true);
       var savedIsFinal = fileConfigs.someProperty('savedIsFinal', true);
       var recommendedIsFinal = fileConfigs.someProperty('recommendedIsFinal', true);
       var recommendedIsFinal = fileConfigs.someProperty('recommendedIsFinal', true);
       complexConfig.value = value;
       complexConfig.value = value;
-      complexConfig.savedValue = savedValue;
-      complexConfig.recommendedValue = recommendedValue;
+      if (savedValue) {
+        complexConfig.savedValue = savedValue;
+      }
+      if (recommendedValue) {
+        complexConfig.recommendedValue = recommendedValue;
+      }
       complexConfig.isFinal = isFinal;
       complexConfig.isFinal = isFinal;
       complexConfig.savedIsFinal = savedIsFinal;
       complexConfig.savedIsFinal = savedIsFinal;
       complexConfig.recommendedIsFinal = recommendedIsFinal;
       complexConfig.recommendedIsFinal = recommendedIsFinal;

+ 2 - 1
ambari-web/test/utils/config_test.js

@@ -122,7 +122,8 @@ describe('App.config', function () {
       var result = App.config.fileConfigsIntoTextarea.call(App.config, configs, filename);
       var result = App.config.fileConfigsIntoTextarea.call(App.config, configs, filename);
       expect(result.length).to.equal(1);
       expect(result.length).to.equal(1);
       expect(result[0].value).to.equal('');
       expect(result[0].value).to.equal('');
-      expect(result[0].recommendedValue).to.equal('');
+      expect(Em.isNone(result[0].recommendedValue)).to.be.true;
+      expect(Em.isNone(result[0].savedValue)).to.be.true;
     });
     });
     it("filename has configs that shouldn't be included in textarea", function () {
     it("filename has configs that shouldn't be included in textarea", function () {
       var configs = [
       var configs = [