2026-04-26 23:58:42 +02:00
|
|
|
|
import { A, useParams } from "@solidjs/router";
|
2026-07-13 18:24:44 +05:30
|
|
|
|
import { Show, createMemo, lazy } from "solid-js";
|
2026-04-26 23:58:42 +02:00
|
|
|
|
|
|
|
|
|
|
const ApprovalManagementPage = lazy(() => import("./approval"));
|
|
|
|
|
|
const VerificationManagementPage = lazy(() => import("./verification"));
|
|
|
|
|
|
const UsersManagementPage = lazy(() => import("./users"));
|
|
|
|
|
|
const ExternalDashboardManagementPage = lazy(() => import("./external-dashboard-management"));
|
|
|
|
|
|
const InternalDashboardManagementPage = lazy(() => import("./internal-dashboard-management"));
|
2026-03-19 03:36:46 +01:00
|
|
|
|
|
|
|
|
|
|
function toTitle(value: string): string {
|
|
|
|
|
|
return value
|
|
|
|
|
|
.split(/[-_/]/g)
|
|
|
|
|
|
.filter(Boolean)
|
|
|
|
|
|
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
2026-04-26 23:58:42 +02:00
|
|
|
|
.join(" ");
|
2026-03-19 03:36:46 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
|
const LEGACY_ADMIN_ORIGIN = import.meta.env.VITE_LEGACY_ADMIN_ORIGIN || "http://localhost:9201";
|
2026-03-19 03:36:46 +01:00
|
|
|
|
|
|
|
|
|
|
function resolveLegacyPath(modulePath: string): string {
|
|
|
|
|
|
switch (modulePath) {
|
2026-04-26 23:58:42 +02:00
|
|
|
|
case "roles":
|
|
|
|
|
|
return "/roles?scope=internal";
|
|
|
|
|
|
case "approval-management":
|
|
|
|
|
|
case "approvals":
|
|
|
|
|
|
return "/approval";
|
|
|
|
|
|
case "onboarding-management":
|
|
|
|
|
|
return "/external-dashboard-management";
|
|
|
|
|
|
case "internal-dashboard-management":
|
|
|
|
|
|
return "/internal-dashboard-management";
|
|
|
|
|
|
case "external-dashboard-management":
|
|
|
|
|
|
return "/external-dashboard-management";
|
|
|
|
|
|
case "support":
|
|
|
|
|
|
return "/help";
|
2026-03-19 03:36:46 +01:00
|
|
|
|
default:
|
|
|
|
|
|
return `/${modulePath}`;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default function LegacyModuleShellPage() {
|
|
|
|
|
|
const params = useParams();
|
2026-04-26 23:58:42 +02:00
|
|
|
|
const modulePath = String((params as any).module || "").trim();
|
2026-03-27 05:35:18 +01:00
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
|
if (
|
|
|
|
|
|
modulePath === "approval" ||
|
|
|
|
|
|
modulePath === "approval-management" ||
|
|
|
|
|
|
modulePath === "approvals" ||
|
|
|
|
|
|
modulePath === "approval-status"
|
|
|
|
|
|
) {
|
2026-03-27 05:35:18 +01:00
|
|
|
|
return <ApprovalManagementPage />;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
|
if (
|
|
|
|
|
|
modulePath === "verification" ||
|
|
|
|
|
|
modulePath === "verification-status" ||
|
|
|
|
|
|
modulePath === "verification-management"
|
|
|
|
|
|
) {
|
2026-03-27 05:35:18 +01:00
|
|
|
|
return <VerificationManagementPage />;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
|
if (
|
|
|
|
|
|
modulePath === "users" ||
|
|
|
|
|
|
modulePath === "users-management" ||
|
|
|
|
|
|
modulePath === "user-management"
|
|
|
|
|
|
) {
|
2026-04-02 00:42:42 +02:00
|
|
|
|
return <UsersManagementPage />;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
|
if (modulePath === "external-dashboard-management" || modulePath === "onboarding-management") {
|
2026-04-10 01:17:00 +02:00
|
|
|
|
return <ExternalDashboardManagementPage />;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
|
if (modulePath === "internal-dashboard-management") {
|
2026-04-10 01:17:00 +02:00
|
|
|
|
return <InternalDashboardManagementPage />;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
|
const moduleName = createMemo(() => toTitle(modulePath || "Management"));
|
2026-03-19 03:36:46 +01:00
|
|
|
|
const legacyPath = createMemo(() => resolveLegacyPath(modulePath));
|
|
|
|
|
|
const legacyUrl = createMemo(() => `${LEGACY_ADMIN_ORIGIN}${legacyPath()}`);
|
2026-07-13 18:24:44 +05:30
|
|
|
|
const legacyOriginConfigured = createMemo(
|
|
|
|
|
|
() => Boolean(import.meta.env.VITE_LEGACY_ADMIN_ORIGIN) || import.meta.env.DEV
|
|
|
|
|
|
);
|
2026-03-19 03:36:46 +01:00
|
|
|
|
|
|
|
|
|
|
return (
|
2026-04-06 06:19:14 +02:00
|
|
|
|
<div>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
|
<h1 class="text-2xl font-bold text-gray-900">{moduleName()}</h1>
|
|
|
|
|
|
<p class="mt-1 text-sm text-gray-500">
|
2026-03-19 03:36:46 +01:00
|
|
|
|
Live legacy module embedded for exact design and functionality parity during migration.
|
|
|
|
|
|
</p>
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
|
<section class="rounded-xl border border-gray-200 bg-white shadow-sm">
|
2026-07-13 18:24:44 +05:30
|
|
|
|
<Show
|
|
|
|
|
|
when={legacyOriginConfigured()}
|
|
|
|
|
|
fallback={
|
|
|
|
|
|
<div class="p-6 text-sm text-gray-600">
|
|
|
|
|
|
<p class="font-medium text-gray-900">This module isn’t available yet.</p>
|
|
|
|
|
|
<p class="mt-1">
|
|
|
|
|
|
No legacy admin service is configured for this environment
|
|
|
|
|
|
(VITE_LEGACY_ADMIN_ORIGIN is unset), so “{moduleName()}” can’t be embedded here.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
}
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="actions">
|
|
|
|
|
|
<A
|
|
|
|
|
|
class="inline-flex items-center rounded-lg border border-gray-200 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors"
|
|
|
|
|
|
href={legacyUrl()}
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
>
|
|
|
|
|
|
Open Module In New Tab
|
|
|
|
|
|
</A>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<iframe
|
|
|
|
|
|
src={legacyUrl()}
|
|
|
|
|
|
title={`${moduleName()} (Legacy)`}
|
|
|
|
|
|
style={{
|
|
|
|
|
|
width: "100%",
|
|
|
|
|
|
height: "72vh",
|
|
|
|
|
|
border: "1px solid #e2e8f0",
|
|
|
|
|
|
"border-radius": "10px",
|
|
|
|
|
|
"margin-top": "10px",
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Show>
|
2026-03-19 03:36:46 +01:00
|
|
|
|
</section>
|
2026-04-06 06:19:14 +02:00
|
|
|
|
</div>
|
2026-03-19 03:36:46 +01:00
|
|
|
|
);
|
|
|
|
|
|
}
|