Repository: ambari Updated Branches: refs/heads/trunk b9f87c180 -> 54fa239e2
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/54fa239e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/54fa239e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/54fa239e Branch: refs/heads/trunk Commit: 54fa239e20d5f8ed723b448602bccfcc6cfd64c0 Parents: b9f87c1 Author: Andrii Tkach <atk...@hortonworks.com> Authored: Thu Nov 26 14:15:36 2015 +0200 Committer: Andrii Tkach <atk...@hortonworks.com> Committed: Thu Nov 26 14:15:36 2015 +0200 ---------------------------------------------------------------------- ambari-web/app/mappers/service_mapper.js | 2 ++ ambari-web/app/views/main/service/menu.js | 12 ++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/54fa239e/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/54fa239e/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..e70dea2 100644 --- a/ambari-web/app/views/main/service/menu.js +++ b/ambari-web/app/views/main/service/menu.js @@ -22,12 +22,10 @@ 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 +122,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 () {