You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2018/04/04 13:00:36 UTC

[ambari] branch trunk updated: AMBARI-23283 Install Wizard > Select Version page: the user cannot proceed with Redhat Satellite option

This is an automated email from the ASF dual-hosted git repository.

atkach pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 5d29248  AMBARI-23283 Install Wizard > Select Version page: the user cannot proceed with Redhat Satellite option
5d29248 is described below

commit 5d29248131c3482efa4d09a9327a9ef02b68fc9c
Author: Andrii Tkach <at...@apache.org>
AuthorDate: Tue Mar 20 13:46:21 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 71ee8d5..4e37ba2 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -84,14 +84,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'),
 
@@ -211,19 +211,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 1f48a3f..ca783c8 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', 'INVALID');
 
@@ -66,27 +66,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() {
@@ -99,7 +93,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() {
@@ -109,14 +103,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
atkach@apache.org.