From 7ae59fee2092ebe9cf54252a26ca49e4c9e688ed Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Mon, 13 Jul 2026 18:24:44 +0530 Subject: [PATCH] fix: admin panel bugs found in QA audit - users: wire suspend/block buttons to PATCH /api/admin/users/:id/status (previously only mutated local state, reverted on refresh); add load/action error banners instead of silently emptying the table - [...module]: stop rendering a dead localhost:9201 iframe for legacy modules when VITE_LEGACY_ADMIN_ORIGIN isn't configured (it never is in production); show a clear "not available" message instead - dashboard: surface a banner when /api/admin/dashboard/metrics fails instead of silently showing "No Data" on every widget - credit: fix stray extra closing tag that broke the whole file's JSX parse; restore missing API/authHeaders module helpers dropped in a previous refactor (AI Credits handlers referenced them but they were undefined); replace a dead, broken exportLedgerCsv/ filteredLedger implementation with one matching actual call sites; fix activeTab type/tab keys so the Balance & Ledger and Platform Ledger tabs were actually reachable (they compared against 'balance' /'platform' but the tab buttons only ever set 'ledger') - roles: surface errors when fetching a role's permissions for edit fails, instead of silently swallowing them - runtime-roles: surface fetch/delete errors instead of silently swallowing them or presenting fallback sample data as if real Co-Authored-By: Claude Sonnet 5 --- src/routes/admin/[...module].tsx | 58 ++++++++++------ src/routes/admin/credit.tsx | 67 ++++++++----------- src/routes/admin/index.tsx | 9 +++ src/routes/admin/roles/index.tsx | 12 +++- src/routes/admin/runtime-roles/index.tsx | 51 ++++++++++---- src/routes/admin/users/index.tsx | 85 ++++++++++++++++++------ 6 files changed, 186 insertions(+), 96 deletions(-) diff --git a/src/routes/admin/[...module].tsx b/src/routes/admin/[...module].tsx index f452e76..0244be9 100644 --- a/src/routes/admin/[...module].tsx +++ b/src/routes/admin/[...module].tsx @@ -1,5 +1,5 @@ import { A, useParams } from "@solidjs/router"; -import { createMemo, lazy } from "solid-js"; +import { Show, createMemo, lazy } from "solid-js"; const ApprovalManagementPage = lazy(() => import("./approval")); const VerificationManagementPage = lazy(() => import("./verification")); @@ -77,6 +77,9 @@ export default function LegacyModuleShellPage() { const moduleName = createMemo(() => toTitle(modulePath || "Management")); const legacyPath = createMemo(() => resolveLegacyPath(modulePath)); const legacyUrl = createMemo(() => `${LEGACY_ADMIN_ORIGIN}${legacyPath()}`); + const legacyOriginConfigured = createMemo( + () => Boolean(import.meta.env.VITE_LEGACY_ADMIN_ORIGIN) || import.meta.env.DEV + ); return (
@@ -85,26 +88,39 @@ export default function LegacyModuleShellPage() { Live legacy module embedded for exact design and functionality parity during migration.

- -