Repository: ambari Updated Branches: refs/heads/trunk af4d8aceb -> 55c150be1
AMBARI-13636. No Properties for Flume configs in Add Service Wizard. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/55c150be Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/55c150be Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/55c150be Branch: refs/heads/trunk Commit: 55c150be188d35939f903a2f16ac756d206d91a7 Parents: af4d8ac Author: Aleksandr Kovalenko <[email protected]> Authored: Fri Oct 30 12:21:15 2015 +0200 Committer: Aleksandr Kovalenko <[email protected]> Committed: Fri Oct 30 12:21:15 2015 +0200 ---------------------------------------------------------------------- .../resourceManager/step4_controller.js | 2 +- .../main/service/reassign/step4_controller.js | 7 ++--- .../main/service/reassign/step5_controller.js | 2 +- .../main/service/reassign/step6_controller.js | 2 ++ .../main/service/reassign_controller.js | 7 +++-- .../app/mixins/wizard/wizardEnableDone.js | 7 ++--- .../wizard/wizardProgressPageController.js | 2 ++ .../main/service/reassign_controller_test.js | 31 ++++++++++++++++++-- .../test/mixins/wizard/wizardEnableDone_test.js | 17 +++++++++-- 9 files changed, 61 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js index 94060ba..697ed1a 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js @@ -20,7 +20,7 @@ var App = require('app'); require('controllers/main/admin/serviceAccounts_controller'); -App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageController.extend({ +App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, { name: "rMHighAvailabilityWizardStep4Controller", http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/app/controllers/main/service/reassign/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign/step4_controller.js b/ambari-web/app/controllers/main/service/reassign/step4_controller.js index 3f7142e..73046c8 100644 --- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js +++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js @@ -18,7 +18,9 @@ var App = require('app'); -App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageController.extend({ +App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, { + + name: "reassignMasterWizardStep4Controller", commands: [ 'stopRequiredServices', @@ -1006,7 +1008,6 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro testDBConnection: function() { this.prepareDBCheckAction(); - // this.onTaskCompleted(); }, isComponentWithDB: function() { @@ -1073,8 +1074,6 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro }.property(), prepareDBCheckAction: function() { - var ambariProperties = null; - var properties = this.get('content.serviceProperties'); var params = this.get('preparedDBProperties'); ambariProperties = App.router.get('clusterController.ambariProperties'); http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/app/controllers/main/service/reassign/step5_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign/step5_controller.js b/ambari-web/app/controllers/main/service/reassign/step5_controller.js index 5e65e61..33d8064 100644 --- a/ambari-web/app/controllers/main/service/reassign/step5_controller.js +++ b/ambari-web/app/controllers/main/service/reassign/step5_controller.js @@ -19,5 +19,5 @@ var App = require('app'); App.ReassignMasterWizardStep5Controller = Em.Controller.extend({ - + name: "reassignMasterWizardStep5Controller" }); http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/app/controllers/main/service/reassign/step6_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign/step6_controller.js b/ambari-web/app/controllers/main/service/reassign/step6_controller.js index e1cda96..5a80dc4 100644 --- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js +++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js @@ -20,6 +20,8 @@ var App = require('app'); App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, { + name: "reassignMasterWizardStep2Controller", + commands: ['stopMysqlService', 'putHostComponentsInMaintenanceMode', 'deleteHostComponents', 'startAllServices'], clusterDeployState: 'REASSIGN_MASTER_INSTALLING', http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/app/controllers/main/service/reassign_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js index 2c2f15a..1b8aa5c 100644 --- a/ambari-web/app/controllers/main/service/reassign_controller.js +++ b/ambari-web/app/controllers/main/service/reassign_controller.js @@ -23,7 +23,7 @@ App.ReassignMasterController = App.WizardController.extend({ name: 'reassignMasterController', - totalSteps: 7, + totalSteps: 6, /** * @type {string} @@ -85,7 +85,9 @@ App.ReassignMasterController = App.WizardController.extend({ ], addManualSteps: function () { - this.set('content.hasManualSteps', this.get('content.componentsWithManualCommands').contains(this.get('content.reassign.component_name'))); + var hasManualSteps = this.get('content.componentsWithManualCommands').contains(this.get('content.reassign.component_name')); + this.set('content.hasManualSteps', hasManualSteps); + this.set('totalSteps', hasManualSteps ? 6 : 4); }.observes('content.reassign.component_name'), addCheckDBStep: function () { @@ -240,6 +242,7 @@ App.ReassignMasterController = App.WizardController.extend({ var manual = App.router.reassignMasterController.get('content.componentsWithManualCommands').without('OOZIE_SERVER'); App.router.reassignMasterController.set('content.hasManualSteps', false); App.router.reassignMasterController.set('content.componentsWithManualCommands', manual); + this.set('totalSteps', 4); } } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/app/mixins/wizard/wizardEnableDone.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/wizardEnableDone.js b/ambari-web/app/mixins/wizard/wizardEnableDone.js index 1e4e175..b4f60ee 100644 --- a/ambari-web/app/mixins/wizard/wizardEnableDone.js +++ b/ambari-web/app/mixins/wizard/wizardEnableDone.js @@ -25,11 +25,10 @@ var App = require('app'); */ App.WizardEnableDone = Em.Mixin.create({ statusChangeCallback: function (data) { + var wizardController = App.router.get(this.get('content.controllerName')); this._super(data); - if (this.get('tasks.lastObject.id') === this.get('currentTaskId')) { - if (this.get('tasks.lastObject.status') === 'FAILED') { - this.set('isSubmitDisabled', false); - } + if (wizardController.get('totalSteps') == wizardController.get('currentStep') && this.get('tasks.lastObject.status') === 'FAILED') { + this.set('isSubmitDisabled', false); } } }); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/app/mixins/wizard/wizardProgressPageController.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js index e0440c4..f2af630 100644 --- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js +++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js @@ -290,6 +290,8 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, { var task = this.get('tasks').findProperty('status', 'FAILED'); task.set('showRetry', false); task.set('showRollback', false); + this.set('isSubmitDisabled', true); + this.set('isBackButtonDisabled', true); task.set('status', 'PENDING'); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/test/controllers/main/service/reassign_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/service/reassign_controller_test.js b/ambari-web/test/controllers/main/service/reassign_controller_test.js index 498cbab..461e0df 100644 --- a/ambari-web/test/controllers/main/service/reassign_controller_test.js +++ b/ambari-web/test/controllers/main/service/reassign_controller_test.js @@ -30,8 +30,35 @@ describe('App.ReassignMasterController', function () { }); describe('#totalSteps', function () { - it('check', function () { - expect(reassignMasterController.get('totalSteps')).to.equal(7); + + var cases = [ + { + componentName: 'ZOOKEEPER_SERVER', + result: 4 + }, + { + componentName: 'RESOURCE_MANAGER', + result: 4 + }, + { + componentName: 'OOZIE_SERVER', + result: 6 + }, + { + componentName: 'APP_TIMELINE_SERVER', + result: 6 + }, + { + componentName: 'NAMENODE', + result: 6 + } + ]; + + cases.forEach(function (c) { + it('check ' + c.componentName, function () { + reassignMasterController.set('content.reassign', {'component_name': c.componentName}); + expect(reassignMasterController.get('totalSteps')).to.equal(c.result); + }); reassignMasterController.set('content.reassign', {service_id:null}); }); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/55c150be/ambari-web/test/mixins/wizard/wizardEnableDone_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/mixins/wizard/wizardEnableDone_test.js b/ambari-web/test/mixins/wizard/wizardEnableDone_test.js index fafae36..7969f54 100644 --- a/ambari-web/test/mixins/wizard/wizardEnableDone_test.js +++ b/ambari-web/test/mixins/wizard/wizardEnableDone_test.js @@ -28,9 +28,22 @@ describe('App.WizardEnableDone', function () { mixedObjectInstance; beforeEach(function () { mixedObjectInstance = mixedObject.create({ - tasks: [{id: 77, status: 'FAILED'}], - currentTaskId: 77 + tasks: [{status: 'COMPLETED'}, {status: 'FAILED'}], + content: Em.Object.create({ + controllerName: 'wizardControllerName' + }) }); + sinon.stub(App.router, 'get', function () { + return Em.Object.create({ + totalSteps: 6, + currentStep: 6 + }); + } + ); + }); + + afterEach(function () { + App.router.get.restore(); }); it('#statusChangeCallback should enable done/complete button', function () {
