From 4bf8836c0a939789c1a47a3ee787ab201f7fdd99 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Thu, 6 Dec 2018 09:58:33 -0800 Subject: [PATCH] profiler extension bug fixes (#3490) --- .../parts/profiler/contrib/profilerActions.contribution.ts | 6 +++--- .../parts/profiler/editor/controller/profilerFindWidget.ts | 2 -- .../parts/profiler/editor/controller/profilerTableEditor.ts | 1 + src/sql/parts/profiler/editor/profilerEditor.ts | 1 + src/sql/parts/profiler/editor/profilerInput.ts | 3 ++- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/sql/parts/profiler/contrib/profilerActions.contribution.ts b/src/sql/parts/profiler/contrib/profilerActions.contribution.ts index a9c33b59c6..8dbbd93ab1 100644 --- a/src/sql/parts/profiler/contrib/profilerActions.contribution.ts +++ b/src/sql/parts/profiler/contrib/profilerActions.contribution.ts @@ -9,7 +9,7 @@ import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiati import * as nls from 'vs/nls'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { IConnectionManagementService, IConnectionDialogService} from 'sql/parts/connection/common/connectionManagement'; +import { IConnectionManagementService, IConnectionDialogService } from 'sql/parts/connection/common/connectionManagement'; import { IObjectExplorerService } from '../../objectExplorer/common/objectExplorerService'; import { ProfilerInput } from 'sql/parts/profiler/editor/profilerInput'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -55,10 +55,10 @@ CommandsRegistry.registerCommand({ let promise; if (connectionProfile) { - promise = connectionService.connectIfNotConnected(connectionProfile); + promise = connectionService.connectIfNotConnected(connectionProfile, 'connection', true); } else { // if still no luck, we will open the Connection dialog and let user connect to a server - promise = connectionDialogService.openDialogAndWait(connectionService, { connectionType: 1, providers: [mssqlProviderName] }).then((profile) => { + promise = connectionDialogService.openDialogAndWait(connectionService, { connectionType: 0, showDashboard: false, providers: [mssqlProviderName] }).then((profile) => { connectionProfile = profile as ConnectionProfile; }); } diff --git a/src/sql/parts/profiler/editor/controller/profilerFindWidget.ts b/src/sql/parts/profiler/editor/controller/profilerFindWidget.ts index 3241747235..adce88b264 100644 --- a/src/sql/parts/profiler/editor/controller/profilerFindWidget.ts +++ b/src/sql/parts/profiler/editor/controller/profilerFindWidget.ts @@ -308,8 +308,6 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas // ----- Public public focusFindInput(): void { - this._findInput.select(); - // Edge browser requires focus() in addition to select() this._findInput.focus(); } diff --git a/src/sql/parts/profiler/editor/controller/profilerTableEditor.ts b/src/sql/parts/profiler/editor/controller/profilerTableEditor.ts index d0257aeef8..1771ba588e 100644 --- a/src/sql/parts/profiler/editor/controller/profilerTableEditor.ts +++ b/src/sql/parts/profiler/editor/controller/profilerTableEditor.ts @@ -218,6 +218,7 @@ export class ProfilerTableEditor extends BaseEditor implements IProfilerControll if (p) { this._profilerTable.setActiveCell(p.row, p.col); this._updateFinderMatchState(); + this._finder.focusFindInput(); } }); } else { diff --git a/src/sql/parts/profiler/editor/profilerEditor.ts b/src/sql/parts/profiler/editor/profilerEditor.ts index 195d431bdb..62e9b00c69 100644 --- a/src/sql/parts/profiler/editor/profilerEditor.ts +++ b/src/sql/parts/profiler/editor/profilerEditor.ts @@ -557,6 +557,7 @@ export class ProfilerEditor extends BaseEditor { } public focus() { + this._profilerEditorContextKey.set(true); super.focus(); let savedViewState = this._savedTableViewStates.get(this.input); if (savedViewState) { diff --git a/src/sql/parts/profiler/editor/profilerInput.ts b/src/sql/parts/profiler/editor/profilerInput.ts index 2d3b00ed21..d0403be541 100644 --- a/src/sql/parts/profiler/editor/profilerInput.ts +++ b/src/sql/parts/profiler/editor/profilerInput.ts @@ -66,7 +66,8 @@ export class ProfilerInput extends EditorInput implements IProfilerSession { let searchFn = (val: { [x: string]: string }, exp: string): Array => { let ret = new Array(); for (let i = 0; i < this._columns.length; i++) { - if (val[this._columns[i]].includes(exp)) { + let colVal = val[this._columns[i]]; + if (colVal && colVal.toLocaleLowerCase().includes(exp.toLocaleLowerCase())) { ret.push(i); } }