From 40ebbd11d35729850da6ec7fa236ff852afe79b4 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Tue, 10 Jun 2025 15:20:57 -0700 Subject: [PATCH] fix: Handle trial ending without cancelation (#2651) Resolves https://github.com/webrecorder/browsertrix/issues/2650 ## Changes Differentials between `trialing` and `trialing_canceled` when displaying messages: - No changes to messages if `trialing_canceled`. - If `trialing`, show messaging that subscription will automatically continue. --------- Co-authored-by: Ilya Kreymer Co-authored-by: Ilya Kreymer --- .../src/features/org/org-status-banner.ts | 58 +++++++----- .../pages/org/settings/components/billing.ts | 90 +++++++++++++------ 2 files changed, 98 insertions(+), 50 deletions(-) diff --git a/frontend/src/features/org/org-status-banner.ts b/frontend/src/features/org/org-status-banner.ts index 0999c6b9..d673470d 100644 --- a/frontend/src/features/org/org-status-banner.ts +++ b/frontend/src/features/org/org-status-banner.ts @@ -1,7 +1,9 @@ import { localized, msg, str } from "@lit/localize"; +import type { SlAlert } from "@shoelace-style/shoelace"; import { differenceInHours } from "date-fns/fp"; import { html, type TemplateResult } from "lit"; import { customElement } from "lit/decorators.js"; +import { when } from "lit/directives/when.js"; import { BtrixElement } from "@/classes/BtrixElement"; import { SubscriptionStatus } from "@/types/billing"; @@ -9,6 +11,7 @@ import { OrgReadOnlyReason } from "@/types/org"; type Alert = { test: () => boolean; + variant?: SlAlert["variant"]; content: () => { title: string | TemplateResult; detail: string | TemplateResult; @@ -30,7 +33,7 @@ export class OrgStatusBanner extends BtrixElement { return html`