mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Send telemetry action event when user selects 'Enable Trust Server Certificate' (#21113)
This commit is contained in:
@@ -75,6 +75,7 @@ export const enum TelemetryAction {
|
|||||||
DeleteAgentProxy = 'DeleteAgentProxy',
|
DeleteAgentProxy = 'DeleteAgentProxy',
|
||||||
DeleteConnection = 'DeleteConnection',
|
DeleteConnection = 'DeleteConnection',
|
||||||
DeleteServerGroup = 'DeleteServerGroup',
|
DeleteServerGroup = 'DeleteServerGroup',
|
||||||
|
EnableTrustServerCertificate = 'EnableTrustServerCertificate',
|
||||||
FindNode = 'FindNode',
|
FindNode = 'FindNode',
|
||||||
FirewallRuleRequested = 'FirewallRuleCreated',
|
FirewallRuleRequested = 'FirewallRuleCreated',
|
||||||
GenerateScript = 'GenerateScript',
|
GenerateScript = 'GenerateScript',
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import * as types from 'vs/base/common/types';
|
|||||||
import { trim } from 'vs/base/common/strings';
|
import { trim } from 'vs/base/common/strings';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
|
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||||
|
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
import { CmsConnectionController } from 'sql/workbench/services/connection/browser/cmsConnectionController';
|
import { CmsConnectionController } from 'sql/workbench/services/connection/browser/cmsConnectionController';
|
||||||
import { entries } from 'sql/base/common/collections';
|
import { entries } from 'sql/base/common/collections';
|
||||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||||
@@ -89,6 +91,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
@IClipboardService private _clipboardService: IClipboardService,
|
@IClipboardService private _clipboardService: IClipboardService,
|
||||||
@ICommandService private _commandService: ICommandService,
|
@ICommandService private _commandService: ICommandService,
|
||||||
@ILogService private _logService: ILogService,
|
@ILogService private _logService: ILogService,
|
||||||
|
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService
|
||||||
) {
|
) {
|
||||||
this.initializeConnectionProviders();
|
this.initializeConnectionProviders();
|
||||||
}
|
}
|
||||||
@@ -524,6 +527,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
Note: A self-signed certificate offers only limited protection and is not a recommended practice for production environments. Do you want to enable 'Trust server certificate' on this connection and retry? `);
|
Note: A self-signed certificate offers only limited protection and is not a recommended practice for production environments. Do you want to enable 'Trust server certificate' on this connection and retry? `);
|
||||||
let readMoreLink = "https://learn.microsoft.com/sql/database-engine/configure-windows/enable-encrypted-connections-to-the-database-engine"
|
let readMoreLink = "https://learn.microsoft.com/sql/database-engine/configure-windows/enable-encrypted-connections-to-the-database-engine"
|
||||||
actions.push(new Action('trustServerCert', enableTrustServerCert, undefined, true, async () => {
|
actions.push(new Action('trustServerCert', enableTrustServerCert, undefined, true, async () => {
|
||||||
|
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.ConnectionDialog, TelemetryKeys.TelemetryAction.EnableTrustServerCertificate);
|
||||||
this._model.options[Constants.trustServerCertificate] = true;
|
this._model.options[Constants.trustServerCertificate] = true;
|
||||||
await this.handleOnConnect(this._connectionDialog.newConnectionParams, this._model as IConnectionProfile);
|
await this.handleOnConnect(this._connectionDialog.newConnectionParams, this._model as IConnectionProfile);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -108,8 +108,10 @@ suite('ConnectionDialogService tests', () => {
|
|||||||
testInstantiationService.stub(ICapabilitiesService, new TestCapabilitiesService());
|
testInstantiationService.stub(ICapabilitiesService, new TestCapabilitiesService());
|
||||||
|
|
||||||
let logService: ILogService = new NullLogService();
|
let logService: ILogService = new NullLogService();
|
||||||
|
let telemetryService: IAdsTelemetryService = new NullAdsTelemetryService();
|
||||||
|
|
||||||
connectionDialogService = new ConnectionDialogService(testInstantiationService, capabilitiesService, errorMessageService.object,
|
connectionDialogService = new ConnectionDialogService(testInstantiationService, capabilitiesService, errorMessageService.object,
|
||||||
new TestConfigurationService(), new BrowserClipboardService(layoutService, logService), NullCommandService, logService);
|
new TestConfigurationService(), new BrowserClipboardService(layoutService, logService), NullCommandService, logService, telemetryService);
|
||||||
(connectionDialogService as any)._connectionManagementService = mockConnectionManagementService.object;
|
(connectionDialogService as any)._connectionManagementService = mockConnectionManagementService.object;
|
||||||
let providerDisplayNames = ['Mock SQL Server'];
|
let providerDisplayNames = ['Mock SQL Server'];
|
||||||
let providerNameToDisplayMap = { 'MSSQL': 'Mock SQL Server' };
|
let providerNameToDisplayMap = { 'MSSQL': 'Mock SQL Server' };
|
||||||
|
|||||||
Reference in New Issue
Block a user