From 03a0d714869466c170ab7348dab3c039e095f330 Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Wed, 10 Mar 2021 15:02:14 -0800 Subject: [PATCH] Fix deploy upgrade existing not choosing the correct database (#14635) * fix deploy upgrade existing not choosing the correct database * fix test * specify databaseDropdownValue as a string --- extensions/dacpac/src/test/testDacFxConfigPages.ts | 2 +- extensions/dacpac/src/wizard/api/dacFxConfigPage.ts | 4 ++-- extensions/dacpac/src/wizard/pages/deployConfigPage.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/dacpac/src/test/testDacFxConfigPages.ts b/extensions/dacpac/src/test/testDacFxConfigPages.ts index 7754b01805..e2321293a4 100644 --- a/extensions/dacpac/src/test/testDacFxConfigPages.ts +++ b/extensions/dacpac/src/test/testDacFxConfigPages.ts @@ -22,7 +22,7 @@ export class TestDeployConfigPage extends DeployConfigPage { } SetDatabaseDropDown(): void { - this.databaseDropdown.value = { name: 'DummyDatabase', displayName: 'DummyDatabase' }; + this.databaseDropdown.value = 'DummyDatabase'; } SetFileName(): void { diff --git a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts index 5c11e34f9c..cf05f04ab7 100644 --- a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts +++ b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts @@ -104,12 +104,12 @@ export abstract class DacFxConfigPage extends BasePage { // Handle database changes this.databaseDropdown.onValueChanged(() => { - const databaseDropdownValue = this.databaseDropdown.value; + const databaseDropdownValue: string = this.databaseDropdown.value as string; if (!databaseDropdownValue) { return; } - this.model.database = databaseDropdownValue as string; + this.model.database = databaseDropdownValue; this.fileTextBox.value = this.generateFilePathFromDatabaseAndTimestamp(); this.model.filePath = this.fileTextBox.value; }); diff --git a/extensions/dacpac/src/wizard/pages/deployConfigPage.ts b/extensions/dacpac/src/wizard/pages/deployConfigPage.ts index a361016d6b..38c2b85c46 100644 --- a/extensions/dacpac/src/wizard/pages/deployConfigPage.ts +++ b/extensions/dacpac/src/wizard/pages/deployConfigPage.ts @@ -142,12 +142,12 @@ export class DeployConfigPage extends DacFxConfigPage { //Handle database changes this.databaseDropdown.onValueChanged(() => { - const databaseDropdownValue = this.databaseDropdown.value as azdata.CategoryValue; + const databaseDropdownValue: string = this.databaseDropdown.value as string; if (!databaseDropdownValue) { return; } - this.model.database = databaseDropdownValue.name; + this.model.database = databaseDropdownValue; }); this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).withProperties({