Tenant selction bug (#23349)

This commit is contained in:
brian-harris
2023-06-08 12:39:32 -07:00
committed by GitHub
parent c5bc541090
commit f9b4c52211
11 changed files with 92 additions and 92 deletions

View File

@@ -468,7 +468,7 @@ export function getAzureTenants(account?: Account): Tenant[] {
return account?.properties.tenants || [];
}
export async function getAzureSubscriptions(account?: Account): Promise<azureResource.AzureResourceSubscription[]> {
export async function getAzureSubscriptions(account?: Account, tenantId?: string): Promise<azureResource.AzureResourceSubscription[]> {
let subscriptions: azureResource.AzureResourceSubscription[] = [];
try {
subscriptions = account && !isAccountTokenStale(account)
@@ -477,8 +477,9 @@ export async function getAzureSubscriptions(account?: Account): Promise<azureRes
} catch (e) {
logError(TelemetryViews.Utils, 'utils.getAzureSubscriptions', e);
}
subscriptions.sort((a, b) => a.name.localeCompare(b.name));
return subscriptions;
const filtered = subscriptions.filter(subscription => subscription.tenant === tenantId);
filtered.sort((a, b) => a.name.localeCompare(b.name));
return filtered;
}
export async function getAzureSubscriptionsDropdownValues(subscriptions: azureResource.AzureResourceSubscription[]): Promise<CategoryValue[]> {
@@ -1167,3 +1168,8 @@ export function createRegistrationInstructions(view: ModelView, testConnectionBu
flexFlow: 'column'
}).component();
}
export function clearDropDown(dropDown: DropDownComponent): void {
dropDown.values = [];
dropDown.value = undefined;
}