ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-7497. Services shown in repository page are hardcoded. (Ivan Wang via jaimin)
Date Wed, 01 Oct 2014 20:12:10 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 85ce5c201 -> 2430e397b


AMBARI-7497. Services shown in repository page are hardcoded. (Ivan Wang via jaimin)


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

Branch: refs/heads/trunk
Commit: 2430e397b911863b934b49f8b1f51217de3f623f
Parents: 85ce5c2
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Wed Oct 1 13:12:12 2014 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Wed Oct 1 13:12:12 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/main/admin/repositories.js     |  7 +++----
 .../controllers/main/admin/repositories_test.js    | 17 ++++++++---------
 2 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2430e397/ambari-web/app/controllers/main/admin/repositories.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/repositories.js b/ambari-web/app/controllers/main/admin/repositories.js
index ae191d5..65e3f96 100644
--- a/ambari-web/app/controllers/main/admin/repositories.js
+++ b/ambari-web/app/controllers/main/admin/repositories.js
@@ -133,11 +133,10 @@ App.MainAdminRepositoriesController = Em.Controller.extend({
    */
   parseServicesInfo: function (currentStack, upgradeStack) {
     var result = [];
-    var displayOrder = App.StackService.displayOrder;
-    if (currentStack.stackServices.length ||  upgradeStack.stackServices.length) {
+    if (currentStack.stackServices.length || upgradeStack.stackServices.length) {
       // loop through all the service components
-      displayOrder.forEach(function (_stackServiceName) {
-        var stackService = App.StackService.find().findProperty('serviceName', _stackServiceName);
+      currentStack.stackServices.forEach(function(currentStackService) {
+        var stackService = App.StackService.find().findProperty('serviceName', currentStackService.StackServices.service_name);
         if (!!stackService) {
           var myService = Em.Object.create({
             serviceName: stackService.get('serviceName'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/2430e397/ambari-web/test/controllers/main/admin/repositories_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/repositories_test.js b/ambari-web/test/controllers/main/admin/repositories_test.js
index 53234d1..f002fc9 100644
--- a/ambari-web/test/controllers/main/admin/repositories_test.js
+++ b/ambari-web/test/controllers/main/admin/repositories_test.js
@@ -20,9 +20,8 @@
 var App = require('app');
 require('controllers/main/admin/repositories');
 
-
 describe('App.MainAdminRepositoriesController', function() {
-
+  var controller;
   var data = {
     "items": [
       {
@@ -64,24 +63,24 @@ describe('App.MainAdminRepositoriesController', function() {
     ]
   };
 
+  beforeEach(function() {
+    controller = App.MainAdminRepositoriesController.create({
+      parseServicesInfo: Em.K
+    });
+  });
+
   //todo should be verified
   describe('#updateUpgradeVersionSuccessCallback()', function () {
     it('upgrade version of stack should be "HDP-1.2.2"', function () {
       App.set('currentStackVersion', 'HDP-1.2.2');
-      var controller = App.MainAdminRepositoriesController.create({
-        parseServicesInfo: Em.K
-      });
       controller.updateUpgradeVersionSuccessCallback.call(controller, data);
       expect(controller.get('upgradeVersion')).to.equal('HDP-1.2.2');
     });
     it('if min upgrade version less then current then upgrade version equal current', function
() {
       App.set('currentStackVersion', 'HDP-1.2.2');
       data.items[0].Versions.min_upgrade_version = "1.2.3";
-      var controller = App.MainAdminRepositoriesController.create({
-        parseServicesInfo: Em.K
-      });
       controller.updateUpgradeVersionSuccessCallback.call(controller, data);
       expect(controller.get('upgradeVersion')).to.equal('HDP-1.2.2');
     })
-  })
+  });
 });


Mime
View raw message