From 0715597e8e059e22e232df376054a01baf6610c5 Mon Sep 17 00:00:00 2001 From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Date: Thu, 29 May 2025 15:06:07 +0100 Subject: [PATCH] [PM-21603]Invite Member sub text seat count does not account for sponsorships (#14954) * Resolve the membership count * Get the occupied Seat count from metadata --- .../admin-console/organizations/members/members.component.ts | 5 ++++- .../response/organization-billing-metadata.response.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/admin-console/organizations/members/members.component.ts b/apps/web/src/app/admin-console/organizations/members/members.component.ts index e5a94bc4b4f..4f453762b5d 100644 --- a/apps/web/src/app/admin-console/organizations/members/members.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/members.component.ts @@ -110,8 +110,10 @@ export class MembersComponent extends BaseMembersComponent protected rowHeight = 69; protected rowHeightClass = `tw-h-[69px]`; + private organizationUsersCount = 0; + get occupiedSeatCount(): number { - return this.dataSource.activeUserCount; + return this.organizationUsersCount; } constructor( @@ -218,6 +220,7 @@ export class MembersComponent extends BaseMembersComponent ); this.orgIsOnSecretsManagerStandalone = billingMetadata.isOnSecretsManagerStandalone; + this.organizationUsersCount = billingMetadata.organizationOccupiedSeats; await this.load(); diff --git a/libs/common/src/billing/models/response/organization-billing-metadata.response.ts b/libs/common/src/billing/models/response/organization-billing-metadata.response.ts index d30ad76a147..aa34c37bd1d 100644 --- a/libs/common/src/billing/models/response/organization-billing-metadata.response.ts +++ b/libs/common/src/billing/models/response/organization-billing-metadata.response.ts @@ -11,6 +11,7 @@ export class OrganizationBillingMetadataResponse extends BaseResponse { invoiceCreatedDate: Date | null; subPeriodEndDate: Date | null; isSubscriptionCanceled: boolean; + organizationOccupiedSeats: number; constructor(response: any) { super(response); @@ -25,6 +26,7 @@ export class OrganizationBillingMetadataResponse extends BaseResponse { this.invoiceCreatedDate = this.parseDate(this.getResponseProperty("InvoiceCreatedDate")); this.subPeriodEndDate = this.parseDate(this.getResponseProperty("SubPeriodEndDate")); this.isSubscriptionCanceled = this.getResponseProperty("IsSubscriptionCanceled"); + this.organizationOccupiedSeats = this.getResponseProperty("OrganizationOccupiedSeats"); } private parseDate(dateString: any): Date | null {