From fe224f9d33380d29cb370a12a3ef10acb535e699 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Mon, 30 Jun 2025 16:41:49 +0200 Subject: [PATCH] fix plan expiration warning --- .../admin/organization/organization_cards.tsx | 66 ++++++------------- 1 file changed, 20 insertions(+), 46 deletions(-) diff --git a/frontend/javascripts/admin/organization/organization_cards.tsx b/frontend/javascripts/admin/organization/organization_cards.tsx index 6b857970c2b..26dd6423343 100644 --- a/frontend/javascripts/admin/organization/organization_cards.tsx +++ b/frontend/javascripts/admin/organization/organization_cards.tsx @@ -161,56 +161,30 @@ export function PlanExceededAlert({ organization }: { organization: APIOrganizat } export function PlanAboutToExceedAlert({ organization }: { organization: APIOrganization }) { - const alerts = []; const activeUser = useWkSelector((state) => state.activeUser); const isAboutToExpire = dayjs.duration(dayjs(organization.paidUntil).diff(dayjs())).asWeeks() <= 6 && !hasPricingPlanExpired(organization); - if (isAboutToExpire) - alerts.push({ - message: - "Your WEBKNOSSOS plan is about to expire soon. Renew your plan now to avoid being downgraded, users being blocked, and losing access to features.", - actionButton: ( - - ), - }); - else { - alerts.push({ - message: - "Your organization is about to exceed the storage space included in your current plan. Upgrade now to avoid your account from being blocked.", - actionButton: ( - - ), - }); - } + if (isAboutToExpire) { + const actionButton = ( + + ); - return ( - <> - {alerts.map((alert) => ( - - ))} - - ); + return ( + + ); + } else return null; }