[16/32] ambari git commit: AMBARI-20402: Assign Slaves and Clients page displays incorrect configuration unless a change is made in Assign Masters page (sangeetar)

2017-03-16 Thread ncole
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/branch-feature-AMBARI-12556
Commit: 55dc8ac9224366c0fd08d03da42176652a146ce0
Parents: 63ab0ab
Author: Sangeeta Ravindran 
Authored: Wed Mar 15 16:50:11 2017 -0700
Committer: Sangeeta Ravindran 
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();



ambari git commit: AMBARI-20402: Assign Slaves and Clients page displays incorrect configuration unless a change is made in Assign Masters page (sangeetar)

2017-03-15 Thread sangeetar
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 
Authored: Wed Mar 15 16:50:11 2017 -0700
Committer: Sangeeta Ravindran 
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();



ambari git commit: AMBARI-20402: Assign Slaves and Clients page displays incorrect configuration unless a change is made in Assign Masters page (sangeetar)

2017-03-13 Thread sangeetar
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 
Authored: Mon Mar 13 11:56:04 2017 -0700
Committer: Sangeeta Ravindran 
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);