sql proj - publish to docker improvements (#17124)

This commit is contained in:
Leila Lali
2021-09-21 16:47:06 -07:00
committed by GitHub
parent 9bdb7f49b1
commit 3ed611db66
7 changed files with 113 additions and 23 deletions

View File

@@ -94,7 +94,7 @@ export async function launchPublishToDockerContainerQuickpick(project: Project):
title: constants.enterPassword,
ignoreFocusOut: true,
value: password,
validateInput: input => utils.isEmptyString(input) ? constants.valueCannotBeEmpty : undefined,
validateInput: input => !utils.isValidSQLPassword(input) ? constants.invalidSQLPasswordMessage : undefined,
password: true
}
);
@@ -104,15 +104,29 @@ export async function launchPublishToDockerContainerQuickpick(project: Project):
return undefined;
}
let baseImage: string | undefined = '';
baseImage = await vscode.window.showInputBox({
title: constants.enterBaseImage,
let confirmPassword: string | undefined = '';
confirmPassword = await vscode.window.showInputBox({
title: constants.confirmPassword,
ignoreFocusOut: true,
value: constants.defaultDockerBaseImage,
validateInput: input => utils.isEmptyString(input) ? constants.valueCannotBeEmpty : undefined
value: confirmPassword,
validateInput: input => input !== password ? constants.passwordNotMatch : undefined,
password: true
}
);
// Return when user hits escape
if (!confirmPassword) {
return undefined;
}
const baseImage = await vscode.window.showQuickPick(
[
`${constants.sqlServerDockerRegistry}/${constants.sqlServerDockerRepository}:2017-latest`,
`${constants.sqlServerDockerRegistry}/${constants.sqlServerDockerRepository}:2019-latest`,
`${constants.sqlServerDockerRegistry}/${constants.azureSqlEdgeDockerRepository}:latest`
],
{ title: constants.selectBaseImage, ignoreFocusOut: true });
// Return when user hits escape
if (!baseImage) {
return undefined;
@@ -134,9 +148,11 @@ export async function launchPublishToDockerContainerQuickpick(project: Project):
return undefined;
}
if (localDbSetting && deploySettings) {
deploySettings.serverName = localDbSetting.serverName;
}
// Server name should be set to localhost
deploySettings.serverName = localDbSetting.serverName;
// Get the database name from deploy settings
localDbSetting.dbName = deploySettings.databaseName;
return {