mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Tenant selction bug (#23349)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user