Repository: ambari Updated Branches: refs/heads/trunk 7808566db -> 52fe9f77f
AMBARI-10563 Panel with depended configs doesn't hide after "Discard" clicked. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/52fe9f77 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/52fe9f77 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/52fe9f77 Branch: refs/heads/trunk Commit: 52fe9f77f2faded84ff3142cf89dd9e5660eca20 Parents: 7808566 Author: aBabiichuk <ababiic...@cybervisiontech.com> Authored: Fri Apr 17 15:10:54 2015 +0300 Committer: aBabiichuk <ababiic...@cybervisiontech.com> Committed: Fri Apr 17 15:29:57 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/service/info/configs.js | 1 + ambari-web/test/controllers/main/service/info/config_test.js | 8 ++++++++ 2 files changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/52fe9f77/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 e406d55..3628a7a 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -1185,6 +1185,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM */ doCancel: function () { this.set('preSelectedConfigVersion', null); + this.clearDependentConfigs(); Em.run.once(this, 'onConfigGroupChange'); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/52fe9f77/ambari-web/test/controllers/main/service/info/config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/service/info/config_test.js b/ambari-web/test/controllers/main/service/info/config_test.js index eabcb0f..26ec8de 100644 --- a/ambari-web/test/controllers/main/service/info/config_test.js +++ b/ambari-web/test/controllers/main/service/info/config_test.js @@ -330,6 +330,14 @@ describe("App.MainServiceInfoConfigsController", function () { mainServiceInfoConfigsController.doCancel(); expect(Em.run.once.calledWith(mainServiceInfoConfigsController, "onConfigGroupChange")).to.equal(true); }); + + it("should clear dependent configs", function() { + mainServiceInfoConfigsController.set('groupsToSave', { HDFS: 'my cool group'}); + mainServiceInfoConfigsController.set('_dependentConfigValues', Em.A([{name: 'prop_1'}])); + mainServiceInfoConfigsController.doCancel(); + expect(App.isEmptyObject(mainServiceInfoConfigsController.get('groupsToSave'))).to.be.true; + expect(App.isEmptyObject(mainServiceInfoConfigsController.get('_dependentConfigValues'))).to.be.true; + }); }); describe("#getMasterComponentHostValue", function () {