[1/3] activemq-artemis git commit: ARTEMIS-2125 Queue preference changes to display columns not persistent through page refresh

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/3] activemq-artemis git commit: ARTEMIS-2125 Queue preference changes to display columns not persistent through page refresh

andytaylor-2
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 <[hidden email]>
Authored: Mon Oct 15 14:38:43 2018 +0900
Committer: Tadayoshi Sato <[hidden email]>
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: [

Reply | Threaded
Open this post in threaded view
|

[2/3] activemq-artemis git commit: ARTEMIS-2125 Tabs pref changes to display columns not persisted through page refresh

andytaylor-2
ARTEMIS-2125 Tabs pref changes to display columns not persisted 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/c4dd09cb
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/c4dd09cb
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/c4dd09cb

Branch: refs/heads/master
Commit: c4dd09cb8d41589a2156068bc0881df49e1149b3
Parents: fe971a7
Author: Francesco Nigro <[hidden email]>
Authored: Tue Oct 16 13:28:14 2018 +0200
Committer: Francesco Nigro <[hidden email]>
Committed: Tue Oct 16 13:41:40 2018 +0200

----------------------------------------------------------------------
 .../src/main/webapp/plugin/js/addresses.js       | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/connections.js     | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/consumers.js       | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/producers.js       | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/sessions.js        | 19 ++++++++++++++++++-
 5 files changed, 90 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c4dd09cb/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js
----------------------------------------------------------------------
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js
index b7cdab9..6cc10b0 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js
@@ -29,7 +29,7 @@ var ARTEMIS = (function(ARTEMIS) {
 
         var objectType = "address";
         var method = 'listAddresses(java.lang.String, int, int)';
-        var attributes = [
+        var defaultAttributes = [
            {
                field: 'manage',
                displayName: 'manage',
@@ -59,6 +59,23 @@ var ARTEMIS = (function(ARTEMIS) {
                 sortable: false
             }
         ];
+        ARTEMIS.log.debug('sessionStorage: addressesColumnDefs =', sessionStorage.getItem('addressesColumnDefs'));
+        var attributes = defaultAttributes;
+        if (sessionStorage.getItem('addressesColumnDefs')) {
+            attributes = JSON.parse(sessionStorage.getItem('addressesColumnDefs'));
+        }
+        $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('addressesColumnDefs', JSON.stringify(attributes));
+        });
         $scope.filter = {
             fieldOptions: [
                 {id: 'ID', name: 'ID'},

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c4dd09cb/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js
----------------------------------------------------------------------
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js
index 4843968..bab70c6 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/connections.js
@@ -29,7 +29,7 @@ var ARTEMIS = (function(ARTEMIS) {
 
         var objectType = "connection"
         var method = 'listConnections(java.lang.String, int, int)';
-        var attributes = [
+        var defaultAttributes = [
             {
                 field: 'connectionID',
                 displayName: 'ID',
@@ -73,6 +73,23 @@ var ARTEMIS = (function(ARTEMIS) {
                 width: '*'
             }
         ];
+        ARTEMIS.log.debug('sessionStorage: connectionsColumnDefs =', sessionStorage.getItem('connectionsColumnDefs'));
+        var attributes = defaultAttributes;
+        if (sessionStorage.getItem('connectionsColumnDefs')) {
+            attributes = JSON.parse(sessionStorage.getItem('connectionsColumnDefs'));
+        }
+        $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('connectionsColumnDefs', JSON.stringify(attributes));
+        });
         $scope.filter = {
             fieldOptions: [
                 {id: 'CONNECTION_ID', name: 'Connection ID'},

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c4dd09cb/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js
----------------------------------------------------------------------
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js
index a90c1c8..d4e5c63 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/consumers.js
@@ -29,7 +29,7 @@ var ARTEMIS = (function(ARTEMIS) {
 
         var objectType = "consumer";
         var method = 'listConsumers(java.lang.String, int, int)';
-        var attributes = [
+        var defaultAttributes = [
             {
                 field: 'id',
                 displayName: 'ID',
@@ -84,6 +84,23 @@ var ARTEMIS = (function(ARTEMIS) {
                 width: '*'
             }
         ];
+        ARTEMIS.log.debug('sessionStorage: consumersColumnDefs =', sessionStorage.getItem('consumersColumnDefs'));
+        var attributes = defaultAttributes;
+        if (sessionStorage.getItem('consumersColumnDefs')) {
+            attributes = JSON.parse(sessionStorage.getItem('consumersColumnDefs'));
+        }
+        $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('consumersColumnDefs', JSON.stringify(attributes));
+        });
         $scope.filter = {
             fieldOptions: [
                 {id: 'ID', name: 'ID'},

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c4dd09cb/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js
----------------------------------------------------------------------
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js
index d55754b..fe597d6 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/producers.js
@@ -29,7 +29,7 @@ var ARTEMIS = (function(ARTEMIS) {
 
         var objectType = "producer";
         var method = 'listProducers(java.lang.String, int, int)';
-        var attributes = [
+        var defaultAttributes = [
             {
                 field: 'id',
                 displayName: 'ID',
@@ -79,6 +79,23 @@ var ARTEMIS = (function(ARTEMIS) {
                 sortable: false
             }
         ];
+        ARTEMIS.log.debug('sessionStorage: producersColumnDefs =', sessionStorage.getItem('producersColumnDefs'));
+        var attributes = defaultAttributes;
+        if (sessionStorage.getItem('producersColumnDefs')) {
+            attributes = JSON.parse(sessionStorage.getItem('producersColumnDefs'));
+        }
+        $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('producersColumnDefs', JSON.stringify(attributes));
+        });
         $scope.filter = {
             fieldOptions: [
                 {id: 'ID', name: 'ID'},

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c4dd09cb/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js
----------------------------------------------------------------------
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js
index c2f575e..a1db1af 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/sessions.js
@@ -29,7 +29,7 @@ var ARTEMIS = (function(ARTEMIS) {
 
         var objectType = "sessions"
         var method = 'listSessions(java.lang.String, int, int)';
-        var attributes = [
+        var defaultAttributes = [
             {
                 field: 'id',
                 displayName: 'ID',
@@ -64,6 +64,23 @@ var ARTEMIS = (function(ARTEMIS) {
                 width: '*'
             },
         ];
+        ARTEMIS.log.debug('sessionStorage: sessionsColumnDefs =', sessionStorage.getItem('sessionsColumnDefs'));
+        var attributes = defaultAttributes;
+        if (sessionStorage.getItem('sessionsColumnDefs')) {
+            attributes = JSON.parse(sessionStorage.getItem('sessionsColumnDefs'));
+        }
+        $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('sessionsColumnDefs', JSON.stringify(attributes));
+        });
         $scope.filter = {
             fieldOptions: [
                 {id: 'ID', name: 'ID'},

Reply | Threaded
Open this post in threaded view
|

[3/3] activemq-artemis git commit: This closes #2373 ARTEMIS-2125 Tabs preference changes to display columns not persistent through page refresh

andytaylor-2
In reply to this post by andytaylor-2
This closes #2373 ARTEMIS-2125 Tabs 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/66d5e4fb
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/66d5e4fb
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/66d5e4fb

Branch: refs/heads/master
Commit: 66d5e4fbd102dad22dd072ae53d4f619a0fb3fc9
Parents: 0d89eb3 c4dd09c
Author: andytaylor <[hidden email]>
Authored: Wed Oct 17 10:14:55 2018 +0100
Committer: andytaylor <[hidden email]>
Committed: Wed Oct 17 10:14:55 2018 +0100

----------------------------------------------------------------------
 .../src/main/webapp/plugin/js/addresses.js       | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/connections.js     | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/consumers.js       | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/producers.js       | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/queues.js          | 19 ++++++++++++++++++-
 .../src/main/webapp/plugin/js/sessions.js        | 19 ++++++++++++++++++-
 6 files changed, 108 insertions(+), 6 deletions(-)
----------------------------------------------------------------------