mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure items are properly added to the treeview when their parent has no pre-existing children. Fixes #1627
This commit is contained in:
parent
7ab0eb158f
commit
febb1b80b1
@ -820,6 +820,10 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
|
||||
ctx.b._findTreeChildNode(
|
||||
ctx.i, d, ctx
|
||||
);
|
||||
// if parent node is null
|
||||
if (!_data._pid) {
|
||||
addItemNode.apply(ctx, arguments);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}.bind(ctx),
|
||||
@ -958,9 +962,11 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
|
||||
});
|
||||
}.bind(ctx);
|
||||
|
||||
if (!ctx.t.isInode(ctx.i) && ctx.d.inode) {
|
||||
if (ctx.i && !ctx.t.isInode(ctx.i)) {
|
||||
ctx.t.setInode(ctx.i, {success: _append});
|
||||
} else {
|
||||
// Handle case for node without parent i.e. server-group
|
||||
// or if parent node's inode is true.
|
||||
_append();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user