diff --git a/src/sql/platform/telemetry/common/telemetryKeys.ts b/src/sql/platform/telemetry/common/telemetryKeys.ts index a009d97362..a2b55d77ab 100644 --- a/src/sql/platform/telemetry/common/telemetryKeys.ts +++ b/src/sql/platform/telemetry/common/telemetryKeys.ts @@ -42,7 +42,8 @@ export const enum TelemetryView { Notebook = 'Notebook', ResultsPanel = 'ResultsPanel', Shell = 'Shell', - SqlAssessment = 'SqlAssessment' + SqlAssessment = 'SqlAssessment', + TableDesigner = 'TableDesigner' } export const enum TelemetryError { diff --git a/src/sql/workbench/contrib/tableDesigner/browser/tableDesignerTextEditor.ts b/src/sql/workbench/contrib/tableDesigner/browser/tableDesignerTextEditor.ts index 55fcd64aaa..3c969e03f8 100644 --- a/src/sql/workbench/contrib/tableDesigner/browser/tableDesignerTextEditor.ts +++ b/src/sql/workbench/contrib/tableDesigner/browser/tableDesignerTextEditor.ts @@ -53,7 +53,6 @@ export class TableDesignerTextEditor extends BaseTextEditor implements DesignerT @IThemeService themeService: IThemeService, @IEditorService editorService: IEditorService, @IEditorGroupsService editorGroupService: IEditorGroupsService - ) { super(TableDesignerTextEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, editorService, editorGroupService); this.create(this._container); diff --git a/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts b/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts index 0bc9053523..7808884800 100644 --- a/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts +++ b/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts @@ -143,7 +143,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput { this._viewModel = designerInfo.viewModel; this.setDefaultData(); - const advancedTabComponents: DesignerDataPropertyInfo[] = [ + const generalTabComponents: DesignerDataPropertyInfo[] = [ { componentType: 'dropdown', propertyName: designers.TableProperty.Schema, @@ -161,12 +161,12 @@ export class TableDesignerComponentInput implements DesignerComponentInput { ]; if (designerInfo.view.additionalTableProperties) { - advancedTabComponents.push(...designerInfo.view.additionalTableProperties); + generalTabComponents.push(...designerInfo.view.additionalTableProperties); } - const advancedTab = { + const generalTab = { title: localize('tableDesigner.generalTab', "General"), - components: advancedTabComponents + components: generalTabComponents }; const columnProperties: DesignerDataPropertyInfo[] = [ @@ -261,7 +261,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput { ] }; - const tabs = [columnsTab, advancedTab]; + const tabs = [columnsTab, generalTab]; if (designerInfo.view.additionalTabs) { tabs.push(...tabs); } diff --git a/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts b/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts index bbb647deaf..78c36341ba 100644 --- a/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts +++ b/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts @@ -9,11 +9,14 @@ import * as azdata from 'azdata'; import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { TableDesignerInput } from 'sql/workbench/browser/editor/tableDesigner/tableDesignerInput'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; +import { TelemetryAction, TelemetryView } from 'sql/platform/telemetry/common/telemetryKeys'; export class TableDesignerService implements ITableDesignerService { constructor(@IEditorService private _editorService: IEditorService, - @IInstantiationService private _instantiationService: IInstantiationService) { } + @IInstantiationService private _instantiationService: IInstantiationService, + @IAdsTelemetryService private _adsTelemetryService: IAdsTelemetryService) { } public _serviceBrand: undefined; private _providers = new Map(); @@ -41,6 +44,10 @@ export class TableDesignerService implements ITableDesignerService { } public async openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): Promise { + this._adsTelemetryService.createActionEvent(TelemetryView.TableDesigner, TelemetryAction.Open).withAdditionalProperties({ + provider: providerId, + newTable: tableInfo.isNewTable + }).send(); const provider = this.getProvider(providerId); const tableDesignerInput = this._instantiationService.createInstance(TableDesignerInput, provider, tableInfo); await this._editorService.openEditor(tableDesignerInput, { pinned: true }, ACTIVE_GROUP);