mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
add open table designer event telemetry (#17595)
* add open table designer telemetry event * rename variables to reflect the text change * format code
This commit is contained in:
@@ -42,7 +42,8 @@ export const enum TelemetryView {
|
|||||||
Notebook = 'Notebook',
|
Notebook = 'Notebook',
|
||||||
ResultsPanel = 'ResultsPanel',
|
ResultsPanel = 'ResultsPanel',
|
||||||
Shell = 'Shell',
|
Shell = 'Shell',
|
||||||
SqlAssessment = 'SqlAssessment'
|
SqlAssessment = 'SqlAssessment',
|
||||||
|
TableDesigner = 'TableDesigner'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enum TelemetryError {
|
export const enum TelemetryError {
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ export class TableDesignerTextEditor extends BaseTextEditor implements DesignerT
|
|||||||
@IThemeService themeService: IThemeService,
|
@IThemeService themeService: IThemeService,
|
||||||
@IEditorService editorService: IEditorService,
|
@IEditorService editorService: IEditorService,
|
||||||
@IEditorGroupsService editorGroupService: IEditorGroupsService
|
@IEditorGroupsService editorGroupService: IEditorGroupsService
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super(TableDesignerTextEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, editorService, editorGroupService);
|
super(TableDesignerTextEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, editorService, editorGroupService);
|
||||||
this.create(this._container);
|
this.create(this._container);
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
|||||||
this._viewModel = designerInfo.viewModel;
|
this._viewModel = designerInfo.viewModel;
|
||||||
this.setDefaultData();
|
this.setDefaultData();
|
||||||
|
|
||||||
const advancedTabComponents: DesignerDataPropertyInfo[] = [
|
const generalTabComponents: DesignerDataPropertyInfo[] = [
|
||||||
{
|
{
|
||||||
componentType: 'dropdown',
|
componentType: 'dropdown',
|
||||||
propertyName: designers.TableProperty.Schema,
|
propertyName: designers.TableProperty.Schema,
|
||||||
@@ -161,12 +161,12 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (designerInfo.view.additionalTableProperties) {
|
if (designerInfo.view.additionalTableProperties) {
|
||||||
advancedTabComponents.push(...designerInfo.view.additionalTableProperties);
|
generalTabComponents.push(...designerInfo.view.additionalTableProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
const advancedTab = <DesignerTab>{
|
const generalTab = <DesignerTab>{
|
||||||
title: localize('tableDesigner.generalTab', "General"),
|
title: localize('tableDesigner.generalTab', "General"),
|
||||||
components: advancedTabComponents
|
components: generalTabComponents
|
||||||
};
|
};
|
||||||
|
|
||||||
const columnProperties: DesignerDataPropertyInfo[] = [
|
const columnProperties: DesignerDataPropertyInfo[] = [
|
||||||
@@ -261,7 +261,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
const tabs = [columnsTab, advancedTab];
|
const tabs = [columnsTab, generalTab];
|
||||||
if (designerInfo.view.additionalTabs) {
|
if (designerInfo.view.additionalTabs) {
|
||||||
tabs.push(...tabs);
|
tabs.push(...tabs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,14 @@ import * as azdata from 'azdata';
|
|||||||
import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { TableDesignerInput } from 'sql/workbench/browser/editor/tableDesigner/tableDesignerInput';
|
import { TableDesignerInput } from 'sql/workbench/browser/editor/tableDesigner/tableDesignerInput';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
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 {
|
export class TableDesignerService implements ITableDesignerService {
|
||||||
|
|
||||||
constructor(@IEditorService private _editorService: IEditorService,
|
constructor(@IEditorService private _editorService: IEditorService,
|
||||||
@IInstantiationService private _instantiationService: IInstantiationService) { }
|
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||||
|
@IAdsTelemetryService private _adsTelemetryService: IAdsTelemetryService) { }
|
||||||
|
|
||||||
public _serviceBrand: undefined;
|
public _serviceBrand: undefined;
|
||||||
private _providers = new Map<string, TableDesignerProvider>();
|
private _providers = new Map<string, TableDesignerProvider>();
|
||||||
@@ -41,6 +44,10 @@ export class TableDesignerService implements ITableDesignerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): Promise<void> {
|
public async openTableDesigner(providerId: string, tableInfo: azdata.designers.TableInfo): Promise<void> {
|
||||||
|
this._adsTelemetryService.createActionEvent(TelemetryView.TableDesigner, TelemetryAction.Open).withAdditionalProperties({
|
||||||
|
provider: providerId,
|
||||||
|
newTable: tableInfo.isNewTable
|
||||||
|
}).send();
|
||||||
const provider = this.getProvider(providerId);
|
const provider = this.getProvider(providerId);
|
||||||
const tableDesignerInput = this._instantiationService.createInstance(TableDesignerInput, provider, tableInfo);
|
const tableDesignerInput = this._instantiationService.createInstance(TableDesignerInput, provider, tableInfo);
|
||||||
await this._editorService.openEditor(tableDesignerInput, { pinned: true }, ACTIVE_GROUP);
|
await this._editorService.openEditor(tableDesignerInput, { pinned: true }, ACTIVE_GROUP);
|
||||||
|
|||||||
Reference in New Issue
Block a user