mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
remove logic (#19250)
This commit is contained in:
@@ -112,7 +112,6 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
|||||||
if (!node) {
|
if (!node) {
|
||||||
// if user selects command in command palette we prompt user for information
|
// if user selects command in command palette we prompt user for information
|
||||||
telemetryStep = CreateAzureFunctionStep.launchFromCommandPalette;
|
telemetryStep = CreateAzureFunctionStep.launchFromCommandPalette;
|
||||||
|
|
||||||
// prompt user for connection profile to get connection info
|
// prompt user for connection profile to get connection info
|
||||||
while (true) {
|
while (true) {
|
||||||
connectionInfo = await vscodeMssqlApi.promptForConnection(true);
|
connectionInfo = await vscodeMssqlApi.promptForConnection(true);
|
||||||
@@ -120,7 +119,9 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
|||||||
// User cancelled
|
// User cancelled
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
telemetryStep = 'getConnectionInfo';
|
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
|
||||||
|
.withAdditionalProperties(propertyBag).withConnectionInfo(connectionInfo).send();
|
||||||
|
telemetryStep = CreateAzureFunctionStep.getConnectionProfile;
|
||||||
let connectionURI: string = '';
|
let connectionURI: string = '';
|
||||||
try {
|
try {
|
||||||
await vscode.window.withProgress(
|
await vscode.window.withProgress(
|
||||||
@@ -139,6 +140,7 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// list databases based on connection profile selected
|
// list databases based on connection profile selected
|
||||||
|
telemetryStep = CreateAzureFunctionStep.getDatabase;
|
||||||
let listDatabases = await vscodeMssqlApi.listDatabases(connectionURI);
|
let listDatabases = await vscodeMssqlApi.listDatabases(connectionURI);
|
||||||
const selectedDatabase = (await vscode.window.showQuickPick(listDatabases, {
|
const selectedDatabase = (await vscode.window.showQuickPick(listDatabases, {
|
||||||
canPickMany: false,
|
canPickMany: false,
|
||||||
@@ -161,35 +163,12 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
telemetryStep = CreateAzureFunctionStep.getConnectionProfile;
|
|
||||||
connectionInfo = await vscodeMssqlApi.promptForConnection(true);
|
|
||||||
if (!connectionInfo) {
|
|
||||||
// User cancelled
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
|
|
||||||
.withAdditionalProperties(propertyBag).withConnectionInfo(connectionInfo).send();
|
|
||||||
|
|
||||||
// list databases based on connection profile selected
|
|
||||||
telemetryStep = CreateAzureFunctionStep.getDatabase;
|
|
||||||
let selectedDatabase = await azureFunctionsUtils.promptSelectDatabase(connectionInfo);
|
|
||||||
if (!selectedDatabase) {
|
|
||||||
// User cancelled
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
connectionInfo.database = selectedDatabase;
|
|
||||||
|
|
||||||
// prompt user for object name to create function from
|
|
||||||
telemetryStep = CreateAzureFunctionStep.getObjectName;
|
|
||||||
objectName = await azureFunctionsUtils.promptForObjectName(selectedBinding);
|
|
||||||
if (!objectName) {
|
|
||||||
// user cancelled
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// if user selects table in tree view we use connection info from Object Explorer node
|
// if user selects table in tree view we use connection info from Object Explorer node
|
||||||
telemetryStep = CreateAzureFunctionStep.launchFromTable;
|
telemetryStep = CreateAzureFunctionStep.launchFromTable;
|
||||||
connectionInfo = node.connectionInfo;
|
connectionInfo = node.connectionInfo;
|
||||||
|
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
|
||||||
|
.withAdditionalProperties(propertyBag).withConnectionInfo(connectionInfo).send();
|
||||||
// set the database containing the selected table so it can be used
|
// set the database containing the selected table so it can be used
|
||||||
// for the initial catalog property of the connection string
|
// for the initial catalog property of the connection string
|
||||||
let newNode: ITreeNodeInfo = node;
|
let newNode: ITreeNodeInfo = node;
|
||||||
|
|||||||
Reference in New Issue
Block a user