Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9700517BF5 for ; Wed, 15 Apr 2015 20:08:11 +0000 (UTC) Received: (qmail 65631 invoked by uid 500); 15 Apr 2015 20:08:11 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 65608 invoked by uid 500); 15 Apr 2015 20:08:11 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 65599 invoked by uid 99); 15 Apr 2015 20:08:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2015 20:08:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 588ACE050B; Wed, 15 Apr 2015 20:08:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yusaku@apache.org To: commits@ambari.apache.org Message-Id: <3133951a2c1e486fa05a09ceb9c0c0f4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-10276. Install wizard (step 3): Removing hosts during bootstrap, will case unexpected behaviour (alexantonenko) Date: Wed, 15 Apr 2015 20:08:11 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-2.0.maint 1db1f436b -> ee9fb1f4e AMBARI-10276. Install wizard (step 3): Removing hosts during bootstrap, will case unexpected behaviour (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ee9fb1f4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ee9fb1f4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ee9fb1f4 Branch: refs/heads/branch-2.0.maint Commit: ee9fb1f4e0ce31b5ce71a935806216ffb6059c55 Parents: 1db1f43 Author: Alex Antonenko Authored: Mon Mar 30 19:54:19 2015 +0300 Committer: Yusaku Sako Committed: Wed Apr 15 13:07:43 2015 -0700 ---------------------------------------------------------------------- ambari-web/app/controllers/wizard/step3_controller.js | 14 +++++++------- ambari-web/app/templates/wizard/step3.hbs | 12 +++++++----- ambari-web/test/controllers/wizard/step3_test.js | 9 ++++----- 3 files changed, 18 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ee9fb1f4/ambari-web/app/controllers/wizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index 21f9e33..30f1bfe 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -68,7 +68,9 @@ App.WizardStep3Controller = Em.Controller.extend({ * is Retry button disabled * @type {bool} */ - isRetryDisabled: true, + isRetryDisabled: function() { + return (this.get('isBackDisabled')) ? this.get('isBackDisabled') : !this.get('bootHosts').filterProperty('bootStatus', 'FAILED').length; + }.property('bootHosts.@each.bootStatus', 'isBackDisabled'), /** * Is Back button disabled @@ -216,7 +218,6 @@ App.WizardStep3Controller = Em.Controller.extend({ this.set('registrationStartedAt', null); this.set('isLoaded', false); this.set('isSubmitDisabled', true); - this.set('isRetryDisabled', true); this.set('stopChecking', false); }, @@ -235,10 +236,10 @@ App.WizardStep3Controller = Em.Controller.extend({ }); App.router.get(this.get('content.controllerName')).launchBootstrap(bootStrapData, function (requestId) { if (requestId == '0') { - var controller = App.router.get(App.clusterStatus.wizardControllerName); - controller.registerErrPopup(Em.I18n.t('common.information'), Em.I18n.t('installer.step2.evaluateStep.hostRegInProgress')); + self.startBootstrap(); } else if (requestId) { self.set('content.installOptions.bootRequestId', requestId); + App.router.get(self.get('content.controllerName')).save('installOptions'); self.startBootstrap(); } }); @@ -324,7 +325,8 @@ App.WizardStep3Controller = Em.Controller.extend({ * @method removeHost */ removeHost: function (hostInfo) { - this.removeHosts([hostInfo]); + if (!this.get('isBackDisabled')) + this.removeHosts([hostInfo]); }, /** @@ -411,7 +413,6 @@ App.WizardStep3Controller = Em.Controller.extend({ */ retrySelectedHosts: function () { if (!this.get('isRetryDisabled')) { - this.set('isRetryDisabled', true); var selectedHosts = this.get('bootHosts').filterProperty('bootStatus', 'FAILED'); selectedHosts.forEach(function (_host) { _host.set('bootStatus', 'DONE'); @@ -1207,7 +1208,6 @@ App.WizardStep3Controller = Em.Controller.extend({ */ stopRegistration: function () { this.set('isSubmitDisabled', !this.get('bootHosts').someProperty('bootStatus', 'REGISTERED')); - this.set('isRetryDisabled', !this.get('bootHosts').someProperty('bootStatus', 'FAILED')); }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/ee9fb1f4/ambari-web/app/templates/wizard/step3.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/wizard/step3.hbs b/ambari-web/app/templates/wizard/step3.hbs index cb75709..b34c64d 100644 --- a/ambari-web/app/templates/wizard/step3.hbs +++ b/ambari-web/app/templates/wizard/step3.hbs @@ -24,10 +24,12 @@
- + {{#unless isBackDisabled}} + + {{/unless}} {{#unless isRetryDisabled}} @@ -91,7 +93,7 @@ data-toggle="modal" {{action hostLogPopup host target="controller"}}>{{host.bootStatusForDisplay}} - + {{t common.remove}} {{#if view.isRetryable}} http://git-wip-us.apache.org/repos/asf/ambari/blob/ee9fb1f4/ambari-web/test/controllers/wizard/step3_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step3_test.js b/ambari-web/test/controllers/wizard/step3_test.js index 5e3841c..ec0b5f3 100644 --- a/ambari-web/test/controllers/wizard/step3_test.js +++ b/ambari-web/test/controllers/wizard/step3_test.js @@ -1083,28 +1083,28 @@ describe('App.WizardStep3Controller', function () { Em.Object.create({bootStatus: 'REGISTERED'}), Em.Object.create({bootStatus: 'RUNNING'}) ], - e: {isSubmitDisabled: false, isRetryDisabled: true} + e: {isSubmitDisabled: false} }, { bootHosts: [ Em.Object.create({bootStatus: 'FAILED'}), Em.Object.create({bootStatus: 'RUNNING'}) ], - e: {isSubmitDisabled: true, isRetryDisabled: false} + e: {isSubmitDisabled: true} }, { bootHosts: [ Em.Object.create({bootStatus: 'FAILED'}), Em.Object.create({bootStatus: 'REGISTERED'}) ], - e: {isSubmitDisabled: false, isRetryDisabled: false} + e: {isSubmitDisabled: false} }, { bootHosts: [ Em.Object.create({bootStatus: 'RUNNING'}), Em.Object.create({bootStatus: 'RUNNING'}) ], - e: {isSubmitDisabled: true, isRetryDisabled: true} + e: {isSubmitDisabled: true} } ]); tests.forEach(function (test) { @@ -1112,7 +1112,6 @@ describe('App.WizardStep3Controller', function () { c.reopen({bootHosts: test.bootHosts}); c.stopRegistration(); expect(c.get('isSubmitDisabled')).to.equal(test.e.isSubmitDisabled); - expect(c.get('isRetryDisabled')).to.equal(test.e.isRetryDisabled); }); });