Null check provider in organization management check (#10233)

This commit is contained in:
Alex Morask 2024-07-24 10:13:03 -04:00 committed by GitHub
parent 9a6b37d019
commit 768b5393e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<app-header></app-header> <app-header></app-header>
<bit-container *ngIf="!isProviderManaged"> <bit-container *ngIf="!isManagedByConsolidatedBillingMSP">
<ng-container *ngIf="!firstLoaded && loading"> <ng-container *ngIf="!firstLoaded && loading">
<i class="bwi bwi-spinner bwi-spin text-muted" title="{{ 'loading' | i18n }}"></i> <i class="bwi bwi-spinner bwi-spin text-muted" title="{{ 'loading' | i18n }}"></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span> <span class="tw-sr-only">{{ "loading" | i18n }}</span>
@ -274,7 +274,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
</bit-container> </bit-container>
<bit-container *ngIf="isProviderManaged"> <bit-container *ngIf="isManagedByConsolidatedBillingMSP">
<div <div
class="tw-mx-auto tw-flex tw-flex-col tw-items-center tw-justify-center tw-pt-24 tw-text-center tw-font-bold" class="tw-mx-auto tw-flex tw-flex-col tw-items-center tw-justify-center tw-pt-24 tw-text-center tw-font-bold"
> >

View File

@ -50,7 +50,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
locale: string; locale: string;
showUpdatedSubscriptionStatusSection$: Observable<boolean>; showUpdatedSubscriptionStatusSection$: Observable<boolean>;
manageBillingFromProviderPortal = ManageBilling; manageBillingFromProviderPortal = ManageBilling;
isProviderManaged = false; isManagedByConsolidatedBillingMSP = false;
enableTimeThreshold: boolean; enableTimeThreshold: boolean;
preSelectedProductTier: ProductTierType = ProductTierType.Free; preSelectedProductTier: ProductTierType = ProductTierType.Free;
@ -126,10 +126,10 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
if (this.userOrg.canViewSubscription) { if (this.userOrg.canViewSubscription) {
const enableConsolidatedBilling = await firstValueFrom(this.enableConsolidatedBilling$); const enableConsolidatedBilling = await firstValueFrom(this.enableConsolidatedBilling$);
const provider = await this.providerService.get(this.userOrg.providerId); const provider = await this.providerService.get(this.userOrg.providerId);
this.isProviderManaged = this.isManagedByConsolidatedBillingMSP =
enableConsolidatedBilling && enableConsolidatedBilling &&
this.userOrg.hasProvider && this.userOrg.hasProvider &&
provider.providerStatus == ProviderStatusType.Billable; provider?.providerStatus == ProviderStatusType.Billable;
this.sub = await this.organizationApiService.getSubscription(this.organizationId); this.sub = await this.organizationApiService.getSubscription(this.organizationId);
this.lineItems = this.sub?.subscription?.items; this.lineItems = this.sub?.subscription?.items;