New UI for deploying SQL project to a new Azure server (#18833)

This commit is contained in:
Leila Lali
2022-04-29 15:39:21 -07:00
committed by GitHub
parent 14a63977c8
commit d95aff1d3c
17 changed files with 1453 additions and 367 deletions

View File

@@ -12,6 +12,7 @@ import { getDefaultPublishDeploymentOptions, getVscodeMssqlApi } from '../common
import { IConnectionInfo } from 'vscode-mssql';
import { IDeploySettings } from '../models/IDeploySettings';
import { getPublishServerName } from './utils';
import { SqlTargetPlatform } from 'sqldbproj';
/**
* Create flow for Publishing a database using only VS Code-native APIs such as QuickPick
@@ -209,9 +210,14 @@ export async function getPublishDatabaseSettings(project: Project, promptForConn
export async function launchPublishTargetOption(project: Project): Promise<constants.PublishTargetType | undefined> {
// Show options to user for deploy to existing server or docker
const name = getPublishServerName(project.getProjectTargetVersion());
const target = project.getProjectTargetVersion();
const name = getPublishServerName(target);
const logicalServerName = target === constants.targetPlatformToVersion.get(SqlTargetPlatform.sqlAzure) ? constants.AzureSqlLogicalServerName : constants.SqlServerName;
const options = target === constants.targetPlatformToVersion.get(SqlTargetPlatform.sqlAzure) ?
[constants.publishToDockerContainer(name), constants.publishToNewAzureServer, constants.publishToExistingServer(logicalServerName)] :
[constants.publishToDockerContainer(name), constants.publishToExistingServer(logicalServerName)];
const publishOption = await vscode.window.showQuickPick(
[constants.publishToExistingServer(name), constants.publishToDockerContainer(name)],
options,
{ title: constants.selectPublishOption, ignoreFocusOut: true });
// Return when user hits escape
@@ -224,6 +230,8 @@ export async function launchPublishTargetOption(project: Project): Promise<const
return constants.PublishTargetType.existingServer;
case constants.publishToDockerContainer(name):
return constants.PublishTargetType.docker;
case constants.publishToNewAzureServer:
return constants.PublishTargetType.newAzureServer;
default:
return constants.PublishTargetType.existingServer;
}