You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2017/09/26 05:19:58 UTC
[07/50] [abbrv] ambari git commit: AMBARI-21966. "Next" button on
"Assign Masters" page gets disabled when installing Ambari. Patch 2.
(akovalenko)
AMBARI-21966. "Next" button on "Assign Masters" page gets disabled when installing Ambari. Patch 2. (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/73bd428d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/73bd428d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/73bd428d
Branch: refs/heads/branch-feature-AMBARI-14714
Commit: 73bd428de74c3a97fbcdc53e160a1d6346528ba2
Parents: 0f1099b
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed Sep 20 17:26:03 2017 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Wed Sep 20 18:06:03 2017 +0300
----------------------------------------------------------------------
.../wizard/step7/assign_master_controller.js | 5 ++++-
.../step7/assign_master_controller_test.js | 23 ++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/73bd428d/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
index e8eaf47..a44aff4 100644
--- a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
+++ b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
@@ -297,8 +297,9 @@ App.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin, App
renderHostInfo: function () {
var parentController = this.get('content.controllerName');
if (parentController) {
- this._super();
+ return this._super();
} else {
+ var dfd = $.Deferred();
var hosts = App.Host.find().toArray();
var result = [];
for (var p = 0; p < hosts.length; p++) {
@@ -315,6 +316,8 @@ App.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin, App
this.set("hosts", result);
this.sortHosts(result);
this.set('isHostsLoaded', true);
+ dfd.resolve();
+ return dfd.promise();
}
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/73bd428d/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
index fd7637e..79dad59 100644
--- a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
+++ b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js
@@ -250,6 +250,7 @@ describe('App.AssignMasterOnStep7Controller', function () {
})
]);
sinon.stub(view, 'sortHosts');
+ sinon.stub(view, 'getHosts').returns([]);
sinon.stub(numberUtils, 'bytesToSize').returns(1);
});
@@ -281,6 +282,28 @@ describe('App.AssignMasterOnStep7Controller', function () {
host_info: Em.I18n.t('installer.step5.hostInfo').fmt('host1', 1, 1)
})])).to.be.true;
});
+
+ it("should make general request to get hosts", function() {
+ view.reopen({
+ content: Em.Object.create({
+ controllerName: 'name'
+ })
+ });
+ view.renderHostInfo();
+ var args = testHelpers.findAjaxRequest('name', 'hosts.high_availability.wizard');
+ expect(args).exists;
+ });
+
+ it("should make request for installer to get hosts", function() {
+ view.reopen({
+ content: Em.Object.create({
+ controllerName: 'installerController'
+ })
+ });
+ view.renderHostInfo();
+ var args = testHelpers.findAjaxRequest('name', 'hosts.info.install');
+ expect(args).exists;
+ });
});
describe("#loadMasterComponentHosts()", function () {