This is an automated email from the ASF dual-hosted git repository. adoroszlai pushed a commit to branch merge-trunk-into-branch-feature-AMBARI-14714 in repository https://gitbox.apache.org/repos/asf/ambari.git
commit 73bcf441f49c77403c35f133f6baa7f68fedfd7e Merge: 20b6355 12fb707 Author: Doroszlai, Attila <[email protected]> AuthorDate: Mon May 14 20:42:29 2018 +0200 Merge remote-tracking branch 'origin/branch-feature-AMBARI-14714' into merge-trunk-into-branch-feature-AMBARI-14714 ambari-web/app/controllers.js | 2 - .../app/controllers/global/cluster_controller.js | 37 - ambari-web/app/controllers/installer.js | 299 +----- .../app/controllers/wizard/step1_controller.js | 479 --------- .../app/controllers/wizard/step4_controller.js | 642 ------------ ambari-web/app/router.js | 8 +- ambari-web/app/routes/add_service_routes.js | 4 +- ambari-web/app/routes/installer.js | 50 - ambari-web/app/routes/main.js | 4 +- ambari-web/app/templates/wizard/step1.hbs | 262 ----- .../step1/public_option_disabled_window_body.hbs | 26 - .../app/templates/wizard/step1/vdf_upload.hbs | 40 - .../templates/wizard/step1_addLocalRepository.hbs | 55 - ambari-web/app/utils/ajax/ajax.js | 40 - ambari-web/app/views.js | 2 - .../main/admin/stack_upgrade/services_view.js | 131 --- ambari-web/app/views/wizard/step1_view.js | 326 ------ .../controllers/global/cluster_controller_test.js | 194 ---- ambari-web/test/controllers/installer_test.js | 239 +---- ambari-web/test/controllers/wizard/step1_test.js | 403 -------- ambari-web/test/controllers/wizard/step4_test.js | 1084 -------------------- ambari-web/test/views/wizard/step1_view_test.js | 220 ---- ambari-web/test/views/wizard/step4_view_test.js | 21 - 23 files changed, 11 insertions(+), 4557 deletions(-) diff --cc ambari-web/app/controllers/installer.js index 0a805d3,06c41f0..79302ca --- a/ambari-web/app/controllers/installer.js +++ b/ambari-web/app/controllers/installer.js @@@ -201,36 -193,7 +195,13 @@@ App.InstallerController = App.WizardCon this.setDBProperty('hosts', dbHosts); }, + cancelInstall: function() { + return App.showConfirmationPopup(() => { + App.router.get('applicationController').goToAdminView(); + }); + }, + /** - * Load services data. Will be used at <code>Select services(step4)</code> step - */ - loadServices: function () { - var dfd = $.Deferred(); - var self = this; - var stackServices = App.StackService.find().mapProperty('serviceName'); - if (!(stackServices.length && App.StackService.find().objectAt(0).get('stackVersion') === App.get('currentStackVersionNumber'))) { - this.loadServiceComponents().complete(function () { - self.set('content.services', App.StackService.find().forEach(function (item) { - // user the service version from VersionDefinition - var serviceInStack = App.Stack.find().findProperty('isSelected').get('stackServices').findProperty('name', item.get('serviceName')); - var serviceVersionDisplay = serviceInStack ? serviceInStack.get('latestVersion') : item.get('serviceVersion'); - item.set('serviceVersionDisplay', serviceVersionDisplay); - })); - dfd.resolve(); - }); - } else { - dfd.resolve(); - } - return dfd.promise(); - }, - - /** * Load data for services selected from mpacks. Will be used at <code>Download Mpacks</code> step submit action. * * @param {string} stackName @@@ -258,13 -221,8 +229,8 @@@ const message = Em.I18n.t('installer.error.mpackServiceInfo'); this.addError(message); - // App.showAlertPopup( - // Em.I18n.t('common.error'), //header - // message //body - // ); - return message; - + console.log(`${message} ${status} - ${error}`); }, diff --cc ambari-web/test/controllers/installer_test.js index cd4a367,42fc5d2..88234b8 --- a/ambari-web/test/controllers/installer_test.js +++ b/ambari-web/test/controllers/installer_test.js @@@ -1420,41 -1185,8 +1185,41 @@@ describe('App.InstallerController', fun }); it('Should return controller for the step name provided.', function () { - var stepController = installerController.getStepController("step1"); - expect(stepController).to.equal(wizardStep1Controller); + var stepController = installerController.getStepController("step0"); + expect(stepController).to.equal(wizardStep0Controller); }); }); + + describe('#finish', function() { + beforeEach(function() { + sinon.stub(installerController, 'setCurrentStep'); + sinon.stub(installerController, 'clearStorageData'); + sinon.stub(installerController, 'clearServiceConfigProperties'); + sinon.stub(App.themesMapper, 'resetModels'); + installerController.finish(); + }); + afterEach(function() { + installerController.setCurrentStep.restore(); + installerController.clearStorageData.restore(); + installerController.clearServiceConfigProperties.restore(); + App.themesMapper.resetModels.restore(); + }); + + it('setCurrentStep should be called', function() { + expect(installerController.setCurrentStep.calledWith('0')).to.be.true; + }); + + it('clearStorageData should be called', function() { + expect(installerController.clearStorageData.calledOnce).to.be.true; + }); + + it('clearServiceConfigProperties should be called', function() { + expect(installerController.clearServiceConfigProperties.calledOnce).to.be.true; + }); + + it('App.themesMapper.resetModels should be called', function() { + expect(App.themesMapper.resetModels.calledOnce).to.be.true; + }); + }); + }); -- To stop receiving notification emails like this one, please contact [email protected].
