You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/11/19 20:14:06 UTC

ambari git commit: AMBARI-8387. Alerts UI: Create definition details for 5 types of definitions. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 112300cd4 -> 92f794eb3


AMBARI-8387. Alerts UI: Create definition details for 5 types of definitions. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 92f794eb3c8bf19c915797fc0bb983b6c0de8474
Parents: 112300c
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed Nov 19 20:54:16 2014 +0200
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Wed Nov 19 20:54:16 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/mappers/stack_service_mapper.js         | 4 ++++
 ambari-web/app/models/stack_service.js                 | 5 +++--
 ambari-web/app/routes/add_service_routes.js            | 2 +-
 ambari-web/app/routes/installer.js                     | 2 +-
 ambari-web/test/models/stack_service_test.js           | 8 ++++++++
 ambari-web/test/views/common/custom_date_popup_test.js | 4 ++--
 6 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/92f794eb/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 73e866f..eab2576 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -33,6 +33,7 @@ App.stackServiceMapper = App.QuickDataMapper.create({
     stack_version: 'stack_version',
     is_selected: 'is_selected',
     is_installed: 'is_installed',
+    is_installable: 'is_installable',
     required_services: 'required_services',
     service_check_supported: 'service_check_supported',
     service_components_key: 'service_components',
@@ -90,6 +91,9 @@ App.stackServiceMapper = App.QuickDataMapper.create({
       }, this);
       stackService.stack_id = stackService.stack_name + '-' + stackService.stack_version;
       stackService.service_components = serviceComponents;
+      // @todo: replace with server response value after API implementation
+      stackService.is_installable = !['KERBEROS'].contains(stackService.service_name);
+      stackService.is_selected = stackService.is_installable;
       result.push(this.parseIt(stackService, this.get('config')));
     }, this);
     App.store.loadMany(this.get('component_model'), stackServiceComponents);

http://git-wip-us.apache.org/repos/asf/ambari/blob/92f794eb/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 5c91e41..d28da98 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -36,6 +36,7 @@ App.StackService = DS.Model.extend({
   stackVersion: DS.attr('string'),
   isSelected: DS.attr('boolean', {defaultValue: true}),
   isInstalled: DS.attr('boolean', {defaultValue: false}),
+  isInstallable: DS.attr('boolean', {defaultValue: true}),
   stack: DS.belongsTo('App.Stack'),
   serviceComponents: DS.hasMany('App.StackServiceComponent'),
   configs: DS.attr('array'),
@@ -78,8 +79,8 @@ App.StackService = DS.Model.extend({
 
   isHiddenOnSelectServicePage: function () {
     var hiddenServices = ['MAPREDUCE2'];
-    return hiddenServices.contains(this.get('serviceName'));
-  }.property('serviceName'),
+    return hiddenServices.contains(this.get('serviceName')) || !this.get('isInstallable');
+  }.property('serviceName', 'isInstallable'),
 
   // Is the service required for monitoring of other hadoop ecosystem services
   isMonitoringService: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/92f794eb/ambari-web/app/routes/add_service_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js
index 8c1326e..5069c83 100644
--- a/ambari-web/app/routes/add_service_routes.js
+++ b/ambari-web/app/routes/add_service_routes.js
@@ -103,7 +103,7 @@ module.exports = App.WizardRoute.extend({
       controller.set('hideBackButton', true);
       controller.dataLoading().done(function () {
         controller.loadAllPriorSteps();
-        controller.connectOutlet('wizardStep4', controller.get('content.services'));
+        controller.connectOutlet('wizardStep4', controller.get('content.services').filterProperty('isInstallable', true));
       })
     },
     next: function (router) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/92f794eb/ambari-web/app/routes/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js
index 3877fba..cab8c39 100644
--- a/ambari-web/app/routes/installer.js
+++ b/ambari-web/app/routes/installer.js
@@ -237,7 +237,7 @@ module.exports = Em.Route.extend({
       var controller = router.get('installerController');
       controller.setCurrentStep('4');
       controller.loadAllPriorSteps().done(function () {
-        controller.connectOutlet('wizardStep4', App.StackService.find());
+        controller.connectOutlet('wizardStep4', App.StackService.find().filterProperty('isInstallable', true));
       });
     },
     back: Em.Router.transitionTo('step3'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/92f794eb/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 efab9e0..65cd41c 100644
--- a/ambari-web/test/models/stack_service_test.js
+++ b/ambari-web/test/models/stack_service_test.js
@@ -109,10 +109,17 @@ describe('App.StackService', function () {
     var testCases = [
       {
         serviceName: 'HDFS',
+        isInstallable: true,
         result: false
       },
       {
         serviceName: 'MAPREDUCE2',
+        isInstallable: true,
+        result: true
+      },
+      {
+        serviceName: 'KERBEROS',
+        isInstallable: false,
         result: true
       }
     ];
@@ -120,6 +127,7 @@ describe('App.StackService', function () {
     testCases.forEach(function (test) {
       it('service name - ' + test.serviceName, function () {
         ss.set('serviceName', test.serviceName);
+        ss.set('isInstallable', test.isInstallable);
         ss.propertyDidChange('isHiddenOnSelectServicePage');
         expect(ss.get('isHiddenOnSelectServicePage')).to.equal(test.result);
       });

http://git-wip-us.apache.org/repos/asf/ambari/blob/92f794eb/ambari-web/test/views/common/custom_date_popup_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/custom_date_popup_test.js b/ambari-web/test/views/common/custom_date_popup_test.js
index 9116248..1a5ae13 100644
--- a/ambari-web/test/views/common/custom_date_popup_test.js
+++ b/ambari-web/test/views/common/custom_date_popup_test.js
@@ -54,8 +54,8 @@ describe('CustomDatePopup', function() {
       customDatePopup.set('customDateFormFields.startDate', '11/11/11');
       customDatePopup.set('customDateFormFields.endDate', '11/12/11');
       popup.onPrimary();
-      expect(context.get('actualValues.startTime')).to.be.equal(1320966000000);
-      expect(context.get('actualValues.endTime')).to.equal(1321052400000);
+      expect(context.get('actualValues.startTime')).to.equal(new Date('11/11/11 01:00 AM').getTime());
+      expect(context.get('actualValues.endTime')).to.equal(new Date('11/12/11 01:00 AM').getTime());
     });
   });
 });