1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

Only show free for 1 year for SM standalone (#17914)

This commit is contained in:
Alex Morask
2025-12-10 14:45:06 -06:00
committed by GitHub
parent 48941a3650
commit d205580701
2 changed files with 7 additions and 10 deletions

View File

@@ -38,12 +38,7 @@
{{ i.amount | currency: "$" }} {{ i.amount | currency: "$" }}
</td> </td>
<td bitCell class="tw-text-right"> <td bitCell class="tw-text-right">
<ng-container <ng-container *ngIf="isSecretsManagerTrial(); else calculateElse">
*ngIf="
sub?.customerDiscount?.appliesTo?.includes(i.productId);
else calculateElse
"
>
{{ "freeForOneYear" | i18n }} {{ "freeForOneYear" | i18n }}
</ng-container> </ng-container>
<ng-template #calculateElse> <ng-template #calculateElse>
@@ -52,7 +47,7 @@
{{ i.quantity * i.amount | currency: "$" }} /{{ i.interval | i18n }} {{ i.quantity * i.amount | currency: "$" }} /{{ i.interval | i18n }}
</span> </span>
<span <span
*ngIf="customerDiscount?.percentOff && !isSecretsManagerTrial()" *ngIf="customerDiscount?.percentOff"
class="tw-line-through !tw-text-muted" class="tw-line-through !tw-text-muted"
>{{ >{{
calculateTotalAppliedDiscount(i.quantity * i.amount) | currency: "$" calculateTotalAppliedDiscount(i.quantity * i.amount) | currency: "$"

View File

@@ -403,11 +403,13 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
} }
isSecretsManagerTrial(): boolean { isSecretsManagerTrial(): boolean {
return ( const isSmStandalone = this.sub?.customerDiscount?.id === "sm-standalone";
const appliesToProduct =
this.sub?.subscription?.items?.some((item) => this.sub?.subscription?.items?.some((item) =>
this.sub?.customerDiscount?.appliesTo?.includes(item.productId), this.sub?.customerDiscount?.appliesTo?.includes(item.productId),
) ?? false ) ?? false;
);
return isSmStandalone && appliesToProduct;
} }
closeChangePlan() { closeChangePlan() {