Repository: ambari
Updated Branches:
  refs/heads/trunk 63ab0ab91 -> 55dc8ac92


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/55dc8ac9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/55dc8ac9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/55dc8ac9

Branch: refs/heads/trunk
Commit: 55dc8ac9224366c0fd08d03da42176652a146ce0
Parents: 63ab0ab
Author: Sangeeta Ravindran <sangee...@apache.org>
Authored: Wed Mar 15 16:50:11 2017 -0700
Committer: Sangeeta Ravindran <sangee...@apache.org>
Committed: Wed Mar 15 16:50:11 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/55dc8ac9/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 91a740c..9813da1 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -256,6 +256,12 @@ App.AssignMasterComponents = 
Em.Mixin.create(App.HostComponentValidationMixin, A
   isLoaded: false,
 
   /**
+   * Is back from the next step
+   * @type {bool}
+   */
+  backFromNextStep: false,
+
+  /**
    * Validation error messages which don't related with any master
    */
   generalErrorMessages: [],
@@ -479,6 +485,7 @@ App.AssignMasterComponents = 
Em.Mixin.create(App.HostComponentValidationMixin, A
     this.setProperties({
       hosts: [],
       isLoaded: false,
+      backFromNextStep: false,
       selectedServicesMasters: [],
       servicesMasters: []
     });
@@ -498,6 +505,11 @@ App.AssignMasterComponents = 
Em.Mixin.create(App.HostComponentValidationMixin, A
       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.getRecommendedHosts({
       hosts: this.get('hosts').mapProperty('host_name')
     }).then(function() {
@@ -613,7 +625,8 @@ App.AssignMasterComponents = 
Em.Mixin.create(App.HostComponentValidationMixin, A
   loadComponentsRecommendationsFromServer: function(recommendationBlueprint) {
     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
       return $.Deferred().resolve().promise();

Reply via email to