You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2018/05/03 15:33:26 UTC

[ambari] branch trunk updated: AMBARI-23740 JS error after installing Ranger from Install Wizard - Smart Configs are broken - page refresh fixed the issue

This is an automated email from the ASF dual-hosted git repository.

atkach pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a163bc2  AMBARI-23740 JS error after installing Ranger from Install Wizard - Smart Configs are broken - page refresh fixed the issue
a163bc2 is described below

commit a163bc2216654e95c090a3e4599fa77149884374
Author: Andrii Tkach <at...@apache.org>
AuthorDate: Wed May 2 17:38:51 2018 +0300

    AMBARI-23740 JS error after installing Ranger from Install Wizard - Smart Configs are broken - page refresh fixed the issue
---
 ambari-web/app/controllers/installer.js         |  1 +
 ambari-web/app/mappers/configs/themes_mapper.js |  8 +++++++
 ambari-web/test/controllers/installer_test.js   | 32 +++++++++++++++++++++++++
 3 files changed, 41 insertions(+)

diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js
index 9da077b..09c90f9 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -1072,6 +1072,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, {
     this.clearStorageData();
     this.clearServiceConfigProperties();
     App.router.get('userSettingsController').postUserPref('show_bg', true);
+    App.themesMapper.resetModels();
   },
 
   /**
diff --git a/ambari-web/app/mappers/configs/themes_mapper.js b/ambari-web/app/mappers/configs/themes_mapper.js
index cd4bb05..aa6e004 100644
--- a/ambari-web/app/mappers/configs/themes_mapper.js
+++ b/ambari-web/app/mappers/configs/themes_mapper.js
@@ -68,6 +68,14 @@ App.themesMapper = App.QuickDataMapper.create({
     "sub_section_id": "sub_section_id"
   },
 
+  resetModels: function() {
+    this.get('tabModel').find().clear();
+    this.get('sectionModel').find().clear();
+    this.get('subSectionModel').find().clear();
+    this.get('subSectionTabModel').find().clear();
+    this.get('themeConditionModel').find().clear();
+  },
+
   /**
    * Mapper function for tabs
    *
diff --git a/ambari-web/test/controllers/installer_test.js b/ambari-web/test/controllers/installer_test.js
index d67b262..e0b8efc 100644
--- a/ambari-web/test/controllers/installer_test.js
+++ b/ambari-web/test/controllers/installer_test.js
@@ -1279,4 +1279,36 @@ describe('App.InstallerController', function () {
 
   });
 
+  describe('#finish', function() {
+    beforeEach(function() {
+      sinon.stub(installerController, 'setCurrentStep');
+      sinon.stub(installerController, 'clearStorageData');
+      sinon.stub(installerController, 'clearServiceConfigProperties');
+      sinon.stub(App.themesMapper, 'resetModels');
+      installerController.finish();
+    });
+    afterEach(function() {
+      installerController.setCurrentStep.restore();
+      installerController.clearStorageData.restore();
+      installerController.clearServiceConfigProperties.restore();
+      App.themesMapper.resetModels.restore();
+    });
+
+    it('setCurrentStep should be called', function() {
+      expect(installerController.setCurrentStep.calledWith('0')).to.be.true;
+    });
+
+    it('clearStorageData should be called', function() {
+      expect(installerController.clearStorageData.calledOnce).to.be.true;
+    });
+
+    it('clearServiceConfigProperties should be called', function() {
+      expect(installerController.clearServiceConfigProperties.calledOnce).to.be.true;
+    });
+
+    it('App.themesMapper.resetModels should be called', function() {
+      expect(App.themesMapper.resetModels.calledOnce).to.be.true;
+    });
+  });
+
 });

-- 
To stop receiving notification emails like this one, please contact
atkach@apache.org.