Skip to content

Commit d205580

Browse files
Only show free for 1 year for SM standalone (#17914)
1 parent 48941a3 commit d205580

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@
3838
{{ i.amount | currency: "$" }}
3939
</td>
4040
<td bitCell class="tw-text-right">
41-
<ng-container
42-
*ngIf="
43-
sub?.customerDiscount?.appliesTo?.includes(i.productId);
44-
else calculateElse
45-
"
46-
>
41+
<ng-container *ngIf="isSecretsManagerTrial(); else calculateElse">
4742
{{ "freeForOneYear" | i18n }}
4843
</ng-container>
4944
<ng-template #calculateElse>
@@ -52,7 +47,7 @@
5247
{{ i.quantity * i.amount | currency: "$" }} /{{ i.interval | i18n }}
5348
</span>
5449
<span
55-
*ngIf="customerDiscount?.percentOff && !isSecretsManagerTrial()"
50+
*ngIf="customerDiscount?.percentOff"
5651
class="tw-line-through !tw-text-muted"
5752
>{{
5853
calculateTotalAppliedDiscount(i.quantity * i.amount) | currency: "$"

apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,13 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
403403
}
404404

405405
isSecretsManagerTrial(): boolean {
406-
return (
406+
const isSmStandalone = this.sub?.customerDiscount?.id === "sm-standalone";
407+
const appliesToProduct =
407408
this.sub?.subscription?.items?.some((item) =>
408409
this.sub?.customerDiscount?.appliesTo?.includes(item.productId),
409-
) ?? false
410-
);
410+
) ?? false;
411+
412+
return isSmStandalone && appliesToProduct;
411413
}
412414

413415
closeChangePlan() {

0 commit comments

Comments
 (0)