Fixes for sql db projects dashboard (#15100)

* Fix ID assignment for sql db projects dashboard

* Update with new fixes

* Fix tests

* Fix test
This commit is contained in:
Sakshi Sharma
2021-05-05 19:00:22 -07:00
committed by GitHub
parent 8c08c79d67
commit 3b3df2c3fc
9 changed files with 84 additions and 57 deletions

View File

@@ -42,6 +42,7 @@ export class PublishDatabaseDialog {
private sqlCmdVars: Record<string, string> | undefined;
private deploymentOptions: DeploymentOptions | undefined;
private profileUsed: boolean = false;
private serverName: string | undefined;
private toDispose: vscode.Disposable[] = [];
@@ -183,6 +184,7 @@ export class PublishDatabaseDialog {
public async publishClick(): Promise<void> {
const settings: IPublishSettings = {
databaseName: this.getTargetDatabaseName(),
serverName: this.getServerName(),
upgradeExisting: true,
connectionUri: await this.getConnectionUri(),
sqlCmdVariables: this.getSqlCmdVariablesForPublish(),
@@ -202,6 +204,7 @@ export class PublishDatabaseDialog {
const sqlCmdVars = this.getSqlCmdVariablesForPublish();
const settings: IGenerateScriptSettings = {
databaseName: this.getTargetDatabaseName(),
serverName: this.getServerName(),
connectionUri: await this.getConnectionUri(),
sqlCmdVariables: sqlCmdVars,
deploymentOptions: await this.getDeploymentOptions(),
@@ -249,6 +252,10 @@ export class PublishDatabaseDialog {
return this.project.projectFileName;
}
public getServerName(): string {
return this.serverName!;
}
private createRadioButtons(view: azdata.ModelView): azdata.Component {
this.connectionsRadioButton = view.modelBuilder.radioButton()
.withProperties({
@@ -488,6 +495,7 @@ export class PublishDatabaseDialog {
selectConnectionButton.onDidClick(async () => {
let connection = await azdata.connection.openConnectionDialog();
this.connectionId = connection.connectionId;
this.serverName = connection.options['server'];
let connectionTextboxValue: string = getConnectionName(connection);
@@ -550,6 +558,7 @@ export class PublishDatabaseDialog {
(<azdata.DropDownComponent>this.targetDatabaseDropDown).values = [];
this.connectionId = result.connectionId;
this.serverName = result.serverName;
await this.updateConnectionComponents(result.connection, <string>this.connectionId);
if (result.databaseName) {