Skip to content

Commit

Permalink
Add the seats info for reseller managed org
Browse files Browse the repository at this point in the history
  • Loading branch information
cyprain-okeke committed Jan 7, 2025
1 parent d34888a commit 17be729
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ <h2 bitTypography="h2">{{ "manageSubscription" | i18n }}</h2>
</ng-template>

<ng-template #setupSelfHost>
<ng-container *ngIf="canShowResellerSeatInfo">
<h2 bitTypography="h2" class="tw-mt-7">{{ "manageSubscription" | i18n }}</h2>
<p bitTypography="body1">{{ seatUsageMessage }}</p>
</ng-container>
<ng-container *ngIf="showSelfHost">
<h2 bitTypography="h2" class="tw-mt-7">
{{ "selfHostingTitleProper" | i18n }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,28 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
get canUseBillingSync() {
return this.userOrg.productTierType === ProductTierType.Enterprise;
}

get canShowResellerSeatInfo(): boolean {
return this.userOrg.hasReseller;
}

get seatUsageMessage(): string {
if (!this.sub?.seats) {
return "";
}

const remainingSeats = this.userOrg.seats - this.sub.seats;

if (this.userOrg.hasReseller) {
return this.i18nService.t(
"seatsRemaining",
remainingSeats.toString(),
this.userOrg.seats.toString(),
);
}

return this.subscriptionDesc;
}
}

/**
Expand Down
13 changes: 13 additions & 0 deletions apps/web/src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -10066,5 +10066,18 @@
"example": "02/14/2024"
}
}
},
"seatsRemaining": {
"message": "You have $REMAINING$ seats remaining out of $TOTAL$ seats assigned to this organization. Contact your provider to manage your subscription.",
"placeholders": {
"remaining": {
"content": "$1",
"example": "5"
},
"total": {
"content": "$2",
"example": "10"
}
}
}
}

0 comments on commit 17be729

Please sign in to comment.