extracted getConnectionLabel functionality

This commit is contained in:
Jan Prochazka
2021-05-06 11:08:03 +02:00
parent 3d882f47a7
commit 62cedd23b7
10 changed files with 44 additions and 31 deletions

View File

@@ -1,6 +1,7 @@
import _ from 'lodash';
import { get } from 'svelte/store';
import { currentDatabase } from '../stores';
import getConnectionLabel from '../utility/getConnectionLabel';
import openNewTab from '../utility/openNewTab';
export default function newQuery({
@@ -14,7 +15,7 @@ export default function newQuery({
const connection = _.get($currentDatabase, 'connection') || {};
const database = _.get($currentDatabase, 'name');
const tooltip = `${connection.displayName || connection.server}\n${database}`;
const tooltip = `${getConnectionLabel(connection)}\n${database}`;
openNewTab(
{