You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/03/16 20:01:52 UTC
[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)
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 <sa...@apache.org>
Authored: Wed Mar 15 16:50:11 2017 -0700
Committer: Sangeeta Ravindran <sa...@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();