ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-17097. Unable to uncheck Ranger Tagsync in Add Service wizard (akovalenko)
Date Wed, 08 Jun 2016 11:09:54 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 50bf6f8f3 -> 29d539af7


AMBARI-17097. Unable to uncheck Ranger Tagsync 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/29d539af
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/29d539af
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/29d539af

Branch: refs/heads/branch-2.4
Commit: 29d539af771905b4e94f766aabe41480c333509e
Parents: 50bf6f8
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Tue Jun 7 17:30:01 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Wed Jun 8 14:09:39 2016 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step6_controller.js  | 18 +++++++----
 .../test/controllers/wizard/step6_test.js       | 33 +++++++++++++++-----
 2 files changed, 38 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/29d539af/ambari-web/app/controllers/wizard/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index e1d3953..e900f47 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -445,6 +445,9 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
 
       host.checkboxes.forEach(function(checkbox) {
         checkbox.isInstalled = installedComponents.contains(checkbox.component);
+        if (checkbox.isInstalled) {
+          checkbox.checked = true;
+        }
       });
     });
   },
@@ -494,14 +497,17 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin,
{
       var checkboxes = host.checkboxes;
       var hostComponents = recommendedMap[host.hostName] || [];
       checkboxes.forEach(function (checkbox) {
-        var checked = hostComponents.contains(checkbox.component);
+        var checked;
+        if (!checkbox.isDisabled) {
+          checked = hostComponents.contains(checkbox.component);
 
-        if (checkbox.component === 'CLIENT' && !checked) {
-          checked = hostComponents.some(function(componentName) {
-            return clientComponentsMap[componentName];
-          });
+          if (checkbox.component === 'CLIENT' && !checked) {
+            checked = hostComponents.some(function (componentName) {
+              return clientComponentsMap[componentName];
+            });
+          }
+          checkbox.checked = checked;
         }
-        checkbox.checked = checked;
       });
     });
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/29d539af/ambari-web/test/controllers/wizard/step6_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step6_test.js b/ambari-web/test/controllers/wizard/step6_test.js
index bfef7ea..ed8f16a 100644
--- a/ambari-web/test/controllers/wizard/step6_test.js
+++ b/ambari-web/test/controllers/wizard/step6_test.js
@@ -259,11 +259,13 @@ describe('App.WizardStep6Controller', function () {
       checkboxes: [
         {
           component: 'C1',
-          isInstalled: false
+          isInstalled: false,
+          checked: false
         },
         {
           component: 'C2',
-          isInstalled: false
+          isInstalled: false,
+          checked: false
         }
       ]
     }];
@@ -288,6 +290,8 @@ describe('App.WizardStep6Controller', function () {
       controller.setInstalledComponents(hostsObj);
       expect(hostsObj[0].checkboxes[0].isInstalled).to.be.true;
       expect(hostsObj[0].checkboxes[1].isInstalled).to.be.false;
+      expect(hostsObj[0].checkboxes[0].checked).to.be.true;
+      expect(hostsObj[0].checkboxes[1].checked).to.be.false;
     });
   });
 
@@ -369,15 +373,23 @@ describe('App.WizardStep6Controller', function () {
       checkboxes: [
         {
           component: 'C1',
-          checked: false
+          checked: false,
+          isDisabled: false
         },
         {
           component: 'C2',
-          checked: false
+          checked: false,
+          isDisabled: true
+        },
+        {
+          component: 'C3',
+          checked: false,
+          isDisabled: false
         },
         {
           component: 'CLIENT',
-          checked: false
+          checked: false,
+          isDisabled: false
         }
       ]
     }];
@@ -389,6 +401,7 @@ describe('App.WizardStep6Controller', function () {
             name: 'g1',
             components: [
               {name: 'C1'},
+              {name: 'C2'},
               {name: 'C_CLIENT'}
             ]
           }
@@ -418,16 +431,22 @@ describe('App.WizardStep6Controller', function () {
       expect(hostsObj[0].checkboxes[0].checked).to.be.true;
     });
 
-    it("C2 should not be checked", function() {
+    it("C2 should not be checked, as it is disabled", function() {
       controller.set('content.recommendations', recommendations);
       controller.selectRecommendedComponents(hostsObj);
       expect(hostsObj[0].checkboxes[1].checked).to.be.false;
     });
 
+    it("C3 should not be checked", function() {
+      controller.set('content.recommendations', recommendations);
+      controller.selectRecommendedComponents(hostsObj);
+      expect(hostsObj[0].checkboxes[2].checked).to.be.false;
+    });
+
     it("CLIENT should be checked", function() {
       controller.set('content.recommendations', recommendations);
       controller.selectRecommendedComponents(hostsObj);
-      expect(hostsObj[0].checkboxes[2].checked).to.be.true;
+      expect(hostsObj[0].checkboxes[3].checked).to.be.true;
     });
   });
 


Mime
View raw message