Add graph icons to OE and TD (#18808)

* add graph icons to OE and TD

* PR comments

* change enum type

* change sub type to icon and make basic as default

* changed icontype to icon

* change default logic location

* change icon name to be more generic

* use right icons
This commit is contained in:
Aditya Bist
2022-04-01 00:27:59 -07:00
committed by GitHub
parent 27f014c70d
commit bab5118996
14 changed files with 205 additions and 13 deletions

View File

@@ -6,21 +6,23 @@
import { AppContext } from '../appContext';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { sqlProviderName, TableType } from '../constants';
import { sqlProviderName } from '../constants';
import { generateUuid } from 'vscode-languageclient/lib/utils/uuid';
import { ITelemetryEventProperties, Telemetry } from '../telemetry';
export function registerTableDesignerCommands(appContext: AppContext) {
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.newTable', async (context: azdata.ObjectExplorerContext) => {
const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true);
const telemetryInfo = await getTelemetryInfo(context, TableType.Basic);
const tableIcon = context.nodeInfo.nodeSubType as azdata.designers.TableIcon;
const telemetryInfo = await getTelemetryInfo(context, tableIcon);
await azdata.designers.openTableDesigner(sqlProviderName, {
server: context.connectionProfile.serverName,
database: context.connectionProfile.databaseName,
isNewTable: true,
id: generateUuid(),
connectionString: connectionString,
accessToken: context.connectionProfile.options.azureAccountToken
accessToken: context.connectionProfile.options.azureAccountToken,
tableIcon: tableIcon
}, telemetryInfo);
}));
@@ -30,7 +32,8 @@ export function registerTableDesignerCommands(appContext: AppContext) {
const schema = context.nodeInfo.metadata.schema;
const name = context.nodeInfo.metadata.name;
const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true);
const telemetryInfo = await getTelemetryInfo(context, TableType.Basic);
const tableIcon = context.nodeInfo.nodeSubType as azdata.designers.TableIcon;
const telemetryInfo = await getTelemetryInfo(context, tableIcon);
await azdata.designers.openTableDesigner(sqlProviderName, {
server: server,
database: database,
@@ -39,7 +42,8 @@ export function registerTableDesignerCommands(appContext: AppContext) {
schema: schema,
id: `${sqlProviderName}|${server}|${database}|${schema}|${name}`,
connectionString: connectionString,
accessToken: context.connectionProfile.options.azureAccountToken
accessToken: context.connectionProfile.options.azureAccountToken,
tableIcon: tableIcon
}, telemetryInfo);
}));
}