mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-12 23:37:00 +08:00
chore(core-app): parseNodeParentId function
This commit is contained in:
@@ -414,3 +414,13 @@ export class NavNodeManagerService extends Bootstrap {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export function parseNodeParentId(nodeId: string): string {
|
||||
const parentId = nodeId.slice(0, nodeId.lastIndexOf('/'));
|
||||
|
||||
if (parentId === 'database:/') {
|
||||
return ROOT_NODE_PATH;
|
||||
}
|
||||
|
||||
return parentId;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export class DdlViewerTabService {
|
||||
tabId: ddlViewerTabId,
|
||||
title: 'DDL',
|
||||
icon: '/icons/DDL.svg',
|
||||
onActivate: () => this.activateDDLTab(nodeId, node?.parentId!),
|
||||
onActivate: () => this.activateDDLTab(nodeId, node?.parentId as string),
|
||||
panel: () => ddlViewer(nodeId),
|
||||
};
|
||||
return ddlTab;
|
||||
|
||||
Reference in New Issue
Block a user