mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
New UI for deploying SQL project to a new Azure server (#18833)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user