mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
Telemetry points for SQL Database Projects extension (#14088)
* Added publish and schema compare telemetry * Adding telemetry points for add/exclude/delete * telemetry for validation * Adding telemetry from project roundtrip updates, editing sqlproj, and db refs * Changed method for obtaining extension ID during registration * Fixing test failures, updating ads telemetry package dependency * replacing action strings with enums * change database project string actions to enums * Changed action name to better match dialog * PR feedback
This commit is contained in:
@@ -14,6 +14,7 @@ import { cssStyles } from '../common/uiConstants';
|
||||
import { IconPathHelper } from '../common/iconHelper';
|
||||
import { ISystemDatabaseReferenceSettings, IDacpacReferenceSettings, IProjectReferenceSettings } from '../models/IDatabaseReferenceSettings';
|
||||
import { Deferred } from '../common/promise';
|
||||
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
||||
|
||||
export enum ReferenceType {
|
||||
project,
|
||||
@@ -51,7 +52,7 @@ export class AddDatabaseReferenceDialog {
|
||||
public addReference: ((proj: Project, settings: ISystemDatabaseReferenceSettings | IDacpacReferenceSettings | IProjectReferenceSettings) => any) | undefined;
|
||||
|
||||
constructor(private project: Project) {
|
||||
this.dialog = azdata.window.createModelViewDialog(constants.addDatabaseReferenceDialogName);
|
||||
this.dialog = azdata.window.createModelViewDialog(constants.addDatabaseReferenceDialogName, 'addDatabaseReferencesDialog');
|
||||
this.addDatabaseReferenceTab = azdata.window.createTab(constants.addDatabaseReferenceDialogName);
|
||||
}
|
||||
|
||||
@@ -157,6 +158,10 @@ export class AddDatabaseReferenceDialog {
|
||||
};
|
||||
}
|
||||
|
||||
TelemetryReporter.createActionEvent(TelemetryViews.ProjectTree, TelemetryActions.addDatabaseReference)
|
||||
.withAdditionalProperties({ referenceType: this.currentReferenceType!.toString() })
|
||||
.send();
|
||||
|
||||
await this.addReference!(this.project, referenceSettings);
|
||||
|
||||
this.dispose();
|
||||
|
||||
@@ -36,7 +36,7 @@ export class CreateProjectFromDatabaseDialog {
|
||||
public createProjectFromDatabaseCallback: ((model: ImportDataModel) => any) | undefined;
|
||||
|
||||
constructor(private profile: azdata.IConnectionProfile | undefined) {
|
||||
this.dialog = azdata.window.createModelViewDialog(constants.createProjectFromDatabaseDialogName);
|
||||
this.dialog = azdata.window.createModelViewDialog(constants.createProjectFromDatabaseDialogName, 'createProjectFromDatabaseDialog');
|
||||
this.createProjectFromDatabaseTab = azdata.window.createTab(constants.createProjectFromDatabaseDialogName);
|
||||
this.dialog.registerCloseValidator(async () => {
|
||||
return this.validate();
|
||||
|
||||
@@ -15,6 +15,7 @@ import { DeploymentOptions, SchemaObjectType } from '../../../mssql/src/mssql';
|
||||
import { IconPathHelper } from '../common/iconHelper';
|
||||
import { cssStyles } from '../common/uiConstants';
|
||||
import { getConnectionName } from './utils';
|
||||
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
||||
|
||||
interface DataSourceDropdownValue extends azdata.CategoryValue {
|
||||
dataSource: SqlConnectionDataSource;
|
||||
@@ -40,6 +41,7 @@ export class PublishDatabaseDialog {
|
||||
private connectionIsDataSource: boolean | undefined;
|
||||
private sqlCmdVars: Record<string, string> | undefined;
|
||||
private deploymentOptions: DeploymentOptions | undefined;
|
||||
private profileUsed: boolean = false;
|
||||
|
||||
private toDispose: vscode.Disposable[] = [];
|
||||
|
||||
@@ -48,7 +50,7 @@ export class PublishDatabaseDialog {
|
||||
public readPublishProfile: ((profileUri: vscode.Uri) => any) | undefined;
|
||||
|
||||
constructor(private project: Project) {
|
||||
this.dialog = azdata.window.createModelViewDialog(constants.publishDialogName);
|
||||
this.dialog = azdata.window.createModelViewDialog(constants.publishDialogName, 'sqlProjectPublishDialog');
|
||||
this.publishTab = azdata.window.createTab(constants.publishDialogName);
|
||||
}
|
||||
|
||||
@@ -184,7 +186,8 @@ export class PublishDatabaseDialog {
|
||||
upgradeExisting: true,
|
||||
connectionUri: await this.getConnectionUri(),
|
||||
sqlCmdVariables: this.getSqlCmdVariablesForPublish(),
|
||||
deploymentOptions: await this.getDeploymentOptions()
|
||||
deploymentOptions: await this.getDeploymentOptions(),
|
||||
profileUsed: this.profileUsed
|
||||
};
|
||||
|
||||
azdata.window.closeDialog(this.dialog);
|
||||
@@ -194,12 +197,15 @@ export class PublishDatabaseDialog {
|
||||
}
|
||||
|
||||
public async generateScriptClick(): Promise<void> {
|
||||
TelemetryReporter.sendActionEvent(TelemetryViews.SqlProjectPublishDialog, TelemetryActions.generateScriptClicked);
|
||||
|
||||
const sqlCmdVars = this.getSqlCmdVariablesForPublish();
|
||||
const settings: IGenerateScriptSettings = {
|
||||
databaseName: this.getTargetDatabaseName(),
|
||||
connectionUri: await this.getConnectionUri(),
|
||||
sqlCmdVariables: sqlCmdVars,
|
||||
deploymentOptions: await this.getDeploymentOptions()
|
||||
deploymentOptions: await this.getDeploymentOptions(),
|
||||
profileUsed: this.profileUsed
|
||||
};
|
||||
|
||||
azdata.window.closeDialog(this.dialog);
|
||||
|
||||
Reference in New Issue
Block a user