mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Treat the Array different from the Object to make sure session tracking
works well with it.
This commit is contained in:
parent
c8406a5994
commit
b383c67fa5
@ -114,6 +114,7 @@ function(_, pgAdmin, $, Backbone) {
|
|||||||
self.sessAttrs = {};
|
self.sessAttrs = {};
|
||||||
self.origSessAttrs = {};
|
self.origSessAttrs = {};
|
||||||
self.objects = [];
|
self.objects = [];
|
||||||
|
self.arrays = [];
|
||||||
self.attrName = options.attrName,
|
self.attrName = options.attrName,
|
||||||
self.top = (options.top || self.collection && self.collection.top || self.collection || self);
|
self.top = (options.top || self.collection && self.collection.top || self.collection || self);
|
||||||
self.handler = options.handler ||
|
self.handler = options.handler ||
|
||||||
@ -129,7 +130,7 @@ function(_, pgAdmin, $, Backbone) {
|
|||||||
|
|
||||||
switch(s.type) {
|
switch(s.type) {
|
||||||
case 'array':
|
case 'array':
|
||||||
self.objects.push(s.id);
|
self.arrays.push(s.id);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'collection':
|
case 'collection':
|
||||||
@ -385,6 +386,19 @@ function(_, pgAdmin, $, Backbone) {
|
|||||||
res[k] = (obj && obj.toJSON());
|
res[k] = (obj && obj.toJSON());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (session) {
|
||||||
|
_.each(
|
||||||
|
self.arrays,
|
||||||
|
function(a) {
|
||||||
|
/*
|
||||||
|
* For session changes, we only need the modified data to be
|
||||||
|
* transformed to JSON data.
|
||||||
|
*/
|
||||||
|
if (res[a] && res[a] instanceof Array) {
|
||||||
|
res[a] = JSON.stringify(res[a]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
startNewSession: function() {
|
startNewSession: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user