AMBARI-7603. Slider View: Going backward and forward on create app wizard loses values (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/051f0705 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/051f0705 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/051f0705 Branch: refs/heads/branch-alerts-dev Commit: 051f0705bcde09387952e14ec805b5324f9f4cc4 Parents: b10cb64 Author: Alex Antonenko <[email protected]> Authored: Thu Oct 2 01:38:10 2014 +0300 Committer: Alex Antonenko <[email protected]> Committed: Thu Oct 2 03:27:10 2014 +0300 ---------------------------------------------------------------------- .../slider/src/main/resources/ui/app/assets/index.html | 9 --------- .../ui/app/controllers/createAppWizard/step3_controller.js | 9 +++++++-- 2 files changed, 7 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/051f0705/contrib/views/slider/src/main/resources/ui/app/assets/index.html ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/index.html b/contrib/views/slider/src/main/resources/ui/app/assets/index.html index baa534e..0094188 100755 --- a/contrib/views/slider/src/main/resources/ui/app/assets/index.html +++ b/contrib/views/slider/src/main/resources/ui/app/assets/index.html @@ -42,14 +42,5 @@ <script src="./javascripts/app.js"></script> <script>require('initialize');</script> - <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> - <script> - (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= - function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; - e=o.createElement(i);r=o.getElementsByTagName(i)[0]; - e.src='//www.google-analytics.com/analytics.js'; - r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); - ga('create','UA-XXXXX-X');ga('send','pageview'); - </script> </body> </html> http://git-wip-us.apache.org/repos/asf/ambari/blob/051f0705/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js index ac635cb..308378d 100644 --- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js +++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js @@ -112,7 +112,9 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({ * @method initConfigs */ initConfigs: function (setDefaults) { - var newAppConfigs = this.get('newAppConfigs') || {}, + var self = this, + newAppConfigs = this.get('newAppConfigs') || {}, + defaultConfigs = self.get('appWizardController.newApp.appType.configs'); configs = Em.A(), configsSet = $.extend(true, [], this.get('configsSet')), allSetConfigs = {}, @@ -122,6 +124,9 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({ configsSet.forEach(function (item) { item.configNames.forEach(function (configName) { allSetConfigs[configName] = item; + if(!newAppConfigs[configName] && defaultConfigs && defaultConfigs[configName]){ + newAppConfigs[configName] = defaultConfigs[configName]; + } }); }); @@ -163,7 +168,7 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({ }, this); this.set('configs', configs); - }.observes('newAppConfigs'), + }, /** * initialize dependencies map for config set by name
