From d2317ab908531ec78f4f652069bf54f8e9fc6ff9 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Wed, 14 Jul 2021 20:46:26 +0200 Subject: [PATCH] new query on middle mouse click --- packages/web/src/appobj/ConnectionAppObject.svelte | 10 ++++------ packages/web/src/widgets/TabsPanel.svelte | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/web/src/appobj/ConnectionAppObject.svelte b/packages/web/src/appobj/ConnectionAppObject.svelte index cc022983..829a8c85 100644 --- a/packages/web/src/appobj/ConnectionAppObject.svelte +++ b/packages/web/src/appobj/ConnectionAppObject.svelte @@ -123,7 +123,7 @@ text: 'Connect', onClick: handleConnect, }, - { onClick: handleNewQuery, text: 'New query' }, + { onClick: handleNewQuery, text: 'New query', isNewQuery: true }, $openedConnections.includes(data._id) && data.status && { text: 'Refresh', @@ -191,10 +191,8 @@ on:click on:expand on:middleclick={() => { - if (data.singleDatabase) { - getDatabaseMenuItems(data, data.defaultDatabase, $extensions, $currentDatabase) - .find(x => x.isNewQuery) - .onClick(); - } + _.flattenDeep(getContextMenu()) + .find(x => x.isNewQuery) + .onClick(); }} /> diff --git a/packages/web/src/widgets/TabsPanel.svelte b/packages/web/src/widgets/TabsPanel.svelte index 9ce64bbb..dc4f6c75 100644 --- a/packages/web/src/widgets/TabsPanel.svelte +++ b/packages/web/src/widgets/TabsPanel.svelte @@ -49,7 +49,7 @@ if (tab.props && tab.props.conid && tab.props.database) return tab.props.database; if (tab.props && tab.props.conid) { const connection = connectionList?.find(x => x._id == tab.props.conid); - if (connection) return getConnectionLabel(connection.displayName, { allowExplicitDatabase: false }); + if (connection) return getConnectionLabel(connection, { allowExplicitDatabase: false }); return '???'; } if (tab.props && tab.props.archiveFolder) return tab.props.archiveFolder;