fix bug in dropdown auto-selection (#21977)

This commit is contained in:
brian-harris
2023-02-17 12:06:16 -08:00
committed by GitHub
parent 4852de7b8e
commit 9b841f4a49

View File

@@ -266,16 +266,12 @@ export class TargetSelectionPage extends MigrationWizardPage {
this.migrationStateModel._resourceGroup = undefined!;
this.migrationStateModel._targetServerInstance = undefined!;
const clearDropDown = async (dropDown: azdata.DropDownComponent): Promise<void> => {
dropDown.values = [];
dropDown.value = undefined;
};
await clearDropDown(this._azureAccountsDropdown);
await clearDropDown(this._accountTenantDropdown);
await clearDropDown(this._azureSubscriptionDropdown);
await clearDropDown(this._azureLocationDropdown);
await clearDropDown(this._azureResourceGroupDropdown);
await clearDropDown(this._azureResourceDropdown);
this._clearDropDown(this._azureAccountsDropdown);
this._clearDropDown(this._accountTenantDropdown);
this._clearDropDown(this._azureSubscriptionDropdown);
this._clearDropDown(this._azureLocationDropdown);
this._clearDropDown(this._azureResourceGroupDropdown);
this._clearDropDown(this._azureResourceDropdown);
}
await this.populateAzureAccountsDropdown();
@@ -416,6 +412,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
: undefined!;
this.migrationStateModel.refreshDatabaseBackupPage = true;
}
this._clearDropDown(this._azureLocationDropdown);
await this.populateLocationDropdown();
}));
@@ -446,6 +443,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
: undefined!;
}
this.migrationStateModel.refreshDatabaseBackupPage = true;
this._clearDropDown(this._azureResourceGroupDropdown);
await this.populateResourceGroupDropdown();
}));
@@ -672,6 +670,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
? utils.deepClone(selectedResourceGroup)!
: undefined!;
}
this._clearDropDown(this._azureResourceDropdown);
await this.populateResourceInstanceDropdown();
}));
@@ -1208,4 +1207,9 @@ export class TargetSelectionPage extends MigrationWizardPage {
targetDatabaseCollation.length > 0 &&
sourceDatabaseCollation.toLocaleLowerCase() === targetDatabaseCollation.toLocaleLowerCase();
}
private _clearDropDown(dropDown: azdata.DropDownComponent): void {
dropDown.values = [];
dropDown.value = undefined;
}
}