From commits-return-53690-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Wed Oct 17 11:15:42 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4C1CB18061A for ; Wed, 17 Oct 2018 11:15:42 +0200 (CEST) Received: (qmail 50827 invoked by uid 500); 17 Oct 2018 09:15:41 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 50813 invoked by uid 99); 17 Oct 2018 09:15:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2018 09:15:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F0B48DFC43; Wed, 17 Oct 2018 09:15:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: andytaylor@apache.org To: commits@activemq.apache.org Date: Wed, 17 Oct 2018 09:15:40 -0000 Message-Id: <04f786e222614027817fc114245389a2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] activemq-artemis git commit: ARTEMIS-2125 Queue preference changes to display columns not persistent through page refresh Repository: activemq-artemis Updated Branches: refs/heads/master 0d89eb3c3 -> 66d5e4fbd ARTEMIS-2125 Queue preference changes to display columns not persistent through page refresh Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/fe971a7a Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/fe971a7a Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/fe971a7a Branch: refs/heads/master Commit: fe971a7a976cf24c4fe1c05b976099e509ecde53 Parents: 0d89eb3 Author: Tadayoshi Sato Authored: Mon Oct 15 14:38:43 2018 +0900 Committer: Tadayoshi Sato Committed: Mon Oct 15 14:38:43 2018 +0900 ---------------------------------------------------------------------- .../src/main/webapp/plugin/js/queues.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fe971a7a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js ---------------------------------------------------------------------- diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js index 15f8bac..e43d88a 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js @@ -29,7 +29,7 @@ var ARTEMIS = (function(ARTEMIS) { var objectType = "queue"; var method = 'listQueues(java.lang.String, int, int)'; - var attributes = [ + var defaultAttributes = [ { field: 'manage', displayName: 'manage', @@ -148,6 +148,23 @@ var ARTEMIS = (function(ARTEMIS) { visible: false } ]; + ARTEMIS.log.debug('sessionStorage: queuesColumnDefs =', sessionStorage.getItem('queuesColumnDefs')); + var attributes = defaultAttributes; + if (sessionStorage.getItem('queuesColumnDefs')) { + attributes = JSON.parse(sessionStorage.getItem('queuesColumnDefs')); + } + $scope.$on('ngGridEventColumns', function (newColumns) { + ARTEMIS.log.debug('ngGridEventColumns:', newColumns); + var visibles = newColumns.targetScope.columns.reduce(function (visibles, column) { + visibles[column.field] = column.visible; + return visibles; + }, {}); + ARTEMIS.log.debug('ngGridEventColumns: visibles =', visibles); + attributes.forEach(function (attribute) { + attribute.visible = visibles[attribute.field]; + }); + sessionStorage.setItem('queuesColumnDefs', JSON.stringify(attributes)); + }); $scope.filter = { fieldOptions: [