ARTEMIS-2125 Tabs pref changes to display columns not persisted through page refresh
This commit is contained in:
parent
fe971a7a97
commit
c4dd09cb8d
|
@ -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'},
|
||||
|
|
|
@ -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'},
|
||||
|
|
|
@ -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'},
|
||||
|
|
|
@ -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'},
|
||||
|
|
|
@ -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'},
|
||||
|
|
Loading…
Reference in New Issue