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

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

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

nigrofranz
Repository: activemq-artemis
Updated Branches:
  refs/heads/2.6.x 448761a6c -> e7d26d8bb (forced update)


ARTEMIS-2125 Queue preference changes to display columns not persistent through page refresh

(cherry picked from commit fe971a7a976cf24c4fe1c05b976099e509ecde53)


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

Branch: refs/heads/2.6.x
Commit: cd6113a7afd45128b85b28421a463948dbc450ea
Parents: da1eeac
Author: Tadayoshi Sato <[hidden email]>
Authored: Mon Oct 15 14:38:43 2018 +0900
Committer: Francesco Nigro <[hidden email]>
Committed: Wed Oct 17 13:35:22 2018 +0200

----------------------------------------------------------------------
 .../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/cd6113a7/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/2] activemq-artemis git commit: ARTEMIS-2125 Tabs pref changes to display columns not persisted through page refresh

nigrofranz
ARTEMIS-2125 Tabs pref changes to display columns not persisted through page refresh

(cherry picked from commit c4dd09cb8d41589a2156068bc0881df49e1149b3)


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

Branch: refs/heads/2.6.x
Commit: e7d26d8bb623b8e6be3a25942cd0a80d7ad1ba10
Parents: cd6113a
Author: Francesco Nigro <[hidden email]>
Authored: Tue Oct 16 13:28:14 2018 +0200
Committer: Francesco Nigro <[hidden email]>
Committed: Wed Oct 17 13:35:31 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/e7d26d8b/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/e7d26d8b/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/e7d26d8b/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/e7d26d8b/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/e7d26d8b/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'},