feat(sidebar): copy display paths for all database types
This commit is contained in:
1 parent
8dc1297f6a
commit
30a4131bb2
3 files changed
+142
-12
No files matched your search
@@ -2369,7 +2369,7 @@ async function copyDisplayPath() {
|
||||
function copyNameMenuItem(): ContextMenuItem {
|
||||
const node = activeNode.value;
|
||||
const connectionName = node.connectionId ? connectionStore.getConfig(node.connectionId)?.name || "" : "";
|
||||
if (currentDatabaseType() === "mysql" && copyDisplayPathForTreeNode(node, connectionName)) {
|
||||
if (copyDisplayPathForTreeNode(node, connectionName)) {
|
||||
return {
|
||||
label: t("contextMenu.copyName"),
|
||||
icon: Copy,
|
||||
@@ -6521,9 +6521,7 @@ function buildObjectSidebarMenu(context: SidebarMenuFactoryContext): boolean {
|
||||
if (!isPackageMember && canViewDatabaseObjectDependencies(currentDatabaseType(), node)) {
|
||||
items.push({ label: t("contextMenu.viewDependencies"), action: openDatabaseObjectDependencies, icon: Network });
|
||||
}
|
||||
if (currentDatabaseType() === "mysql") {
|
||||
items.push(copyNameMenuItem());
|
||||
}
|
||||
items.push(copyNameMenuItem());
|
||||
if (!isPackageMember && canRenameObject.value) {
|
||||
items.push({
|
||||
label: t("contextMenu.renameObject"),
|
||||
@@ -6569,7 +6567,7 @@ function buildObjectSidebarMenu(context: SidebarMenuFactoryContext): boolean {
|
||||
if (currentDatabaseType() === "oceanbase-oracle") {
|
||||
items.push({ label: t("contextMenu.editObject"), action: () => openObjectSourceDialog(true), icon: Pencil });
|
||||
}
|
||||
items.push({ label: t("contextMenu.copyName"), action: copyName, icon: Copy, shortcut: shortcutCopyName.value });
|
||||
items.push(copyNameMenuItem());
|
||||
items.push({ label: t("contextMenu.changeOpenMode"), action: () => emit("open-settings", "navigation"), icon: Settings2 });
|
||||
return true;
|
||||
}
|
||||
@@ -6605,7 +6603,7 @@ function buildObjectSidebarMenu(context: SidebarMenuFactoryContext): boolean {
|
||||
icon: Code2,
|
||||
});
|
||||
}
|
||||
items.push(node.type === "trigger" ? copyNameMenuItem() : { label: t("contextMenu.copyName"), action: copyName, icon: Copy, shortcut: shortcutCopyName.value });
|
||||
items.push(copyNameMenuItem());
|
||||
items.push({ label: t("contextMenu.changeOpenMode"), action: () => emit("open-settings", "navigation"), icon: Settings2 });
|
||||
return true;
|
||||
}
|
||||
@@ -6615,7 +6613,7 @@ function buildObjectSidebarMenu(context: SidebarMenuFactoryContext): boolean {
|
||||
if (node.type === "type" || node.type === "type-body") {
|
||||
if (supportsTypeObjectSource(currentDatabaseType())) {
|
||||
items.push({ label: t("contextMenu.viewSource"), action: () => openObjectSourceDialog(false), icon: Code2 });
|
||||
items.push({ label: t("contextMenu.copyName"), action: copyName, icon: Copy, shortcut: shortcutCopyName.value });
|
||||
items.push(copyNameMenuItem());
|
||||
items.push({ label: t("contextMenu.changeOpenMode"), action: () => emit("open-settings", "navigation"), icon: Settings2 });
|
||||
return true;
|
||||
}
|
||||
@@ -6623,7 +6621,7 @@ function buildObjectSidebarMenu(context: SidebarMenuFactoryContext): boolean {
|
||||
items.push({ label: t("contextMenu.copyDdl"), action: copyCustomTypeDdl, icon: Copy });
|
||||
items.push({ label: "", separator: true });
|
||||
}
|
||||
items.push({ label: t("contextMenu.copyName"), action: copyName, icon: Copy, shortcut: shortcutCopyName.value });
|
||||
items.push(copyNameMenuItem());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user