Fix default auth and 'AzureTenantId' to persist and not reset on selection event (#21289)

This commit is contained in:
Cheena Malhotra
2022-11-23 17:39:03 -08:00
committed by GitHub
parent 86c3f315f2
commit 405b3bbfdb
11 changed files with 24 additions and 20 deletions

View File

@@ -206,10 +206,10 @@ class FlatAccountTreeNodeLoader {
const resourceProviderIds = await this._resourceService.listResourceProviderIds();
for (const subscription of subscriptions) {
for (const providerId of resourceProviderIds) {
const resourceTypes = await this._resourceService.getRootChildren(providerId, this._account, subscription, subscription.tenant!);
const resourceTypes = await this._resourceService.getRootChildren(providerId, this._account, subscription);
for (const resourceType of resourceTypes) {
const resources = await this._resourceService.getChildren(providerId, resourceType.resourceNode, true);
if (resources.length > 0) {
if (resources?.length > 0) {
this._nodes.push(...resources.map(dr => new AzureResourceResourceTreeNode(dr, this._accountNode, this.appContext)));
this._nodes = this.nodes.sort((a, b) => {
return a.getNodeInfo().label.localeCompare(b.getNodeInfo().label);

View File

@@ -126,7 +126,7 @@ class ResourceLoader {
for (const tenant of account.properties.tenants) {
for (const subscription of await this.subscriptionService.getSubscriptions(account, [tenant.id])) {
for (const providerId of await this.resourceService.listResourceProviderIds()) {
for (const group of await this.resourceService.getRootChildren(providerId, account, subscription, subscription.tenant!)) {
for (const group of await this.resourceService.getRootChildren(providerId, account, subscription)) {
const children = await this.resourceService.getChildren(providerId, group.resourceNode);
let groupNode: AzureResourceResourceTreeNode | undefined = this.resourceGroups.get(group.resourceProviderId);
if (groupNode) {

View File

@@ -42,7 +42,7 @@ export class AzureResourceSubscriptionTreeNode extends AzureResourceContainerTre
const children: IAzureResourceNodeWithProviderId[] = [];
for (const resourceProviderId of await resourceService.listResourceProviderIds()) {
children.push(...await resourceService.getRootChildren(resourceProviderId, this.account, this.subscription, this.tenantId));
children.push(...await resourceService.getRootChildren(resourceProviderId, this.account, this.subscription));
}
if (children.length === 0) {