Repository: ambari Updated Branches: refs/heads/branch-2.5 f6d1816a5 -> 819d4f253
AMBARI-20402: Assign Slaves and Clients page displays incorrect configuration unless a change is made in Assign Masters page (sangeetar) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/819d4f25 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/819d4f25 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/819d4f25 Branch: refs/heads/branch-2.5 Commit: 819d4f25339476622ffe73dd64acb85e24b52969 Parents: f6d1816 Author: Sangeeta Ravindran <[email protected]> Authored: Mon Mar 13 11:56:04 2017 -0700 Committer: Sangeeta Ravindran <[email protected]> Committed: Mon Mar 13 11:56:04 2017 -0700 ---------------------------------------------------------------------- .../app/mixins/wizard/assign_master_components.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/819d4f25/ambari-web/app/mixins/wizard/assign_master_components.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js index 60c6eeb..cd0f877 100644 --- a/ambari-web/app/mixins/wizard/assign_master_components.js +++ b/ambari-web/app/mixins/wizard/assign_master_components.js @@ -269,6 +269,12 @@ App.AssignMasterComponents = Em.Mixin.create({ isInitialLayout: true, /** + * Is back from the next step + * @type {bool} + */ + backFromNextStep: false, + + /** * true if any error exists */ anyError: function() { @@ -513,6 +519,7 @@ App.AssignMasterComponents = Em.Mixin.create({ this.setProperties({ hosts: [], isLoaded: false, + backFromNextStep: false, selectedServicesMasters: [], servicesMasters: [] }); @@ -532,6 +539,11 @@ App.AssignMasterComponents = Em.Mixin.create({ this._additionalClearSteps(); } this.renderHostInfo(); + //when returning from step Assign Slaves and Clients, recommendations are already available + //set the flag so that recommendations AJAX call is not made unnecessarily + if (this.get('recommendations')) { + this.set('backFromNextStep',true); + } this.loadComponentsRecommendationsFromServer(this.loadStepCallback); }, @@ -643,7 +655,8 @@ App.AssignMasterComponents = Em.Mixin.create({ loadComponentsRecommendationsFromServer: function(callback, includeMasters) { var self = this; - if (this.get('recommendations')) { + //when returning from step Assign Slaves and Clients, backFromNextStep will be true + if (this.get('recommendations') && this.get('backFromNextStep')) { // Don't do AJAX call if recommendations has been already received // But if user returns to previous step (selecting services), stored recommendations will be cleared in routers' next handler and AJAX call will be made again callback(self.createComponentInstallationObjects(), self);
