Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cloudShell pick tenant step #981

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cloudConsole/cloudConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,14 @@ export function createCloudConsole(subscriptionProvider: AzureSubscriptionProvid
// If they have only one tenant with subscriptions, use it. If there's no tenant with subscriptions, use the first tenant.
selectedTenant = tenantsWithSubs[0] ?? tenants[0];
} else {
const duplicates = tenantsWithSubs.filter((tenant, index, self) => self.findIndex(t => t.tenantId === tenant.tenantId) !== index);
// Multipe tenants with subscriptions, user must pick a tenant
serverQueue.push({ type: 'log', args: [localize('selectingTenant', `Selecting tenant...`)] });
const picks = tenantsWithSubs.map(tenant => {
const defaultDomainName: string | undefined = tenant.defaultDomain;
const isDuplicate = duplicates.some(dup => dup.tenantId === tenant.tenantId);
return <IAzureQuickPickItem<TenantIdDescription>>{
label: tenant.displayName,
label: isDuplicate ? `${tenant.displayName} (${tenant.account.label})` : tenant.displayName,
description: defaultDomainName,
data: tenant,
};
Expand Down
Loading