ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [35/50] [abbrv] ambari git commit: AMBARI-18788 Checkboxes for installed services aren't disabled in Add Service Wizard. (ababiichuk)
Date Fri, 04 Nov 2016 16:55:16 GMT
AMBARI-18788 Checkboxes for installed services aren't disabled in Add Service Wizard. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/35cb3968
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/35cb3968
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/35cb3968

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 35cb39682551f05d100fdf4975a61eaf5cc58340
Parents: 2ebc6ed
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Thu Nov 3 17:52:34 2016 +0200
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Thu Nov 3 18:50:03 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/mappers/stack_service_mapper.js | 6 +++---
 ambari-web/app/models/stack_service.js         | 4 +++-
 ambari-web/test/models/stack_service_test.js   | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/35cb3968/ambari-web/app/mappers/stack_service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/stack_service_mapper.js b/ambari-web/app/mappers/stack_service_mapper.js
index fa8f3f3..888dcdf 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -33,7 +33,7 @@ App.stackServiceMapper = App.QuickDataMapper.create({
     stack_name: 'stack_name',
     stack_version: 'stack_version',
     selection: 'selection',
-    is_disabled: 'is_disabled',
+    is_mandatory: 'is_mandatory',
     is_selected: 'is_selected',
     is_installed: 'is_installed',
     is_installable: 'is_installable',
@@ -120,8 +120,8 @@ App.stackServiceMapper = App.QuickDataMapper.create({
       if (stackService.selection === "TECH_PREVIEW") {
         stackService.is_selected = false;
       }
-      if(stackService.selection === "MANDATORY" || stackService.is_installed) {
-        stackService.is_disabled = true;
+      if(stackService.selection === "MANDATORY") {
+        stackService.is_mandatory = true;
       }
       result.push(this.parseIt(stackService, this.get('config')));
     }, this);

http://git-wip-us.apache.org/repos/asf/ambari/blob/35cb3968/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index 756c177..0136ec3 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -36,7 +36,7 @@ App.StackService = DS.Model.extend({
   stackName: DS.attr('string'),
   stackVersion: DS.attr('string'),
   selection: DS.attr('string'),
-  isDisabled: DS.attr('boolean', {defaultValue: false}),
+  isMandatory: DS.attr('boolean', {defaultValue: false}),
   isSelected: DS.attr('boolean', {defaultValue: true}),
   isInstalled: DS.attr('boolean', {defaultValue: false}),
   isInstallable: DS.attr('boolean', {defaultValue: true}),
@@ -46,6 +46,8 @@ App.StackService = DS.Model.extend({
   configs: DS.attr('array'),
   requiredServices: DS.attr('array', {defaultValue: []}),
 
+  isDisabled: Em.computed.or('isMandatory', 'isInstalled'),
+
   /**
    * @type {String[]}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/35cb3968/ambari-web/test/models/stack_service_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/stack_service_test.js b/ambari-web/test/models/stack_service_test.js
index 0d3fdf6..9f12e88 100644
--- a/ambari-web/test/models/stack_service_test.js
+++ b/ambari-web/test/models/stack_service_test.js
@@ -283,5 +283,7 @@ describe('App.StackService', function () {
     });
   });
 
+  App.TestAliases.testAsComputedOr(ss, 'isDisabled', ['isMandatory', 'isInstalled']);
+
 
 });


Mime
View raw message