Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat: completed deprecation banner
=1a9e8f366e4e
diff --git a/backend/src/ee/routes/v1/license-v2-router.ts b/backend/src/ee/routes/v1/license-v2-router.tsindex 991c452437..9a1b5ce358 100644--- a/backend/src/ee/routes/v1/license-v2-router.ts+++ b/backend/src/ee/routes/v1/license-v2-router.ts@@ -35,12 +35,22 @@ const BillingV2CompareRowSchema = z.object({cells: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))});+// Deprecation detail shown to the user: formatted sunset date + whole days remaining (both nullable).+const BillingV2DeprecationSchema = z.object({+ reason: z.string().optional(),+ nextSteps: z.string().optional(),+ date: z.string().nullable(),+ daysLeft: z.number().nullable()+});+const BillingV2PlanSchema = z.object({tier: z.string(),name: z.string(),selfServe: z.boolean(),salesLed: z.boolean(),trialable: z.boolean(),+ deprecated: z.boolean().optional(),+ deprecation: BillingV2DeprecationSchema.optional(),displayOrder: z.number().optional(),feature: z.string().optional(),base: z.object({ monthly: z.number(), annual: z.number() }).optional(),@@ -54,6 +64,8 @@ const BillingV2CatalogProductSchema = z.object({color: z.string(),addon: z.boolean().optional(),tagline: z.string().optional(),+ deprecated: z.boolean().optional(),+ deprecation: BillingV2DeprecationSchema.optional(),displayOrder: z.number().optional(),plans: BillingV2PlanSchema.array(),includes: z.string().array().optional(),@@ -102,6 +114,9 @@ const BillingV2EntitlementSchema = z.object({isTrialing: z.boolean().optional(),trialEndsAt: z.string().nullable().optional(),renewsOn: z.string().nullable().optional(),+ deprecation: BillingV2DeprecationSchema.extend({+ kind: z.enum(["product", "plan"])+ }).optional(),limit: z.number().nullable().optional(),used: z.number().optional(),unit: z.string().nullable().optional()diff --git a/backend/src/ee/services/license-v2/license-v2-service.ts b/backend/src/ee/services/license-v2/license-v2-service.tsindex c861170db4..3c788928e6 100644--- a/backend/src/ee/services/license-v2/license-v2-service.ts+++ b/backend/src/ee/services/license-v2/license-v2-service.ts@@ -22,6 +22,7 @@ import { TPermissionServiceFactory } from "../permission/permission-service-typeimport {BillingV2CatalogProduct,BillingV2CompareRow,+ BillingV2Deprecation,BillingV2Dim,BillingV2Entitlement,BillingV2EntitlementDim,@@ -128,6 +129,35 @@ const formatShortDate = (unixSeconds: number | null | undefined): string | nullreturn new Date(unixSeconds * 1000).toLocaleDateString("en-US", { month: "short", day: "numeric" });};+// deprecationDate arrives as unix seconds/ms or an ISO string depending on the server; normalize both.+const parseDeprecationDate = (value: number | string | null | undefined): Date | null => {+ if (value === null || value === undefined) {+ return null;+ }+ const date = typeof value === "number" ? new Date(value < 1e12 ? value * 1000 : value) : new Date(value);+ return Number.isNaN(date.getTime()) ? null : date;+};++// Build the client-facing deprecation detail (formatted date + whole days remaining) when deprecated.+const toDeprecation = (input: {+ deprecated?: boolean;+ reason?: string | null;+ nextSteps?: string | null;+ date?: number | string | null;+}): BillingV2Deprecation | undefined => {+ if (!input.deprecated) {+ return undefined;+ }+ const date = parseDeprecationDate(input.date);+ const daysLeft = date ? Math.max(0, Math.ceil((date.getTime() - Date.now()) / (24 * 60 * 60 * 1000))) : null;+ return {+ reason: input.reason ?? undefined,+ nextSteps: input.nextSteps ?? undefined,+ date: date ? date.toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" }) : null,+ daysLeft+ };+};+const resolveSubState = (subscription: TSubscriptionResponse | null): BillingV2SubState => {if (!subscription || !subscription.status) {return "no-subscription";@@ -229,12 +259,20 @@ const toPlan = (product: TCatalogProduct, plan: TCatalogProduct["plans"][number]});});+ const deprecation = toDeprecation({+ deprecated: plan.deprecated,+ reason: plan.deprecationReason,+ nextSteps: plan.deprecationNextSteps,+ date: plan.deprecationDate+ });const result: BillingV2Plan = {tier: plan.tier,name: plan.name,selfServe: plan.selfServe,salesLed: plan.salesLed,trialable: plan.trialable ?? false,+ deprecated: plan.deprecated ?? false,+ ...(deprecation ? { deprecation } : {}),displayOrder: plan.displayOrder ?? undefined,feature: plan.feature,dims@@ -267,6 +305,12 @@ const toCatalogProduct = (product: TCatalogProduct): BillingV2CatalogProduct =>return { label: row.label, cells };});+ const deprecation = toDeprecation({+ deprecated: product.deprecated,+ reason: product.deprecationReason,+ nextSteps: product.deprecationNextSteps,+ date: product.deprecationDate+ });return {id: product.id,name: product.name,@@ -274,6 +318,8 @@ const toCatalogProduct = (product: TCatalogProduct): BillingV2CatalogProduct =>color: product.color || FALLBACK_COLOR,addon: product.addon,tagline: product.tagline,+ deprecated: product.deprecated ?? false,+ ...(deprecation ? { deprecation } : {}),displayOrder: product.displayOrder ?? undefined,plans,includes: product.includes,@@ -412,15 +458,16 @@ export const licenseV2ServiceFactory = ({const labelByDimension = new Map<string, string>();const nounByDimension = new Map<string, string>();- // Fetch the catalog when any item carries dimensions or limits to name; the pinned subscription- // dimensions supply used/limit/rate, the catalog supplies each dimension's label and noun.- const needsCatalog = Boolean(- subscription?.items.some((item) => item.dimensions.length > 0 || Object.keys(item.limits).length > 0)- );+ const catalogProductById = new Map<string, TCatalogProduct>();+ // Fetch the catalog whenever there are items: the pinned subscription dimensions supply+ // used/limit/rate while the catalog supplies each dimension's label/noun and the product/plan+ // deprecation flags (an item can be deprecated without carrying dimensions).+ const needsCatalog = Boolean(subscription?.items.length);if (needsCatalog) {try {const catalog = await licenseClient.getCatalog();catalog?.products.forEach((product) => {+ catalogProductById.set(product.id, product);product.dimensions.forEach((dimension) => {labelByDimension.set(`${product.id}:${dimension.key}`, dimension.label);nounByDimension.set(`${product.id}:${dimension.key}`, dimension.noun);@@ -540,6 +587,34 @@ export const licenseV2ServiceFactory = ({.map((line) => line.currentPeriodEnd as number);const renewsOn = productLineEnds.length > 0 ? formatDate(Math.min(...productLineEnds)) : null;+ // Deprecation kind + sunset come from the catalog (product deprecation supersedes plan). The+ // sunset date lives only on the catalog; the subscription item's deprecation may carry+ // contract-specific reason/nextSteps text, which wins over the catalog copy when present.+ const catalogProduct = catalogProductById.get(item.productId);+ const catalogPlan = catalogProduct?.plans.find((candidate) => candidate.tier === item.plan);+ let deprecation: BillingV2Entitlement["deprecation"];+ if (catalogProduct?.deprecated) {+ const base = toDeprecation({+ deprecated: true,+ reason: item.deprecation?.reason ?? catalogProduct.deprecationReason,+ nextSteps: item.deprecation?.nextSteps ?? catalogProduct.deprecationNextSteps,+ date: catalogProduct.deprecationDate+ });+ if (base) {+ deprecation = { kind: "product", ...base };+ }+ } else if (catalogPlan?.deprecated) {+ const base = toDeprecation({+ deprecated: true,+ reason: item.deprecation?.reason ?? catalogPlan.deprecationReason,+ nextSteps: item.deprecation?.nextSteps ?? catalogPlan.deprecationNextSteps,+ date: catalogPlan.deprecationDate+ });+ if (base) {+ deprecation = { kind: "plan", ...base };+ }+ }+entitlements[item.productId] = {entitled: true,planTier: item.plan,@@ -551,6 +626,7 @@ export const licenseV2ServiceFactory = ({isTrialing: item.isTrialing ?? false,trialEndsAt: item.trialEndsAt ? formatDate(item.trialEndsAt) : null,renewsOn,+ ...(deprecation ? { deprecation } : {}),used,limit,unitdiff --git a/backend/src/ee/services/license-v2/license-v2-types.ts b/backend/src/ee/services/license-v2/license-v2-types.tsindex 95cd20f53c..5929735d48 100644--- a/backend/src/ee/services/license-v2/license-v2-types.ts+++ b/backend/src/ee/services/license-v2/license-v2-types.ts@@ -25,6 +25,15 @@ export type BillingV2CompareRow = {// A single purchasable (or sales-led) plan within a product. A product exposes an ordered list of// these — the free tier is implicit and never listed.+// Deprecation detail rendered to the user. date is a formatted display string; daysLeft is whole days+// until the sunset (>= 0), both null when no date was supplied. Present only when something is deprecated.+export type BillingV2Deprecation = {+ reason?: string;+ nextSteps?: string;+ date: string | null;+ daysLeft: number | null;+};+export type BillingV2Plan = {tier: string;name: string;@@ -32,6 +41,9 @@ export type BillingV2Plan = {salesLed: boolean;// Offers a self-serve trial; the UI shows a trial CTA only when selfServe && trialable.trialable: boolean;+ // Kept for existing customers, closed to new ones. deprecation carries the reason/nextSteps/date.+ deprecated?: boolean;+ deprecation?: BillingV2Deprecation;// Sort key within the product; the UI orders plan cards by it.displayOrder?: number;feature?: string;@@ -46,6 +58,9 @@ export type BillingV2CatalogProduct = {color: string;addon?: boolean;tagline?: string;+ // Kept for existing customers, closed to new ones (supersedes plan deprecation).+ deprecated?: boolean;+ deprecation?: BillingV2Deprecation;// Sort key across products; the UI orders the product list by it.displayOrder?: number;plans: BillingV2Plan[];@@ -114,6 +129,9 @@ export type BillingV2Entitlement = {// Formatted date this product's soonest line renews (each product bills on its own cycle); null when// the product has no dated line (e.g. feature-only entitlements).renewsOn?: string | null;+ // Present when this entitled product (or its plan) is deprecated. kind = "product" is terminal (the+ // product is being discontinued); kind = "plan" is a plan retiring with a forward path. Product wins.+ deprecation?: BillingV2Deprecation & { kind: "product" | "plan" };limit?: number | null;used?: number;// Singular noun for the limited dimension (e.g. "certificate"), resolved from the catalog so thediff --git a/backend/src/services/license-client/license-client-types.ts b/backend/src/services/license-client/license-client-types.tsindex 58e06d643f..f81ba9bb7f 100644--- a/backend/src/services/license-client/license-client-types.ts+++ b/backend/src/services/license-client/license-client-types.ts@@ -57,6 +57,12 @@ const catalogPlanSchema = zsalesLed: z.boolean(),// Offers a self-serve trial; a plan is trialable only when selfServe && trialable.trialable: z.boolean().default(false),+ // true = kept for existing customers, closed to new ones. reason/nextSteps/date shown when true.+ deprecated: z.boolean().default(false),+ deprecationReason: z.string().nullish(),+ deprecationNextSteps: z.string().nullish(),+ // Sunset date. Number (unix) or ISO string depending on server; normalized in code.+ deprecationDate: z.union([z.number(), z.string()]).nullish(),// Sort key within the product; the server already returns plans sorted by it.displayOrder: z.number().nullish(),feature: z.string().optional(),@@ -88,6 +94,11 @@ const catalogProductSchema = zicon: z.string().optional(),color: z.string().optional(),addon: z.boolean(),+ // true = kept for existing customers, closed to new ones. Supersedes plan deprecation.+ deprecated: z.boolean().default(false),+ deprecationReason: z.string().nullish(),+ deprecationNextSteps: z.string().nullish(),+ deprecationDate: z.union([z.number(), z.string()]).nullish(),// Sort key across products; the server already returns products sorted by it.displayOrder: z.number().nullish(),dimensions: z.array(catalogDimensionSchema),@@ -147,6 +158,9 @@ const subscriptionItemSchema = zstatus: z.string().optional(),isTrialing: z.boolean().default(false),trialEndsAt: z.number().nullish(),+ // Present only when this item's product OR plan is deprecated (product supersedes plan). The item+ // keeps working; this carries the contract-specific message (the sunset date comes from the catalog).+ deprecation: z.object({ reason: z.string().nullish(), nextSteps: z.string().nullish() }).nullish(),dimensions: z.array(subscriptionItemDimensionSchema).default([])}).passthrough();diff --git a/frontend/src/hooks/api/billingV2/index.tsx b/frontend/src/hooks/api/billingV2/index.tsxindex 679205c251..3d7dcfe9fc 100644--- a/frontend/src/hooks/api/billingV2/index.tsx+++ b/frontend/src/hooks/api/billingV2/index.tsx@@ -17,6 +17,7 @@ export type {BillingV2CatalogProduct,BillingV2CommitmentChange,BillingV2CompareRow,+ BillingV2Deprecation,BillingV2Dim,BillingV2Entitlement,BillingV2EntitlementDim,diff --git a/frontend/src/hooks/api/billingV2/types.ts b/frontend/src/hooks/api/billingV2/types.tsindex 299a4109e7..899ee5427d 100644--- a/frontend/src/hooks/api/billingV2/types.ts+++ b/frontend/src/hooks/api/billingV2/types.ts@@ -19,6 +19,15 @@ export type BillingV2CompareRow = {cells: Record<string, string | boolean | number>;};+// Deprecation detail rendered to the user. date is a formatted display string, daysLeft is whole days+// until the sunset (>= 0); both null when no date was supplied.+export type BillingV2Deprecation = {+ reason?: string;+ nextSteps?: string;+ date: string | null;+ daysLeft: number | null;+};+// A single purchasable (or sales-led) plan of a product. The free tier is implicit and never listed.export type BillingV2Plan = {tier: string;@@ -27,6 +36,9 @@ export type BillingV2Plan = {salesLed: boolean;// Offers a self-serve trial; the trial CTA shows only when selfServe && trialable.trialable: boolean;+ // Kept for existing customers, closed to new ones; deprecation carries the reason/nextSteps/date.+ deprecated?: boolean;+ deprecation?: BillingV2Deprecation;// Sort key within the product; plan cards render in this order.displayOrder?: number;feature?: string;@@ -41,6 +53,9 @@ export type BillingV2CatalogProduct = {color: string;addon?: boolean;tagline?: string;+ // Kept for existing customers, closed to new ones (supersedes plan deprecation).+ deprecated?: boolean;+ deprecation?: BillingV2Deprecation;// Sort key across products; the product list renders in this order.displayOrder?: number;plans: BillingV2Plan[];@@ -113,6 +128,9 @@ export type BillingV2Entitlement = {// Formatted date this product's soonest line renews (each product bills on its own cycle); null when// the product has no dated line.renewsOn?: string | null;+ // Present when this entitled product (or its plan) is deprecated. kind "product" is terminal (being+ // discontinued); kind "plan" is a plan retiring with a forward path. Product supersedes plan.+ deprecation?: BillingV2Deprecation & { kind: "product" | "plan" };limit?: number | null;used?: number;// Singular noun for the limited dimension (e.g. "certificate"); rendered, pluralized, beside the count.diff --git a/frontend/src/pages/organization/BillingV2Page/components/Overview.tsx b/frontend/src/pages/organization/BillingV2Page/components/Overview.tsxindex 88b8a0685a..1eb7b4d957 100644--- a/frontend/src/pages/organization/BillingV2Page/components/Overview.tsx+++ b/frontend/src/pages/organization/BillingV2Page/components/Overview.tsx@@ -1,8 +1,9 @@-import { ReactNode } from "react";+import { ReactNode, useState } from "react";import {ArrowBigUpDashIcon,Building2,CircleAlert,+ Clock,CreditCard,ExternalLink,Info,@@ -25,6 +26,10 @@ import {CardDescription,CardHeader,CardTitle,+ Dialog,+ DialogContent,+ DialogHeader,+ DialogTitle,Empty,EmptyDescription,EmptyHeader,@@ -352,6 +357,21 @@ const BillingHeaderCard = ({ overview, catalog }: BillingHeaderCardProps) => {// Capitalize a plan tier ("pro" -> "Pro") for the badge beside an active product's name.const tierLabel = (tier: string): string => tier.charAt(0).toUpperCase() + tier.slice(1);+type Deprecation = NonNullable<BillingV2Entitlement["deprecation"]>;++// Concise, single-line deprecation summary for the product row. The full reason/nextSteps live in the+// top banner + its "See what changes" dialog, so this stays short and truncates rather than wrapping.+const deprecationSubline = (deprecation: Deprecation, planTier?: string): string => {+ if (deprecation.kind === "product") {+ return deprecation.date ? `Discontinued — access ends ${deprecation.date}` : "Discontinued";+ }+ const tier = planTier ? tierLabel(planTier) : "This plan";+ const base = deprecation.date+ ? `${tier} plan retires ${deprecation.date}`+ : `${tier} plan is retiring`;+ return deprecation.nextSteps ? `${base} · ${deprecation.nextSteps}` : base;+};+type ProductRowProps = {prod: BillingV2CatalogProduct;entitlement?: BillingV2Entitlement;@@ -364,13 +384,17 @@ const ProductRow = ({ prod, entitlement, readOnly, onManage, onContact }: Producconst entitled = Boolean(entitlement?.entitled);const selfServe = prod.plans.some((plan) => plan.selfServe);const salesLed = prod.plans.some((plan) => plan.salesLed);+ const deprecation = entitlement?.deprecation;+ const isProductDeprecated = deprecation?.kind === "product";+ const isPlanDeprecated = deprecation?.kind === "plan";let action = null;if (!readOnly) {if (entitled) {+ // A retiring plan nudges the customer toward the replacement; everything else opens Manage.action = (<Button variant="outline" size="sm" onClick={() => onManage(prod.id)}>- Manage+ {isPlanDeprecated ? "Review plan" : "Manage"}</Button>);} else if (selfServe) {@@ -421,22 +445,42 @@ const ProductRow = ({ prod, entitlement, readOnly, onManage, onContact }: Producreturn (<div className="flex flex-col gap-3 border-t border-border py-4 first:border-t-0"><div className="flex items-center gap-4">- <ProductIcon product={prod} />+ {/* A discontinued product's icon is dimmed so a glance down the list reads it as winding down. */}+ <div className={isProductDeprecated ? "opacity-40 grayscale" : undefined}>+ <ProductIcon product={prod} />+ </div><div className="flex min-w-0 flex-1 flex-col gap-1.5"><div className="flex flex-wrap items-center gap-2"><span className="text-sm font-semibold text-foreground">{prod.name}</span>- {entitlement?.planTier && (- <Badge variant="neutral">{tierLabel(entitlement.planTier)}</Badge>- )}+ {/* Plan retiring: strikethrough tier chip in warning tone. Otherwise the plain tier chip. */}+ {entitlement?.planTier &&+ (isPlanDeprecated ? (+ <Badge variant="warning" className="line-through">+ {tierLabel(entitlement.planTier)}+ </Badge>+ ) : (+ <Badge variant="neutral">{tierLabel(entitlement.planTier)}</Badge>+ ))}+ {isProductDeprecated && <Badge variant="danger">Deprecated</Badge>}{prod.addon && <Badge variant="neutral">Add-on</Badge>}{isTrialing ? <Badge variant="info">Trial</Badge> : <ActiveBadge />}</div>- <div className="flex flex-wrap items-center gap-2 text-xs text-muted">- {!isTrialing && <CadenceBadge cadence={entitlement?.cadence} />}- {isTrialing && entitlement?.trialEndsAt ? (- <span>Trial ends {entitlement.trialEndsAt}</span>+ <div className="flex min-w-0 flex-wrap items-center gap-2 text-xs text-muted">+ {deprecation ? (+ <span+ className={cn("truncate", isProductDeprecated ? "text-danger" : "text-warning")}+ >+ {deprecationSubline(deprecation, entitlement?.planTier)}+ </span>) : (- entitlement?.renewsOn && <span>Renews {entitlement.renewsOn}</span>+ <>+ {!isTrialing && <CadenceBadge cadence={entitlement?.cadence} />}+ {isTrialing && entitlement?.trialEndsAt ? (+ <span>Trial ends {entitlement.trialEndsAt}</span>+ ) : (+ entitlement?.renewsOn && <span>Renews {entitlement.renewsOn}</span>+ )}+ </>)}</div></div>@@ -486,6 +530,11 @@ type ProductsCardProps = {};const ProductsCard = ({ overview, catalog, readOnly, onManage, onContact }: ProductsCardProps) => {+ // A deprecated product stays visible to existing subscribers but is closed to new ones, so hide it+ // from anyone who isn't already entitled to it (plan-level deprecation still shows the product).+ const visible = [...catalog]+ .filter((prod) => !prod.deprecated || overview.entitlements[prod.id]?.entitled)+ .sort(byDisplayOrder);return (<Card><CardHeader>@@ -496,14 +545,14 @@ const ProductsCard = ({ overview, catalog, readOnly, onManage, onContact }: Prod<CardDescription>Everything you can run on your subscription.</CardDescription></CardHeader><CardContent>- {catalog.length === 0 ? (+ {visible.length === 0 ? (<CardEmptytitle="No products available"description="Products will appear here once they're available."/>) : (<div className="flex flex-col">- {[...catalog].sort(byDisplayOrder).map((prod) => (+ {visible.map((prod) => (<ProductRowkey={prod.id}prod={prod}@@ -768,6 +817,210 @@ const InvoicesCard = ({ invoices }: InvoicesCardProps) => (</Card>);+type DeprecatedEntry = {+ productId: string;+ name: string;+ planTier?: string;+ deprecation: Deprecation;+};++const DEPRECATION_TONE = {+ warning: {+ container: "border-warning/30 bg-warning/[0.04]",+ iconBox: "border-warning/20 bg-warning/10 text-warning",+ pill: "border-warning/20 bg-warning/[0.06]",+ chip: "border border-warning/30 bg-warning/10 text-warning"+ },+ danger: {+ container: "border-danger/30 bg-danger/[0.04]",+ iconBox: "border-danger/20 bg-danger/10 text-danger",+ pill: "border-danger/20 bg-danger/[0.06]",+ chip: "border border-danger/30 bg-danger/10 text-danger"+ }+};++const daysLeftLabel = (daysLeft: number | null): string | null => {+ if (daysLeft === null) {+ return null;+ }+ return `${daysLeft.toLocaleString()} ${daysLeft === 1 ? "day" : "days"} left`;+};++// Rich "See what changes" dialog body: an icon + title/subtitle header, the sunset date as a pill with+// a day-countdown chip, then the full (untruncated) reason and next-steps sections.+const DeprecationDetailBody = ({ entry }: { entry: DeprecatedEntry }) => {+ const { deprecation, name, planTier } = entry;+ const isProduct = deprecation.kind === "product";+ const urgent = deprecation.daysLeft !== null && deprecation.daysLeft <= 14;+ const tone = DEPRECATION_TONE[isProduct || urgent ? "danger" : "warning"];+ const label = daysLeftLabel(deprecation.daysLeft);+ const title = isProduct+ ? `${name} is being discontinued`+ : `The ${planTier ? tierLabel(planTier) : "current"} plan is being retired`;+ const subtitle = isProduct+ ? "This product is winding down"+ : `${planTier ? tierLabel(planTier) : "Current"} plan · ${name}`;++ return (+ <>+ <DialogHeader>+ <div className="flex items-start gap-3">+ <div+ className={cn(+ "flex size-9 shrink-0 items-center justify-center rounded-lg border [&>svg]:size-4",+ tone.iconBox+ )}+ >+ {isProduct ? <CircleAlert /> : <TriangleAlert />}+ </div>+ <div className="flex min-w-0 flex-col gap-0.5">+ <DialogTitle className="text-base">{title}</DialogTitle>+ <span className="truncate text-xs text-muted">{subtitle}</span>+ </div>+ </div>+ </DialogHeader>+ <div className="flex flex-col gap-4">+ {deprecation.date && (+ <div+ className={cn(+ "flex flex-wrap items-center gap-2 rounded-lg border px-3 py-2",+ tone.pill+ )}+ >+ <Clock className="size-4 text-muted" />+ <span className="text-sm text-foreground">+ {isProduct ? "Access ends" : "Retires"}{" "}+ <span className="font-medium">{deprecation.date}</span>+ </span>+ {label && (+ <span+ className={cn("ml-auto rounded-md px-1.5 py-0.5 text-xs font-medium", tone.chip)}+ >+ {label}+ </span>+ )}+ </div>+ )}+ {deprecation.reason && (+ <div className="flex flex-col gap-1">+ <span className="text-[11px] font-medium tracking-wide text-muted uppercase">Why</span>+ <p className="text-sm text-foreground">{deprecation.reason}</p>+ </div>+ )}+ {deprecation.nextSteps && (+ <div className="flex flex-col gap-1">+ <span className="text-[11px] font-medium tracking-wide text-muted uppercase">+ What to do+ </span>+ <p className="text-sm text-foreground">{deprecation.nextSteps}</p>+ </div>+ )}+ </div>+ </>+ );+};++// Attention banners above the summary, one per affected product. A retiring plan reads forward-looking+// in warning tone; a discontinued product reads terminal in danger tone, escalating warning→danger+// inside the final window. Concise here with a "See what changes" detail dialog for the full copy.+// Products sort terminal-first, then most-urgent-first.+const DeprecationBanners = ({+ overview,+ catalog,+ onManage,+ onContact+}: {+ overview: BillingV2Overview;+ catalog: BillingV2CatalogProduct[];+ onManage: (productId: string) => void;+ onContact: (prod: BillingV2CatalogProduct) => void;+}) => {+ const [detail, setDetail] = useState<DeprecatedEntry | null>(null);++ const entries: DeprecatedEntry[] = Object.entries(overview.entitlements)+ .filter(([, entitlement]) => Boolean(entitlement.deprecation))+ .map(([productId, entitlement]) => ({+ productId,+ name: catalog.find((prod) => prod.id === productId)?.name ?? productId,+ planTier: entitlement.planTier,+ deprecation: entitlement.deprecation as Deprecation+ }))+ .sort((a, b) => {+ const rank = (entry: DeprecatedEntry) => (entry.deprecation.kind === "product" ? 0 : 1);+ if (rank(a) !== rank(b)) {+ return rank(a) - rank(b);+ }+ return (a.deprecation.daysLeft ?? Infinity) - (b.deprecation.daysLeft ?? Infinity);+ });++ if (entries.length === 0) {+ return null;+ }++ return (+ <>+ {entries.map((entry) => {+ const { deprecation, name, planTier, productId } = entry;+ const isProduct = deprecation.kind === "product";+ // Plan retirement escalates from warning to danger once inside the final two-week window.+ const urgent = deprecation.daysLeft !== null && deprecation.daysLeft <= 14;+ const variant = isProduct || urgent ? "danger" : "warning";+ const catalogProduct = catalog.find((prod) => prod.id === productId);+ const label = daysLeftLabel(deprecation.daysLeft);+ const title = isProduct+ ? `${name} is being discontinued`+ : `The ${planTier ? tierLabel(planTier) : "current"} plan for ${name} is being retired`;+ const lead = isProduct+ ? `This product will stop working${deprecation.date ? ` on ${deprecation.date}` : ""}.`+ : deprecation.nextSteps || deprecation.reason || "";+ const hasDetail = Boolean(deprecation.reason || deprecation.nextSteps || deprecation.date);++ return (+ <Alert key={productId} variant={variant}>+ {isProduct ? <CircleAlert /> : <TriangleAlert />}+ <AlertTitle>{title}</AlertTitle>+ <AlertDescription>+ <span className="line-clamp-2">+ {lead}+ {label && (+ <>+ {" — "}+ <span className="font-medium">{label}</span>+ </>+ )}+ </span>+ <div className="mt-3 flex flex-wrap gap-2">+ {isProduct ? (+ catalogProduct && (+ <Button variant="danger" size="sm" onClick={() => onContact(catalogProduct)}>+ Contact support+ </Button>+ )+ ) : (+ <Button variant="outline" size="sm" onClick={() => onManage(productId)}>+ Review plan+ </Button>+ )}+ {hasDetail && (+ <Button variant="ghost" size="sm" onClick={() => setDetail(entry)}>+ See what changes+ </Button>+ )}+ </div>+ </AlertDescription>+ </Alert>+ );+ })}++ <Dialog open={Boolean(detail)} onOpenChange={(open) => !open && setDetail(null)}>+ <DialogContent className="max-w-lg">+ {detail && <DeprecationDetailBody entry={detail} />}+ </DialogContent>+ </Dialog>+ </>+ );+};+export type OverviewProps = {overview?: BillingV2Overview;catalog: BillingV2CatalogProduct[];@@ -842,6 +1095,12 @@ export const Overview = ({onUpdatePayment={onUpdatePayment}onManageSubscription={onManageSubscription}/>+ <DeprecationBanners+ overview={overview}+ catalog={catalog}+ onManage={onUpgrade}+ onContact={onContact}+ /><BillingHeaderCard overview={overview} catalog={catalog} /><ProductsCardoverview={overview}diff --git a/frontend/src/pages/organization/BillingV2Page/components/ProductSheet.tsx b/frontend/src/pages/organization/BillingV2Page/components/ProductSheet.tsxindex b3e169e641..2eb0b71d3f 100644--- a/frontend/src/pages/organization/BillingV2Page/components/ProductSheet.tsx+++ b/frontend/src/pages/organization/BillingV2Page/components/ProductSheet.tsx@@ -379,8 +379,11 @@ export const ProductSheet = ({const displayCadence: BillingV2Cadence = entitlement?.cadence === "annual" ? "annual" : "monthly";const canChangeCommitment = (entitlement?.dimensions ?? []).some(dimAnnualCommitted);- // Render plan cards in the catalog's displayOrder (already sorted server-side).- const plans = [...(prod.plans ?? [])].sort(byDisplayOrder);+ // Render plan cards in the catalog's displayOrder (already sorted server-side). A deprecated plan is+ // closed to new customers, so hide it unless the org is already entitled (e.g. currently on it).+ const plans = [...(prod.plans ?? [])]+ .filter((plan) => !plan.deprecated || entitled)+ .sort(byDisplayOrder);const currentTier =entitlement?.planTier ?? (entitled ? plans.find((plan) => plan.selfServe)?.tier : undefined);const gridCols = GRID_COLS[Math.min(plans.length, 3)] ?? GRID_COLS[3];