From 310b3ab03f1c626477a6434760f32057d67a16f7 Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Sun, 26 Jul 2026 16:08:15 +0100 Subject: [PATCH] fix: Fixed plans on admin site erroring --- adminsite/app/(staff)/staff/plans/page.tsx | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/adminsite/app/(staff)/staff/plans/page.tsx b/adminsite/app/(staff)/staff/plans/page.tsx index 32ee76d..fc11597 100644 --- a/adminsite/app/(staff)/staff/plans/page.tsx +++ b/adminsite/app/(staff)/staff/plans/page.tsx @@ -10,7 +10,10 @@ import { limitLabel } from "@/lib/format"; export default function PlansPage() { const qc = useQueryClient(); const plans = useQuery({ queryKey: ["plans"], queryFn: api.staff.plans }); - const licenses = useQuery({ queryKey: ["staff-licenses"], queryFn: () => api.staff.licenses() }); + const licenses = useQuery({ + queryKey: ["staff-licenses"], + queryFn: () => api.staff.licenses(), + }); const [draft, setDraft] = useState(null); const save = useMutation({ @@ -39,7 +42,11 @@ export default function PlansPage() { l.tier === draft.tier).length} + issuedCount={ + (licenses.data ?? []).filter( + (l) => l.tier === draft.tier, + ).length + } onConfirm={() => save.mutate(draft)} onCancel={() => setDraft(null)} /> @@ -59,7 +66,9 @@ export default function PlansPage() {
secret groups
-
{limitLabel(p.limits.max_secret_groups)}
+
+ {limitLabel(p.limits.max_secret_groups)} +
channels
@@ -67,7 +76,7 @@ export default function PlansPage() {
features
-
{p.features.join(", ") || "none"}
+
{p.features?.join(", ") || "none"}
@@ -76,8 +85,9 @@ export default function PlansPage() { Deployment is fixed at{" "} - {p.deployment}. Moving a tier between - cloud and self-hosted is a code change, not a form field. + {p.deployment}. + Moving a tier between cloud and self-hosted is a + code change, not a form field.

@@ -86,7 +96,10 @@ export default function PlansPage() { type="button" variant="line" onClick={() => - setDraft({ ...p, limits: { ...p.limits, max_servers: 7 } }) + setDraft({ + ...p, + limits: { ...p.limits, max_servers: 7 }, + }) } > Cap servers at 7 @@ -97,7 +110,9 @@ export default function PlansPage() { onClick={() => setDraft({ ...p, - features: p.features.filter((f) => f !== "oidc"), + features: p.features.filter( + (f) => f !== "oidc", + ), }) } >