From 2203991c4d546c162a3523277790aa067d52bc24 Mon Sep 17 00:00:00 2001 From: abist Date: Wed, 22 Jan 2020 12:29:03 -0800 Subject: [PATCH] fixed labels for node --- src/queryHistory/queryHistoryProvider.ts | 9 +++++++-- src/views/queryHistoryUI.ts | 11 ++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/queryHistory/queryHistoryProvider.ts b/src/queryHistory/queryHistoryProvider.ts index 22f364c16..f74f31221 100644 --- a/src/queryHistory/queryHistoryProvider.ts +++ b/src/queryHistory/queryHistoryProvider.ts @@ -188,8 +188,13 @@ export class QueryHistoryProvider implements vscode.TreeDataProvider { * Creates a connection label based on credentials */ private getConnectionLabel(ownerUri: string): string { - let connInfo = this._connectionManager.getConnectionInfo(ownerUri); - return `(${connInfo.credentials.server}|${connInfo.credentials.database})`; + const connInfo = this._connectionManager.getConnectionInfo(ownerUri); + const credentials = connInfo.credentials; + let connString = `(${credentials.server}|${credentials.database})`; + if (credentials.authenticationType === Constants.sqlAuthentication) { + connString = `${connString} : ${credentials.user}`; + } + return connString; } /** diff --git a/src/views/queryHistoryUI.ts b/src/views/queryHistoryUI.ts index 54bec21d8..e3d6f30d1 100644 --- a/src/views/queryHistoryUI.ts +++ b/src/views/queryHistoryUI.ts @@ -14,12 +14,13 @@ import * as LocalizedConstants from '../constants/localizedConstants'; export enum QueryHistoryAction { OpenQueryHistoryAction = 1, RunQueryHistoryAction = 2 -}; +} +// tslint:disable-next-line: interface-name export interface QueryHistoryQuickPickItem extends vscode.QuickPickItem { node: QueryHistoryNode; action: any; -}; +} export class QueryHistoryUI { @@ -31,7 +32,7 @@ export class QueryHistoryUI { public convertToQuickPickItem(node: vscode.TreeItem): QueryHistoryQuickPickItem { let historyNode = node as QueryHistoryNode; let quickPickItem: QueryHistoryQuickPickItem = { - label: QueryHistoryProvider.limitStringSize(historyNode.queryString, true), + label: QueryHistoryProvider.limitStringSize(historyNode.queryString, true).trim(), detail: `${historyNode.connectionLabel}, ${historyNode.timeStamp.toLocaleString()}`, node: historyNode, action: undefined, @@ -76,10 +77,10 @@ export class QueryHistoryUI { answer.action = QueryHistoryAction.RunQueryHistoryAction; } return answer; - }) + }); } return undefined; }); } -} \ No newline at end of file +}