ambari git commit: AMBARI-17097. Unable to uncheck Ranger Tagsync in Add Service wizard (akovalenko)

2016-06-08 Thread akovalenko
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 
Authored: Tue Jun 7 17:30:01 2016 +0300
Committer: Aleksandr Kovalenko 
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 () {
   

ambari git commit: AMBARI-17097. Unable to uncheck Ranger Tagsync in Add Service wizard (akovalenko)

2016-06-08 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk de4499546 -> fa2f440a5


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/fa2f440a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fa2f440a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fa2f440a

Branch: refs/heads/trunk
Commit: fa2f440a5fc083a53ce88e94ca9c6542ac121eb6
Parents: de44995
Author: Aleksandr Kovalenko 
Authored: Tue Jun 7 17:30:01 2016 +0300
Committer: Aleksandr Kovalenko 
Committed: Wed Jun 8 14:04:32 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/fa2f440a/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/fa2f440a/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 () {