Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D935E175A3 for ; Fri, 7 Nov 2014 20:58:28 +0000 (UTC) Received: (qmail 18527 invoked by uid 500); 7 Nov 2014 20:58:28 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 18496 invoked by uid 500); 7 Nov 2014 20:58:28 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 18487 invoked by uid 99); 7 Nov 2014 20:58:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2014 20:58:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5B3A299D95C; Fri, 7 Nov 2014 20:58:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: xiwang@apache.org To: commits@ambari.apache.org Message-Id: <9ca02f03860847439471eabe3ccc0c20@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-8196. Config History: service/group filtered results should be internally sorted by version.(xiwang) Date: Fri, 7 Nov 2014 20:58:28 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-1.7.0 0856dda00 -> 00cde11f4 AMBARI-8196. Config History: service/group filtered results should be internally sorted by version.(xiwang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/00cde11f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/00cde11f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/00cde11f Branch: refs/heads/branch-1.7.0 Commit: 00cde11f478911469702e127bd68ab98e69de234 Parents: 0856dda Author: Xi Wang Authored: Thu Nov 6 18:21:33 2014 -0800 Committer: Xi Wang Committed: Fri Nov 7 12:51:25 2014 -0800 ---------------------------------------------------------------------- .../main/dashboard/config_history_controller.js | 29 ++++++++++++++++++++ .../app/mixins/common/table_server_mixin.js | 2 -- 2 files changed, 29 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/00cde11f/ambari-web/app/controllers/main/dashboard/config_history_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/dashboard/config_history_controller.js b/ambari-web/app/controllers/main/dashboard/config_history_controller.js index 4faff54..520fe3e 100644 --- a/ambari-web/app/controllers/main/dashboard/config_history_controller.js +++ b/ambari-web/app/controllers/main/dashboard/config_history_controller.js @@ -218,5 +218,34 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin }) } }, App.componentsUpdateInterval)); + }, + + /** + * get sort properties from local db. A overridden funtion from parent + * @return {Array} + */ + getSortProps: function () { + var savedSortConditions = App.db.getSortingStatuses(this.get('name')) || [], + sortProperties = this.get('sortProps'), + sortParams = []; + + savedSortConditions.forEach(function (sort) { + var property = sortProperties.findProperty('name', sort.name); + if (property && (sort.status === 'sorting_asc' || sort.status === 'sorting_desc')) { + property.value = sort.status.replace('sorting_', ''); + property.type = 'SORT'; + if (property.name == 'serviceVersion'){ + property.key = "service_name." + sort.status.replace('sorting_', '') + ",service_config_version"; + property.value = "desc"; + } + if (property.name == 'configGroup'){ + property.key = "group_name." + sort.status.replace('sorting_', '') + ",service_config_version"; + property.value = "desc"; + } + + sortParams.push(property); + } + }); + return sortParams; } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/00cde11f/ambari-web/app/mixins/common/table_server_mixin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/common/table_server_mixin.js b/ambari-web/app/mixins/common/table_server_mixin.js index 33357ea..c0610b0 100644 --- a/ambari-web/app/mixins/common/table_server_mixin.js +++ b/ambari-web/app/mixins/common/table_server_mixin.js @@ -78,10 +78,8 @@ App.TableServerMixin = Em.Mixin.create({ var savedSortConditions = App.db.getSortingStatuses(this.get('name')) || [], sortProperties = this.get('sortProps'), sortParams = []; - savedSortConditions.forEach(function (sort) { var property = sortProperties.findProperty('name', sort.name); - if (property && (sort.status === 'sorting_asc' || sort.status === 'sorting_desc')) { property.value = sort.status.replace('sorting_', ''); property.type = 'SORT';