You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/10/01 22:10:39 UTC
git commit: Revert "AMBARI-7497. Services shown in repository page
are hardcoded. (jaimin)"
Repository: ambari
Updated Branches:
refs/heads/trunk 0da1d32ea -> 85ce5c201
Revert "AMBARI-7497. Services shown in repository page are hardcoded. (jaimin)"
This reverts commit 610b21a307dbbed149a2eabfea3ae81b7d35fcb6.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/85ce5c20
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/85ce5c20
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/85ce5c20
Branch: refs/heads/trunk
Commit: 85ce5c201c8e5793ad2982ad31b9edfe0a6983e9
Parents: 0da1d32
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Oct 1 13:08:48 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Oct 1 13:10:27 2014 -0700
----------------------------------------------------------------------
.../app/controllers/main/admin/repositories.js | 7 ++++---
.../controllers/main/admin/repositories_test.js | 17 +++++++++--------
2 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/85ce5c20/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 65e3f96..ae191d5 100644
--- a/ambari-web/app/controllers/main/admin/repositories.js
+++ b/ambari-web/app/controllers/main/admin/repositories.js
@@ -133,10 +133,11 @@ App.MainAdminRepositoriesController = Em.Controller.extend({
*/
parseServicesInfo: function (currentStack, upgradeStack) {
var result = [];
- if (currentStack.stackServices.length || upgradeStack.stackServices.length) {
+ var displayOrder = App.StackService.displayOrder;
+ if (currentStack.stackServices.length || upgradeStack.stackServices.length) {
// loop through all the service components
- currentStack.stackServices.forEach(function(currentStackService) {
- var stackService = App.StackService.find().findProperty('serviceName', currentStackService.StackServices.service_name);
+ displayOrder.forEach(function (_stackServiceName) {
+ var stackService = App.StackService.find().findProperty('serviceName', _stackServiceName);
if (!!stackService) {
var myService = Em.Object.create({
serviceName: stackService.get('serviceName'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/85ce5c20/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 f002fc9..53234d1 100644
--- a/ambari-web/test/controllers/main/admin/repositories_test.js
+++ b/ambari-web/test/controllers/main/admin/repositories_test.js
@@ -20,8 +20,9 @@
var App = require('app');
require('controllers/main/admin/repositories');
+
describe('App.MainAdminRepositoriesController', function() {
- var controller;
+
var data = {
"items": [
{
@@ -63,24 +64,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');
})
- });
+ })
});