mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
connect dialog telemetry (#15267)
* add connection dialog telemetry * reset source * add to correct place
This commit is contained in:
@@ -29,6 +29,7 @@ export enum TelemetryView {
|
|||||||
AgentJobSteps = 'AgentJobSteps',
|
AgentJobSteps = 'AgentJobSteps',
|
||||||
AgentNotebookHistory = 'AgentNotebookHistory',
|
AgentNotebookHistory = 'AgentNotebookHistory',
|
||||||
AgentNotebooks = 'AgentNotebooks',
|
AgentNotebooks = 'AgentNotebooks',
|
||||||
|
ConnectionDialog = 'ConnectionDialog',
|
||||||
Shell = 'Shell',
|
Shell = 'Shell',
|
||||||
ExtensionRecommendationDialog = 'ExtensionRecommendationDialog',
|
ExtensionRecommendationDialog = 'ExtensionRecommendationDialog',
|
||||||
ResultsPanel = 'ResultsPanel',
|
ResultsPanel = 'ResultsPanel',
|
||||||
@@ -43,6 +44,7 @@ export enum TelemetryError {
|
|||||||
export enum TelemetryAction {
|
export enum TelemetryAction {
|
||||||
AddServerGroup = 'AddServerGroup',
|
AddServerGroup = 'AddServerGroup',
|
||||||
adsCommandExecuted = 'adsCommandExecuted',
|
adsCommandExecuted = 'adsCommandExecuted',
|
||||||
|
ConnectToServer = 'ConnectToServer',
|
||||||
BackupCreated = 'BackupCreated',
|
BackupCreated = 'BackupCreated',
|
||||||
DashboardNavigated = 'DashboardNavigated',
|
DashboardNavigated = 'DashboardNavigated',
|
||||||
DatabaseConnected = 'DatabaseConnected',
|
DatabaseConnected = 'DatabaseConnected',
|
||||||
@@ -89,6 +91,7 @@ export enum NbTelemetryAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum TelemetryPropertyName {
|
export enum TelemetryPropertyName {
|
||||||
ChartMaxRowCountExceeded = 'chartMaxRowCountExceeded'
|
ChartMaxRowCountExceeded = 'chartMaxRowCountExceeded',
|
||||||
|
ConnectionSource = 'connectionSource'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
constructor(
|
constructor(
|
||||||
private _title: string,
|
private _title: string,
|
||||||
private _name: string,
|
private _name: string,
|
||||||
private readonly _telemetryService: IAdsTelemetryService,
|
protected readonly _telemetryService: IAdsTelemetryService,
|
||||||
protected readonly layoutService: ILayoutService,
|
protected readonly layoutService: ILayoutService,
|
||||||
protected readonly _clipboardService: IClipboardService,
|
protected readonly _clipboardService: IClipboardService,
|
||||||
protected readonly _themeService: IThemeService,
|
protected readonly _themeService: IThemeService,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectio
|
|||||||
import { attachInputBoxStyler } from 'sql/platform/theme/common/styler';
|
import { attachInputBoxStyler } from 'sql/platform/theme/common/styler';
|
||||||
import { ITreeItem } from 'sql/workbench/common/views';
|
import { ITreeItem } from 'sql/workbench/common/views';
|
||||||
import { CONNECTIONS_SORT_BY_CONFIG_KEY } from 'sql/platform/connection/common/connectionConfig';
|
import { CONNECTIONS_SORT_BY_CONFIG_KEY } from 'sql/platform/connection/common/connectionConfig';
|
||||||
|
import { ConnectionSource } from 'sql/workbench/services/connection/browser/connectionDialogWidget';
|
||||||
import { IConnectionTreeDescriptor, IConnectionTreeService } from 'sql/workbench/services/connection/common/connectionTreeService';
|
import { IConnectionTreeDescriptor, IConnectionTreeService } from 'sql/workbench/services/connection/common/connectionTreeService';
|
||||||
import { AsyncRecentConnectionTreeDataSource } from 'sql/workbench/services/objectExplorer/browser/asyncRecentConnectionTreeDataSource';
|
import { AsyncRecentConnectionTreeDataSource } from 'sql/workbench/services/objectExplorer/browser/asyncRecentConnectionTreeDataSource';
|
||||||
import { ServerTreeElement } from 'sql/workbench/services/objectExplorer/browser/asyncServerTree';
|
import { ServerTreeElement } from 'sql/workbench/services/objectExplorer/browser/asyncServerTree';
|
||||||
@@ -66,7 +67,8 @@ export class ConnectionBrowseTab implements IPanelTab {
|
|||||||
|
|
||||||
export interface SelectedConnectionChangedEventArgs {
|
export interface SelectedConnectionChangedEventArgs {
|
||||||
connectionProfile: IConnectionProfile,
|
connectionProfile: IConnectionProfile,
|
||||||
connect: boolean
|
connect: boolean,
|
||||||
|
source: ConnectionSource
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ConnectionBrowserView extends Disposable implements IPanelView {
|
export class ConnectionBrowserView extends Disposable implements IPanelView {
|
||||||
@@ -247,14 +249,16 @@ export class ConnectionBrowserView extends Disposable implements IPanelView {
|
|||||||
this._onSelectedConnectionChanged.fire(
|
this._onSelectedConnectionChanged.fire(
|
||||||
{
|
{
|
||||||
connectionProfile: selectedNode.element.payload,
|
connectionProfile: selectedNode.element.payload,
|
||||||
connect: connect
|
connect: connect,
|
||||||
|
source: 'azure'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (selectedNode instanceof ConnectionProfile) {
|
} else if (selectedNode instanceof ConnectionProfile) {
|
||||||
this._onSelectedConnectionChanged.fire({
|
this._onSelectedConnectionChanged.fire({
|
||||||
connectionProfile: selectedNode,
|
connectionProfile: selectedNode,
|
||||||
connect: connect
|
connect: connect,
|
||||||
|
source: 'savedconnections'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ export interface OnShowUIResponse {
|
|||||||
container: HTMLElement;
|
container: HTMLElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines where the connection information is coming from
|
||||||
|
*/
|
||||||
|
export type ConnectionSource = 'manual' | 'recent' | 'savedconnections' | 'azure';
|
||||||
|
|
||||||
export class ConnectionDialogWidget extends Modal {
|
export class ConnectionDialogWidget extends Modal {
|
||||||
private _body: HTMLElement;
|
private _body: HTMLElement;
|
||||||
private _recentConnection: HTMLElement;
|
private _recentConnection: HTMLElement;
|
||||||
@@ -94,6 +99,8 @@ export class ConnectionDialogWidget extends Modal {
|
|||||||
|
|
||||||
private _connecting = false;
|
private _connecting = false;
|
||||||
|
|
||||||
|
private _connectionSource: ConnectionSource = 'manual';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private providerDisplayNameOptions: string[],
|
private providerDisplayNameOptions: string[],
|
||||||
private selectedProviderType: string,
|
private selectedProviderType: string,
|
||||||
@@ -265,6 +272,7 @@ export class ConnectionDialogWidget extends Modal {
|
|||||||
this.browsePanel = new ConnectionBrowseTab(this.instantiationService);
|
this.browsePanel = new ConnectionBrowseTab(this.instantiationService);
|
||||||
|
|
||||||
this._register(this.browsePanel.view.onSelectedConnectionChanged(e => {
|
this._register(this.browsePanel.view.onSelectedConnectionChanged(e => {
|
||||||
|
this._connectionSource = e.source;
|
||||||
this.onConnectionClick(e.connectionProfile, e.connect);
|
this.onConnectionClick(e.connectionProfile, e.connect);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -337,6 +345,9 @@ export class ConnectionDialogWidget extends Modal {
|
|||||||
private connect(element?: IConnectionProfile): void {
|
private connect(element?: IConnectionProfile): void {
|
||||||
this.logService.debug('ConnectionDialogWidget: Connect button is clicked');
|
this.logService.debug('ConnectionDialogWidget: Connect button is clicked');
|
||||||
if (this._connectButton.enabled) {
|
if (this._connectButton.enabled) {
|
||||||
|
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.ConnectionDialog, TelemetryKeys.TelemetryAction.ConnectToServer).withAdditionalProperties(
|
||||||
|
{ [TelemetryKeys.TelemetryPropertyName.ConnectionSource]: this._connectionSource }
|
||||||
|
).send();
|
||||||
this._connecting = true;
|
this._connecting = true;
|
||||||
this._connectButton.enabled = false;
|
this._connectButton.enabled = false;
|
||||||
this._providerTypeSelectBox.disable();
|
this._providerTypeSelectBox.disable();
|
||||||
@@ -385,6 +396,7 @@ export class ConnectionDialogWidget extends Modal {
|
|||||||
const leftClick = (element: any, eventish: ICancelableEvent, origin: string) => {
|
const leftClick = (element: any, eventish: ICancelableEvent, origin: string) => {
|
||||||
// element will be a server group if the tree is clicked rather than a item
|
// element will be a server group if the tree is clicked rather than a item
|
||||||
const isDoubleClick = origin === 'mouse' && (eventish as MouseEvent).detail === 2;
|
const isDoubleClick = origin === 'mouse' && (eventish as MouseEvent).detail === 2;
|
||||||
|
this._connectionSource = 'recent';
|
||||||
this.onConnectionClick(element, isDoubleClick);
|
this.onConnectionClick(element, isDoubleClick);
|
||||||
};
|
};
|
||||||
const actionProvider = this.instantiationService.createInstance(RecentConnectionActionsProvider);
|
const actionProvider = this.instantiationService.createInstance(RecentConnectionActionsProvider);
|
||||||
@@ -405,11 +417,13 @@ export class ConnectionDialogWidget extends Modal {
|
|||||||
if (this._recentConnectionTree instanceof AsyncServerTree) {
|
if (this._recentConnectionTree instanceof AsyncServerTree) {
|
||||||
this._recentConnectionTree.onMouseClick(e => {
|
this._recentConnectionTree.onMouseClick(e => {
|
||||||
if (e.element instanceof ConnectionProfile) {
|
if (e.element instanceof ConnectionProfile) {
|
||||||
|
this._connectionSource = 'recent';
|
||||||
this.onConnectionClick(e.element, false);
|
this.onConnectionClick(e.element, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this._recentConnectionTree.onMouseDblClick(e => {
|
this._recentConnectionTree.onMouseDblClick(e => {
|
||||||
if (e.element instanceof ConnectionProfile) {
|
if (e.element instanceof ConnectionProfile) {
|
||||||
|
this._connectionSource = 'recent';
|
||||||
this.onConnectionClick(e.element, true);
|
this.onConnectionClick(e.element, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -477,6 +491,7 @@ export class ConnectionDialogWidget extends Modal {
|
|||||||
* @param recentConnections Are there recent connections that should be shown
|
* @param recentConnections Are there recent connections that should be shown
|
||||||
*/
|
*/
|
||||||
public async open(recentConnections: boolean): Promise<void> {
|
public async open(recentConnections: boolean): Promise<void> {
|
||||||
|
this._connectionSource = 'manual';
|
||||||
this._panel.showTab(this._recentConnectionTabId);
|
this._panel.showTab(this._recentConnectionTabId);
|
||||||
|
|
||||||
this.show();
|
this.show();
|
||||||
|
|||||||
Reference in New Issue
Block a user