From da5194bdcb77daccd4ceac9f5275fec84d1188a0 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Fri, 16 Nov 2018 21:19:32 -0800 Subject: [PATCH] fix for 3262 (#3263) --- .../src/dialogs/profilerCreateSessionDialog.ts | 15 +++++++++++++-- src/sql/parts/profiler/editor/profilerEditor.ts | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/extensions/profiler/client/src/dialogs/profilerCreateSessionDialog.ts b/extensions/profiler/client/src/dialogs/profilerCreateSessionDialog.ts index d4d0193f49..679adb59a0 100644 --- a/extensions/profiler/client/src/dialogs/profilerCreateSessionDialog.ts +++ b/extensions/profiler/client/src/dialogs/profilerCreateSessionDialog.ts @@ -14,8 +14,8 @@ const localize = nls.loadMessageBundle(); export class CreateSessionDialog { // Top level private readonly CancelButtonText: string = localize('createSessionDialog.cancel', 'Cancel'); - private readonly CreateButtonText: string = localize('createSessionDialog.create', 'Create'); - private readonly DialogTitleText: string = localize('createSessionDialog.title', 'Create New Profiler Session'); + private readonly CreateButtonText: string = localize('createSessionDialog.create', 'Start'); + private readonly DialogTitleText: string = localize('createSessionDialog.title', 'Start New Profiler Session'); // UI Components private dialog: sqlops.window.modelviewdialog.Dialog; @@ -68,6 +68,10 @@ export class CreateSessionDialog { value: '' }).component(); + this.templatesBox.onValueChanged(() => { + this.updateSessionName(); + }); + let formModel = view.modelBuilder.formContainer() .withFormItems([{ components: [{ @@ -86,6 +90,7 @@ export class CreateSessionDialog { if (this.model.templates) { this.templatesBox.values = this.model.getTemplateNames(); + this.updateSessionName(); } this.sessionNameBox.onTextChanged(() => { @@ -99,6 +104,12 @@ export class CreateSessionDialog { }); } + private updateSessionName() { + if (this.templatesBox.value) { + this.sessionNameBox.value = `ADS_${this.templatesBox.value.toString()}` + } + } + private async execute(): Promise { let profilerService = sqlops.dataprotocol.getProvider(this._providerType, sqlops.DataProviderType.ProfilerProvider); diff --git a/src/sql/parts/profiler/editor/profilerEditor.ts b/src/sql/parts/profiler/editor/profilerEditor.ts index 66ee89943b..fc1d99d447 100644 --- a/src/sql/parts/profiler/editor/profilerEditor.ts +++ b/src/sql/parts/profiler/editor/profilerEditor.ts @@ -233,7 +233,8 @@ export class ProfilerEditor extends BaseEditor { } })); let sessionsContainer = document.createElement('div'); - sessionsContainer.style.width = '150px'; + sessionsContainer.style.minWidth = '150px'; + sessionsContainer.style.maxWidth = '250px'; sessionsContainer.style.paddingRight = '5px'; this._sessionSelector.render(sessionsContainer);