mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core-app): CB-2190 node parent id detection
This commit is contained in:
@@ -129,11 +129,11 @@ export class NavNodeInfoResource extends CachedMapResource<string, NavNode> {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
navNodeInfoToNavNode(node: NavNodeInfo, parentId?: string): NavNode {
|
||||
navNodeInfoToNavNode(node: NavNodeInfo, parentId?: string, requestPath?: string): NavNode {
|
||||
return {
|
||||
...node,
|
||||
objectFeatures: node.object?.features || [],
|
||||
parentId: parentId || this.get(node.id)?.parentId || ROOT_NODE_PATH,
|
||||
parentId: parentId ?? this.get(node.id)?.parentId ?? requestPath ?? ROOT_NODE_PATH,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +512,11 @@ export class NavTreeResource extends CachedMapResource<string, string[]> {
|
||||
...data.map(data => data.parentPath),
|
||||
...data.map(data => data.navNodeChildren.map(node => node.id)).flat(),
|
||||
]), [
|
||||
...data.map(data => this.navNodeInfoResource.navNodeInfoToNavNode(data.navNodeInfo)).flat(),
|
||||
...data.map(data => this.navNodeInfoResource.navNodeInfoToNavNode(
|
||||
data.navNodeInfo,
|
||||
undefined,
|
||||
data.parentPath
|
||||
)).flat(),
|
||||
...data.map(
|
||||
data => data.navNodeChildren.map(
|
||||
node => this.navNodeInfoResource.navNodeInfoToNavNode(node, data.parentPath)
|
||||
@@ -537,7 +541,11 @@ export class NavTreeResource extends CachedMapResource<string, string[]> {
|
||||
data.parentPath,
|
||||
...data.navNodeChildren.map(node => node.id),
|
||||
]), [
|
||||
this.navNodeInfoResource.navNodeInfoToNavNode(data.navNodeInfo),
|
||||
this.navNodeInfoResource.navNodeInfoToNavNode(
|
||||
data.navNodeInfo,
|
||||
undefined,
|
||||
data.parentPath
|
||||
),
|
||||
...data.navNodeChildren.map(node => this.navNodeInfoResource.navNodeInfoToNavNode(node, data.parentPath)),
|
||||
]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user