ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [36/51] [abbrv] ambari git commit: AMBARI-14085 Services loaded in model unsorted. (atkach)
Date Wed, 23 Dec 2015 15:07:15 GMT
AMBARI-14085 Services loaded in model unsorted. (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e82d8f2339dc9c483a5dc0ef0baa187fb660696e
Parents: 2b9e278
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Tue Dec 22 13:52:11 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Tue Dec 22 17:15:53 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service.js |  3 ++-
 ambari-web/app/mappers/service_mapper.js   |  2 ++
 ambari-web/app/views/main/service/menu.js  | 13 ++++---------
 3 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e82d8f23/ambari-web/app/controllers/main/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js
index 1005533..8fda05a 100644
--- a/ambari-web/app/controllers/main/service.js
+++ b/ambari-web/app/controllers/main/service.js
@@ -17,6 +17,7 @@
  */
 
 var App = require('app');
+var misc = require('utils/misc');
 
 App.MainServiceController = Em.ArrayController.extend({
 
@@ -29,7 +30,7 @@ App.MainServiceController = Em.ArrayController.extend({
     if (!App.router.get('clusterController.isLoaded')) {
       return [];
     }
-    return App.Service.find();
+    return misc.sortByOrder(App.StackService.find().mapProperty('serviceName'), App.Service.find().toArray());
   }.property('App.router.clusterController.isLoaded').volatile(),
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/e82d8f23/ambari-web/app/mappers/service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_mapper.js b/ambari-web/app/mappers/service_mapper.js
index e62ab33..9c21789 100644
--- a/ambari-web/app/mappers/service_mapper.js
+++ b/ambari-web/app/mappers/service_mapper.js
@@ -16,6 +16,7 @@
  */
 
 var App = require('app');
+var misc = require('utils/misc');
 
 App.serviceMapper = App.QuickDataMapper.create({
   model: App.Service,
@@ -55,6 +56,7 @@ App.serviceMapper = App.QuickDataMapper.create({
         App.serviceMetricsMapper.mapExtendedModel(item);
         return self.parseIt(item, self.get('config'));
       });
+      parsedCacheServices = misc.sortByOrder(App.StackService.find().mapProperty('serviceName'),
parsedCacheServices);
       App.store.loadMany(this.get('model'), parsedCacheServices);
       App.store.commit();
       this.set('initialAppLoad', true);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e82d8f23/ambari-web/app/views/main/service/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/menu.js b/ambari-web/app/views/main/service/menu.js
index 524fde3..cd54288 100644
--- a/ambari-web/app/views/main/service/menu.js
+++ b/ambari-web/app/views/main/service/menu.js
@@ -17,17 +17,14 @@
  */
 
 var App = require('app');
-var misc = require('utils/misc');
 
 App.MainServiceMenuView = Em.CollectionView.extend({
   disabledServices: [],
 
-  content:function () {
-    var items = App.router.get('mainServiceController.content').filter(function(item){
+  content: function () {
+    return App.router.get('mainServiceController.content').filter(function(item){
       return !this.get('disabledServices').contains(item.get('id'));
     }, this);
-    var stackServices = App.StackService.find().mapProperty('serviceName');
-    return misc.sortByOrder(stackServices, items);
   }.property('App.router.mainServiceController.content', 'App.router.mainServiceController.content.length'),
 
   didInsertElement:function () {
@@ -124,12 +121,10 @@ App.MainServiceMenuView = Em.CollectionView.extend({
 App.TopNavServiceMenuView = Em.CollectionView.extend({
   disabledServices: [],
 
-  content:function () {
-    var items = App.router.get('mainServiceController.content').filter(function(item){
+  content: function () {
+    return App.router.get('mainServiceController.content').filter(function (item) {
       return !this.get('disabledServices').contains(item.get('id'));
     }, this);
-    var stackServices = App.StackService.find().mapProperty('serviceName');
-    return misc.sortByOrder(stackServices, items);
   }.property('App.router.mainServiceController.content', 'App.router.mainServiceController.content.length'),
 
   didInsertElement:function () {


Mime
View raw message