From 418d4642da81e09de6a4b445042a26592a017c98 Mon Sep 17 00:00:00 2001
From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com>
Date: Tue, 30 Apr 2024 10:55:00 -0400
Subject: [PATCH] Hide grace period note when in self-serve trial (#8768)
---
...organization-subscription-selfhost.component.html | 5 ++++-
.../self-hosted-organization-subscription.view.ts | 12 ++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html b/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html
index 6d6691f336b..b4c1224db94 100644
--- a/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html
+++ b/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.html
@@ -42,7 +42,10 @@
: subscription.expirationWithGracePeriod
) | date: "mediumDate"
}}
-
+
{{
"selfHostGracePeriodHelp"
| i18n: (subscription.expirationWithGracePeriod | date: "mediumDate")
diff --git a/libs/common/src/billing/models/view/self-hosted-organization-subscription.view.ts b/libs/common/src/billing/models/view/self-hosted-organization-subscription.view.ts
index c1f5640207e..7b496882948 100644
--- a/libs/common/src/billing/models/view/self-hosted-organization-subscription.view.ts
+++ b/libs/common/src/billing/models/view/self-hosted-organization-subscription.view.ts
@@ -58,4 +58,16 @@ export class SelfHostedOrganizationSubscriptionView implements View {
get isExpiredAndOutsideGracePeriod() {
return this.hasExpiration && this.expirationWithGracePeriod < new Date();
}
+
+ /**
+ * In the case of a trial, where there is no grace period, the expirationWithGracePeriod and expirationWithoutGracePeriod will
+ * be exactly the same. This can be used to hide the grace period note.
+ */
+ get isInTrial() {
+ return (
+ this.expirationWithGracePeriod &&
+ this.expirationWithoutGracePeriod &&
+ this.expirationWithGracePeriod.getTime() === this.expirationWithoutGracePeriod.getTime()
+ );
+ }
}