From 5367101330ae6e979211e9abbbf775793dbee806 Mon Sep 17 00:00:00 2001 From: kisantia <31145923+kisantia@users.noreply.github.com> Date: Wed, 19 Dec 2018 18:45:40 -0500 Subject: [PATCH] Fix database not getting set correctly in DacFx wizard deploy scenario (#3641) * fix db not getting set correctly for deploy scenario if coming from import page * removed space so that comments go directly after // --- .../import/src/wizard/pages/deployConfigPage.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/extensions/import/src/wizard/pages/deployConfigPage.ts b/extensions/import/src/wizard/pages/deployConfigPage.ts index 67d4fd61a3..0cf01695d5 100644 --- a/extensions/import/src/wizard/pages/deployConfigPage.ts +++ b/extensions/import/src/wizard/pages/deployConfigPage.ts @@ -32,7 +32,7 @@ export class DeployConfigPage extends DacFxConfigPage { } async start(): Promise { - let serverComponent = await this.createServerDropdown(true); + let serverComponent = await this.createServerDropdown(true); let fileBrowserComponent = await this.createFileBrowser(); this.databaseComponent = await this.createDatabaseTextBox(); this.databaseComponent.title = localize('dacFx.databaseNameTextBox', 'Database Name'); @@ -131,7 +131,7 @@ export class DeployConfigPage extends DacFxConfigPage { this.model.database = this.databaseTextBox.value; }); - // Initialize with upgrade existing true + //Initialize with upgrade existing true upgradeRadioButton.checked = true; this.model.upgradeExisting = true; @@ -149,10 +149,10 @@ export class DeployConfigPage extends DacFxConfigPage { } protected async createDeployDatabaseDropdown(): Promise { - this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({ + this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({ required: true }).component(); - // Handle database changes + //Handle database changes this.databaseDropdown.onValueChanged(async () => { this.model.database = (this.databaseDropdown.value).name; }); @@ -172,7 +172,8 @@ export class DeployConfigPage extends DacFxConfigPage { } let values = await this.getDatabaseValues(); - if (this.model.database === undefined) { + //set the database to the first dropdown value if upgrading, otherwise it should get set to the textbox value + if (this.model.upgradeExisting) { this.model.database = values[0].name; }