ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-18138. Overriding a config in a Config group and then saving it transitions the screen to default group with configs in non-editable state (akovalenko)
Date Fri, 12 Aug 2016 14:35:30 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b9d61f7d7 -> 25506aeb5


AMBARI-18138. Overriding a config in a Config group and then saving it transitions the screen
to default group with configs in non-editable state (akovalenko)


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

Branch: refs/heads/trunk
Commit: 25506aeb53123cde7cca6f1aa1056ab9cdc06f8d
Parents: b9d61f7
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Aug 12 17:16:28 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Fri Aug 12 17:16:38 2016 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js | 12 +++++++++---
 ambari-web/app/mixins/common/configs/configs_loader.js  |  4 +---
 .../test/mixins/common/configs/configs_loader_test.js   |  6 ------
 3 files changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/25506aeb/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 fec288d..095bdc7 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -299,11 +299,17 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.AddSecurityConfi
    * @method loadStep
    */
   loadStep: function () {
-    var serviceName = this.get('content.serviceName');
+    var serviceName = this.get('content.serviceName'), self = this;
     this.clearStep();
     this.set('dependentServiceNames', App.StackService.find(serviceName).get('dependentServiceNames'));
-    this.loadConfigTheme(serviceName).always(this.loadCurrentVersions.bind(this));
-    this.loadServiceConfigVersions();
+    this.loadConfigTheme(serviceName).always(function () {
+      if (self.get('preSelectedConfigVersion')) {
+        self.loadPreSelectedConfigVersion();
+      } else {
+        self.loadCurrentVersions();
+      }
+      self.loadServiceConfigVersions();
+    });
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/25506aeb/ambari-web/app/mixins/common/configs/configs_loader.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_loader.js b/ambari-web/app/mixins/common/configs/configs_loader.js
index eb56a89..83e4837 100644
--- a/ambari-web/app/mixins/common/configs/configs_loader.js
+++ b/ambari-web/app/mixins/common/configs/configs_loader.js
@@ -68,9 +68,7 @@ App.ConfigsLoader = Em.Mixin.create(App.GroupsMappingMixin, {
       }
     }
     this.set('allVersionsLoaded', true);
-    if (this.get('preSelectedConfigVersion')) {
-      this.loadPreSelectedConfigVersion();
-    } else {
+    if (!this.get('preSelectedConfigVersion')) {
       this.set('selectedVersion', this.get('currentDefaultVersion'));
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/25506aeb/ambari-web/test/mixins/common/configs/configs_loader_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/configs/configs_loader_test.js b/ambari-web/test/mixins/common/configs/configs_loader_test.js
index 75f5107..e718bbe 100644
--- a/ambari-web/test/mixins/common/configs/configs_loader_test.js
+++ b/ambari-web/test/mixins/common/configs/configs_loader_test.js
@@ -97,12 +97,6 @@ describe('App.ConfigsLoader', function() {
       expect(mixin.get('allVersionsLoaded')).to.be.true;
     });
 
-    it("loadPreSelectedConfigVersion should be called", function() {
-      mixin.set('preSelectedConfigVersion', {});
-      mixin.loadServiceConfigVersionsSuccess({items: []});
-      expect(mixin.loadPreSelectedConfigVersion.calledOnce).to.be.true;
-    });
-
     it("selectedVersion should be set", function() {
       mixin.set('preSelectedConfigVersion', null);
       mixin.set('currentDefaultVersion', 'v1');


Mime
View raw message