This is an automated email from the ASF dual-hosted git repository. atkach pushed a commit to branch branch-2.6 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.6 by this push: new 63cfebb AMBARI-23283 Install Wizard > Select Version page: the user cannot proceed with Redhat Satellite option 63cfebb is described below commit 63cfebb176bca5e204f9fdc84a34e2cc03ffbc02 Author: Andrii Tkach <atk...@apache.org> AuthorDate: Tue Mar 20 13:41:15 2018 +0200 AMBARI-23283 Install Wizard > Select Version page: the user cannot proceed with Redhat Satellite option --- ambari-web/app/views/wizard/step1_view.js | 15 ++++++------- ambari-web/test/views/wizard/step1_view_test.js | 28 ++++++++----------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/ambari-web/app/views/wizard/step1_view.js b/ambari-web/app/views/wizard/step1_view.js index 8c50e8d..f0a8111 100644 --- a/ambari-web/app/views/wizard/step1_view.js +++ b/ambari-web/app/views/wizard/step1_view.js @@ -69,14 +69,14 @@ App.WizardStep1View = Em.View.extend({ * * @type {bool} */ - isSubmitDisabled: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 'isAnyOsEmpty', 'controller.content.isCheckInProgress', 'App.router.btnClickInProgress', '!controller.isLoadingComplete'), + isSubmitDisabled: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 'isNoOsFilled', 'controller.content.isCheckInProgress', 'App.router.btnClickInProgress', '!controller.isLoadingComplete'), /** * Show warning message flag * * @type {bool} */ - warningExist: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 'isAnyOsEmpty'), + warningExist: Em.computed.or('invalidFormatUrlExist', 'isNoOsChecked', 'isNoOsFilled'), skipVerifyBaseUrl: Em.computed.or('controller.selectedStack.skipValidationChecked', 'controller.selectedStack.useRedhatSatellite'), @@ -202,19 +202,16 @@ App.WizardStep1View = Em.View.extend({ }, /** - * If any OS is empty + * If all OSes are empty * @type {bool} */ - isAnyOsEmpty: function () { + isNoOsFilled: function () { var operatingSystems = this.get('controller.selectedStack.operatingSystems'); - if (Em.isNone(operatingSystems)) { + if (this.get('controller.selectedStack.useRedhatSatellite') || Em.isNone(operatingSystems)) { return false; } var selectedOS = operatingSystems.filterProperty('isSelected', true); - if (this.get('controller.selectedStack.useRedhatSatellite')) { - selectedOS = selectedOS.filter(this.isRedhat); - } - return selectedOS.someProperty('isNotFilled', true); + return selectedOS.everyProperty('isNotFilled', true); }.property('controller.selectedStack.operatingSystems.@each.isSelected', 'controller.selectedStack.operatingSystems.@each.isNotFilled', 'controller.selectedStack.useRedhatSatellite'), popoverView: Em.View.extend({ diff --git a/ambari-web/test/views/wizard/step1_view_test.js b/ambari-web/test/views/wizard/step1_view_test.js index 1472850..276d5e8 100644 --- a/ambari-web/test/views/wizard/step1_view_test.js +++ b/ambari-web/test/views/wizard/step1_view_test.js @@ -35,7 +35,7 @@ describe('App.WizardStep1View', function () { App.TestAliases.testAsComputedEveryBy(getView(), 'isNoOsChecked', 'controller.selectedStack.operatingSystems', 'isSelected', false); - App.TestAliases.testAsComputedOr(getView(), 'isSubmitDisabled', ['invalidFormatUrlExist', 'isNoOsChecked', 'isAnyOsEmpty', 'controller.content.isCheckInProgress', 'App.router.btnClickInProgress', '!controller.isLoadingComplete']); + App.TestAliases.testAsComputedOr(getView(), 'isSubmitDisabled', ['invalidFormatUrlExist', 'isNoOsChecked', 'isNoOsFilled', 'controller.content.isCheckInProgress', 'App.router.btnClickInProgress', '!controller.isLoadingComplete']); App.TestAliases.testAsComputedSomeBy(getView(), 'invalidUrlExist', 'allRepositories', 'validation', App.Repository.validation.INVALID); @@ -58,27 +58,21 @@ describe('App.WizardStep1View', function () { }); }); - describe('#isAnyOsEmpty', function() { + describe('#isNoOsFilled', function() { - it('should be true when useRedhatSatellite is true and redhat os is empty', function() { + it('should be false when useRedhatSatellite is true', function() { view.set('controller.selectedStack', Em.Object.create({ - useRedhatSatellite: true, - operatingSystems: [ - Em.Object.create({ - isSelected: true, - isNotFilled: true, - osType: 'redhat' - }) - ] + useRedhatSatellite: true })); - expect(view.get('isAnyOsEmpty')).to.be.true; + expect(view.get('isNoOsFilled')).to.be.false; }); it('should be false when operatingSystems is null', function() { view.set('controller.selectedStack', Em.Object.create({ + useRedhatSatellite: false, operatingSystems: null })); - expect(view.get('isAnyOsEmpty')).to.be.false; + expect(view.get('isNoOsFilled')).to.be.false; }); it('should be false when operatingSystem is filled', function() { @@ -91,7 +85,7 @@ describe('App.WizardStep1View', function () { }) ] })); - expect(view.get('isAnyOsEmpty')).to.be.false; + expect(view.get('isNoOsFilled')).to.be.false; }); it('should be true when operatingSystem is not filled', function() { @@ -101,14 +95,10 @@ describe('App.WizardStep1View', function () { Em.Object.create({ isSelected: true, isNotFilled: true - }), - Em.Object.create({ - isSelected: true, - isNotFilled: false }) ] })); - expect(view.get('isAnyOsEmpty')).to.be.true; + expect(view.get('isNoOsFilled')).to.be.true; }); }); -- To stop receiving notification emails like this one, please contact atk...@apache.org.