mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 17:23:45 -05:00
[SQL Migration] List resource groups based on available resources (#18846)
* WIP - implemented logic to show resource groups as derived from list of resources, instead of directly listing all resource groups * Remove comments * Remove getResourceGroupByName and craft resource group object manually instead * Update subscription and location list when tenant is changed * Define Azure resource types locally instead of modifying azurecore * Add SQL VM scenario * Split getAzureResourceGroupDropdownValues into four separate functions * Refresh only subscription list when tenant is changed * Create new DMS dialog should show all resource groups * Remove unnecessary async code
This commit is contained in:
@@ -252,7 +252,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
||||
fireOnTextChange: true,
|
||||
}).component();
|
||||
|
||||
this._disposables.push(this._accountTenantDropdown.onValueChanged(value => {
|
||||
this._disposables.push(this._accountTenantDropdown.onValueChanged(async (value) => {
|
||||
/**
|
||||
* Replacing all the tenants in azure account with the tenant user has selected.
|
||||
* All azure requests will only run on this tenant from now on
|
||||
@@ -263,6 +263,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
||||
if (selectedIndex > -1) {
|
||||
this.migrationStateModel._azureAccount.properties.tenants = [this.migrationStateModel.getTenant(selectedIndex)];
|
||||
}
|
||||
await this.populateSubscriptionDropdown();
|
||||
}));
|
||||
|
||||
this._accountTenantFlexContainer = this._view.modelBuilder.flexContainer()
|
||||
@@ -480,7 +481,14 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
||||
public async populateResourceGroupDropdown(): Promise<void> {
|
||||
try {
|
||||
this.updateDropdownLoadingStatus(TargetDropDowns.ResourceGroup, true);
|
||||
this._azureResourceGroupDropdown.values = await this.migrationStateModel.getAzureResourceGroupDropdownValues(this.migrationStateModel._targetSubscription);
|
||||
switch (this.migrationStateModel._targetType) {
|
||||
case MigrationTargetType.SQLMI:
|
||||
this._azureResourceGroupDropdown.values = await this.migrationStateModel.getAzureResourceGroupForManagedInstancesDropdownValues(this.migrationStateModel._targetSubscription);
|
||||
break;
|
||||
case MigrationTargetType.SQLVM:
|
||||
this._azureResourceGroupDropdown.values = await this.migrationStateModel.getAzureResourceGroupForVirtualMachinesDropdownValues(this.migrationStateModel._targetSubscription);
|
||||
break;
|
||||
}
|
||||
selectDefaultDropdownValue(this._azureResourceGroupDropdown, this.migrationStateModel._resourceGroup?.id, false);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
||||
Reference in New Issue
Block a user