fix(admin): convert AdminShell to persistent layout, fix company API URL

Replace per-page AdminShell wrapping with a single SolidStart layout file
(src/routes/admin.tsx) so the shell mounts once and persists across all
/admin/* navigation — eliminating the sidebar bounce and session re-check
flash that occurred on every page transition.

- Create src/routes/admin.tsx as layout with <Outlet /> for child routes
- Remove <AdminShell> import/wrapper from all 66 route files and 2 shared
  components (RoleUserManagementTablePage, UserListPage)
- Fix company.tsx: wrong fetch URL /api/admin/companies → /api/gateway/api/admin/companies
- Add missing auth headers (Authorization Bearer) to company.tsx and users.tsx
- Fix admin/index.tsx API constant from hardcoded localhost:8000 → /api/gateway

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ashwin Kumar 2026-04-03 02:49:14 +02:00
parent 02df2baa4e
commit c526a376d5
70 changed files with 25 additions and 205 deletions

View file

@ -3,7 +3,7 @@
"configurations": [
{
"name": "admin-solid",
"runtimeExecutable": "npm",
"runtimeExecutable": "/Users/ashwin/.bun/bin/bun",
"runtimeArgs": ["run", "dev"],
"port": 3000
}

View file

@ -1,6 +1,5 @@
import { A } from '@solidjs/router';
import { createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -85,7 +84,6 @@ export default function RoleUserManagementTablePage(props: {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">{props.title}</h1>
@ -218,6 +216,5 @@ export default function RoleUserManagementTablePage(props: {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -4,7 +4,6 @@
*/
import { createMemo, createResource, createSignal, For, Show, type JSX } from 'solid-js';
import { Search, MoreVertical, Users, UserCheck, UserX, Clock } from 'lucide-solid';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -95,7 +94,6 @@ export default function UserListPage(props: { config: UserListPageConfig }) {
const { Icon } = props.config;
return (
<AdminShell>
<div class="w-full space-y-8 pb-8">
{/* Page header */}
@ -276,6 +274,5 @@ export default function UserListPage(props: { config: UserListPageConfig }) {
</Show>
</div>
</AdminShell>
);
}

10
src/routes/admin.tsx Normal file
View file

@ -0,0 +1,10 @@
import { Outlet } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
export default function AdminLayout() {
return (
<AdminShell>
<Outlet />
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createMemo } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import ApprovalManagementPage from './approval';
import VerificationManagementPage from './verification';
import UsersManagementPage from './users';
@ -56,7 +55,6 @@ export default function LegacyModuleShellPage() {
const legacyUrl = createMemo(() => `${LEGACY_ADMIN_ORIGIN}${legacyPath()}`);
return (
<AdminShell>
<h1 class="text-2xl font-bold text-gray-900">{moduleName()}</h1>
<p class="mt-1 text-sm text-gray-500">
Live legacy module embedded for exact design and functionality parity during migration.
@ -71,6 +69,5 @@ export default function LegacyModuleShellPage() {
style={{ width: '100%', height: '72vh', border: '1px solid #e2e8f0', 'border-radius': '10px', 'margin-top': '10px' }}
/>
</section>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -82,7 +81,6 @@ export default function ApplicationsPage() {
}
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
{/* ── Page header ── */}
@ -179,6 +177,5 @@ export default function ApplicationsPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -507,7 +506,6 @@ export default function ApprovalManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom: 1.5rem">
@ -836,6 +834,5 @@ export default function ApprovalManagementPage() {
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams, useSearchParams } from '@solidjs/router';
import { createMemo, createResource, createSignal, For, Show, createEffect } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -246,7 +245,6 @@ export default function ApprovalDetailPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -393,7 +391,6 @@ export default function ApprovalDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -106,7 +105,6 @@ export default function CandidateManagementPage() {
const openDetail = (row: CandidateRecord) => { setSelectedCandidate(row); setListTab('view'); setOpenMenuId(null); };
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom: 1.5rem">
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">Candidate Management</h1>
@ -292,6 +290,5 @@ export default function CandidateManagementPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
type AdminContact = {
name: string;
@ -32,7 +31,11 @@ export default function CompanyManagementPage() {
const load = async () => {
try {
const r = await fetch('/api/admin/companies');
const accessToken = typeof sessionStorage !== 'undefined' ? sessionStorage.getItem('nxtgauge_admin_access_token') || '' : '';
const r = await fetch('/api/gateway/api/admin/companies', {
headers: { Accept: 'application/json', ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}) },
credentials: 'include',
});
if (!r.ok) throw new Error('Failed to fetch companies');
const data = await r.json();
const mapped: CompanyRecord[] = data.map((c: any) => ({
@ -76,7 +79,6 @@ export default function CompanyManagementPage() {
});
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div class="flex items-center justify-between">
<div>
@ -135,6 +137,5 @@ export default function CompanyManagementPage() {
</table>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createMemo, createResource, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -95,7 +94,6 @@ export default function CompanyDetailPage() {
const isVerified = createMemo(() => Boolean(company()?.is_verified ?? company()?.isVerified));
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -298,6 +296,5 @@ export default function CompanyDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate } from '@solidjs/router';
import { createSignal, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -54,7 +53,6 @@ export default function CreateCompanyPage() {
const labelCls = 'mb-1.5 block text-sm font-medium text-gray-700';
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
{/* ── Page header ── */}
@ -118,6 +116,5 @@ export default function CreateCompanyPage() {
</form>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, createSignal, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -141,7 +140,6 @@ export default function CouponPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Coupon Management</h1>
@ -332,6 +330,5 @@ export default function CouponPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createSignal, createResource, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -135,7 +134,6 @@ export default function CreditPage() {
];
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Credit Management</h1>
@ -403,6 +401,5 @@ export default function CreditPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -105,7 +104,6 @@ export default function CustomerManagementPage() {
const openDetail = (row: CustomerRecord) => { setSelectedCustomer(row); setListTab('view'); setOpenMenuId(null); };
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom: 1.5rem">
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">Customer Management</h1>
@ -291,6 +289,5 @@ export default function CustomerManagementPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import { useSearchParams } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -258,7 +257,6 @@ export default function DepartmentManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
{/* Page header */}
@ -752,6 +750,5 @@ export default function DepartmentManagementPage() {
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import { useSearchParams } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -355,7 +354,6 @@ export default function DesignationManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
{/* Page header */}
@ -841,6 +839,5 @@ export default function DesignationManagementPage() {
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, createSignal, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -145,7 +144,6 @@ export default function DiscountPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Discount Management</h1>
@ -336,6 +334,5 @@ export default function DiscountPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate, useParams } from '@solidjs/router';
import { createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -109,7 +108,6 @@ export default function EditEmployeePage() {
const labelCls = 'mb-1.5 block text-sm font-medium text-gray-700';
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
{/* ── Page header ── */}
@ -173,6 +171,5 @@ export default function EditEmployeePage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate } from '@solidjs/router';
import { createResource, createSignal, For, onMount, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -189,7 +188,6 @@ export default function CreateEmployeePage() {
};
return (
<AdminShell>
<div class="w-full space-y-8 pb-8">
{/* Page header */}
@ -377,6 +375,5 @@ export default function CreateEmployeePage() {
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import { useSearchParams } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -447,7 +446,6 @@ export default function EmployeeManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
{/* Page header */}
@ -819,6 +817,5 @@ export default function EmployeeManagementPage() {
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createEffect, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import DashboardDesignPreview from '~/components/admin/DashboardDesignPreview';
const API = '/api/gateway';
@ -503,7 +502,6 @@ export default function ExternalDashboardManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div>
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">External Dashboard Management</h1>
@ -815,6 +813,5 @@ export default function ExternalDashboardManagementPage() {
</div>
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { For, Show, createMemo, createSignal, onMount, createEffect } from 'solid-js';
import { useSearchParams } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -447,7 +446,6 @@ export default function ExternalRoleManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom: 1.5rem">
@ -1034,6 +1032,5 @@ export default function ExternalRoleManagementPage() {
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,9 +1,8 @@
import { onMount } from 'solid-js';
import { useNavigate } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
export default function AdjustCreditAliasPage() {
const navigate = useNavigate();
onMount(() => navigate('/admin/credit', { replace: true }));
return <AdminShell><div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Redirecting to credit management...</p></div></AdminShell>;
return <div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Redirecting to credit management...</p></div>;
}

View file

@ -1,9 +1,8 @@
import { onMount } from 'solid-js';
import { useNavigate } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
export default function ReconcileAliasPage() {
const navigate = useNavigate();
onMount(() => navigate('/admin/ledger', { replace: true }));
return <AdminShell><div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Redirecting to ledger management...</p></div></AdminShell>;
return <div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Redirecting to ledger management...</p></div>;
}

View file

@ -1,10 +1,8 @@
import { A, useParams } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
export default function HelpArticlePage() {
const params = useParams();
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -20,6 +18,5 @@ export default function HelpArticlePage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,9 +1,7 @@
import { A } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
export default function HelpSupportBridgePage() {
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Support Bridge</h1>
@ -16,6 +14,5 @@ export default function HelpSupportBridgePage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -16,7 +16,6 @@ import {
TrendingUp,
Users,
} from 'lucide-solid';
import AdminShell from '~/components/AdminShell';
import {
ADMIN_DASHBOARD_WIDGETS,
type DashboardWidgetDefinition,
@ -25,7 +24,7 @@ import {
import type { RuntimeDashboardLayout } from '~/lib/runtime/types';
import { loadAdminDashboardLayout, saveAdminDashboardLayout } from '~/lib/runtime/storage';
const API = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8000';
const API = '/api/gateway';
async function fetchMetrics() {
const accessToken = typeof sessionStorage !== 'undefined'
@ -361,7 +360,6 @@ export default function AdminHomePage() {
};
return (
<AdminShell>
<div class="w-full">
<Show when={Boolean(searchParams.denied)}>
<div class="rounded-2xl border border-[#E5E7EB] bg-white shadow-sm" style="margin-bottom: 18px">
@ -581,6 +579,5 @@ export default function AdminHomePage() {
</For>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createEffect, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import DashboardDesignPreview from '~/components/admin/DashboardDesignPreview';
const API = '/api/gateway';
@ -240,7 +239,6 @@ export default function InternalDashboardManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div>
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">Internal Dashboard Management</h1>
@ -431,6 +429,5 @@ export default function InternalDashboardManagementPage() {
</div>
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, createSignal, createMemo, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -31,7 +30,6 @@ export default function InvoicePage() {
});
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Invoice Management</h1>
@ -116,6 +114,5 @@ export default function InvoicePage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -124,7 +123,6 @@ export default function JobsManagementPage() {
const openDetail = (row: JobRecord) => { setSelectedJob(row); setView('detail'); setOpenMenuId(null); };
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom: 1.5rem">
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">Jobs Management</h1>
@ -268,6 +266,5 @@ export default function JobsManagementPage() {
</div>
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createMemo, createResource, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -50,7 +49,6 @@ export default function JobDetailPage() {
const duration = createMemo(() => job()?.durationDays ?? job()?.duration_days);
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -117,6 +115,5 @@ export default function JobDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { createResource, createSignal, createMemo, Show, For } from 'solid-js';
import { A } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -214,7 +213,6 @@ export default function KbPage(props: KbPageProps = {}) {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Knowledge Base</h1>
@ -547,6 +545,5 @@ export default function KbPage(props: KbPageProps = {}) {
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createResource, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -32,7 +31,6 @@ export default function KbArticleDetailPage() {
const [article] = createResource(() => params.id, loadArticle);
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -76,6 +74,5 @@ export default function KbArticleDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate, useParams } from '@solidjs/router';
import { createEffect, createResource, createSignal, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -77,7 +76,6 @@ export default function KbArticleEditPage() {
const labelCls = 'mb-1.5 block text-sm font-medium text-gray-700';
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -139,6 +137,5 @@ export default function KbArticleEditPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A } from '@solidjs/router';
import { createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -80,7 +79,6 @@ export default function LeadsPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Leads Management</h1>
@ -214,6 +212,5 @@ export default function LeadsPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createMemo, createResource, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -72,7 +71,6 @@ export default function LeadDetailPage() {
const updatedAt = createMemo(() => lead()?.updatedAt || lead()?.updated_at || '');
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -165,6 +163,5 @@ export default function LeadDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -55,7 +54,6 @@ export default function LedgerPage() {
const [entries] = createResource(loadLedger);
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Ledger Management</h1>
@ -115,6 +113,5 @@ export default function LedgerPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -106,7 +105,6 @@ export default function ModulesPage() {
}
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
{/* ── Page header ── */}
@ -257,6 +255,5 @@ export default function ModulesPage() {
</div>
</div>
</Show>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createSignal, createMemo, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -82,7 +81,6 @@ export default function NotificationsPage() {
str && str.length > max ? str.substring(0, max) + '…' : (str || '');
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -190,6 +188,5 @@ export default function NotificationsPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createEffect, createResource, createSignal, onMount, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import OnboardingManagementTabs from '~/components/admin/OnboardingManagementTabs';
import OnboardingFlowBuilder, {
buildStepsFromFields,
@ -198,7 +197,6 @@ export default function OnboardingSchemaDetailPage() {
});
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -252,6 +250,5 @@ export default function OnboardingSchemaDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Match, Show, Switch, createEffect, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
type VerificationType = 'IDENTITY' | 'BUSINESS' | 'MIXED' | 'NONE';
@ -668,7 +667,6 @@ export default function OnboardingManagementPage() {
);
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom: 1.5rem">
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">External Onboarding Management</h1>
@ -1481,6 +1479,5 @@ export default function OnboardingManagementPage() {
</Match>
</Switch>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate } from '@solidjs/router';
import { createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import OnboardingManagementTabs from '~/components/admin/OnboardingManagementTabs';
import OnboardingFlowBuilder, {
buildStepsFromFields,
@ -132,7 +131,6 @@ export default function NewOnboardingSchemaPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -168,6 +166,5 @@ export default function NewOnboardingSchemaPage() {
/>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, createSignal, createMemo, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -69,7 +68,6 @@ export default function OrderPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Order Management</h1>
@ -142,6 +140,5 @@ export default function OrderPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { For, createMemo, createResource, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -49,7 +48,6 @@ export default function PhotographerDetailPage() {
const created = createMemo(() => profile()?.createdAt || profile()?.created_at || '');
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -139,6 +137,5 @@ export default function PhotographerDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, createSignal, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -149,7 +148,6 @@ export default function PricingPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Pricing Management</h1>
@ -358,6 +356,5 @@ export default function PricingPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,10 +1,9 @@
import { onMount } from 'solid-js';
import { useNavigate, useParams } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
export default function ProfileAliasPage() {
const navigate = useNavigate();
const params = useParams();
onMount(() => navigate(`/admin/users/details/${params.id}`, { replace: true }));
return <AdminShell><div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Redirecting to user profile detail...</p></div></AdminShell>;
return <div class="rounded-xl border border-gray-200 bg-white shadow-sm"><p class="notice">Redirecting to user profile detail...</p></div>;
}

View file

@ -1,5 +1,4 @@
import { createSignal, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -45,7 +44,6 @@ export default function ReportPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Report Management</h1>
@ -117,6 +115,5 @@ export default function ReportPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createMemo, createResource, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -39,7 +38,6 @@ export default function RequirementDetailPage() {
const updatedAt = createMemo(() => requirement()?.updated_at || '');
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -119,7 +117,6 @@ export default function RequirementDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -82,7 +81,6 @@ export default function ResponsesPage() {
}
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
{/* ── Page header ── */}
@ -164,6 +162,5 @@ export default function ResponsesPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, createSignal, createMemo, Show, For } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -119,7 +118,6 @@ export default function ReviewPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Review Management</h1>
@ -319,6 +317,5 @@ export default function ReviewPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { useNavigate, useParams } from '@solidjs/router';
import { onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
export default function EditRoleUiConfigRedirectPage() {
const navigate = useNavigate();
@ -12,10 +11,8 @@ export default function EditRoleUiConfigRedirectPage() {
});
return (
<AdminShell>
<section class="rounded-xl border border-gray-200 bg-white shadow-sm">
<p class="notice">Redirecting to External Dashboard Management...</p>
</section>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate, useSearchParams } from '@solidjs/router';
import { createMemo, createResource, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import ExternalRoleTabs from '~/components/admin/ExternalRoleTabs';
const API = '/api/gateway';
@ -78,7 +77,6 @@ export default function RoleUiConfigsViewPage() {
});
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">External Dashboard Management</h1>
@ -229,6 +227,5 @@ export default function RoleUiConfigsViewPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { useNavigate } from '@solidjs/router';
import { onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
export default function CreateRoleUiConfigRedirectPage() {
const navigate = useNavigate();
@ -10,10 +9,8 @@ export default function CreateRoleUiConfigRedirectPage() {
});
return (
<AdminShell>
<section class="rounded-xl border border-gray-200 bg-white shadow-sm">
<p class="notice">Redirecting to External Dashboard Management...</p>
</section>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate, useParams } from '@solidjs/router';
import { createEffect, createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -214,7 +213,6 @@ export default function EditInternalRolePage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
{/* Page title */}
@ -471,7 +469,6 @@ export default function EditInternalRolePage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams } from '@solidjs/router';
import { createMemo, createResource, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -58,7 +57,6 @@ export default function RoleDetailPage() {
const isSuperAdmin = createMemo(() => (role()?.key || '').toUpperCase() === 'SUPER_ADMIN');
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
{/* Page title */}
@ -218,7 +216,6 @@ export default function RoleDetailPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate } from '@solidjs/router';
import { createEffect, createMemo, createResource, createSignal, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -189,7 +188,6 @@ export default function CreateInternalRolePage() {
};
return (
<AdminShell>
<div class="w-full space-y-8 pb-8">
{/* Page header */}
@ -451,7 +449,6 @@ export default function CreateInternalRolePage() {
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createEffect, createMemo, createResource, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import type { CrudRecord } from '~/lib/admin/types';
const API = '/api/gateway';
@ -429,7 +428,6 @@ export default function RoleManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom: 1.5rem">
@ -881,6 +879,5 @@ export default function RoleManagementPage() {
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A } from '@solidjs/router';
import { createMemo, createResource, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -35,7 +34,6 @@ export default function RoleTemplatesPage() {
const count = createMemo(() => (templates() || []).length);
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<div class="flex items-center justify-between">
@ -93,6 +91,5 @@ export default function RoleTemplatesPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate, useParams } from '@solidjs/router';
import { createMemo, createResource, createSignal, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import ExternalRoleForm, { type ExternalRoleConfig } from '~/components/admin/ExternalRoleForm';
import ExternalRoleTabs from '~/components/admin/ExternalRoleTabs';
@ -151,7 +150,6 @@ export default function EditExternalRolePage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -197,6 +195,5 @@ export default function EditExternalRolePage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,7 +1,6 @@
import { A } from '@solidjs/router';
import { createResource, createSignal, For, Show } from 'solid-js';
import { Globe, ShieldCheck, ShieldOff, Layers, MoreVertical, Search, Plus } from 'lucide-solid';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -86,7 +85,6 @@ export default function ExternalRolesPage() {
};
return (
<AdminShell>
<div class="w-full space-y-8 pb-8">
{/* Page header */}
@ -253,6 +251,5 @@ export default function ExternalRolesPage() {
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate } from '@solidjs/router';
import { createResource, createSignal, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
import ExternalRoleForm, { type ExternalRoleConfig } from '~/components/admin/ExternalRoleForm';
import ExternalRoleTabs from '~/components/admin/ExternalRoleTabs';
@ -83,7 +82,6 @@ export default function CreateExternalRolePage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Create External Role</h1>
@ -108,6 +106,5 @@ export default function CreateExternalRolePage() {
/>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { createResource, createSignal, createMemo, Show, For } from 'solid-js';
import { A } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -157,7 +156,6 @@ export default function SupportPage() {
];
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4">
<h1 class="text-xl font-semibold text-gray-900">Support Management</h1>
@ -371,6 +369,5 @@ export default function SupportPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { createResource, createSignal, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -63,7 +62,6 @@ export default function TaxPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -178,6 +176,5 @@ export default function TaxPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,5 +1,4 @@
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
type RegisteredRole = {
key: string;
@ -66,7 +65,11 @@ export default function UsersManagementPage() {
const load = async () => {
try {
const r = await fetch('/api/gateway/api/admin/users');
const accessToken = typeof sessionStorage !== 'undefined' ? sessionStorage.getItem('nxtgauge_admin_access_token') || '' : '';
const r = await fetch('/api/gateway/api/admin/users', {
headers: { Accept: 'application/json', ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}) },
credentials: 'include',
});
if (!r.ok) throw new Error('Failed to fetch users');
const data = await r.json();
@ -199,7 +202,6 @@ export default function UsersManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom:1.5rem">
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">Users Management</h1>
@ -555,6 +557,5 @@ export default function UsersManagementPage() {
</div>
</Show>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useNavigate, useParams } from '@solidjs/router';
import { createMemo, createResource, createSignal, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -113,7 +112,6 @@ export default function EditUserPage() {
};
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -181,6 +179,5 @@ export default function EditUserPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useParams, useSearchParams } from '@solidjs/router';
import { createMemo, createResource, For, Show } from 'solid-js';
import AdminShell from '~/components/AdminShell';
const API = '/api/gateway';
@ -160,7 +159,6 @@ export default function UserDetailPage() {
});
return (
<AdminShell>
<div class="flex flex-col -mx-6 -mt-6 min-h-full">
<div class="bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between">
<div>
@ -270,6 +268,5 @@ export default function UserDetailPage() {
</Show>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A } from '@solidjs/router';
import { For, Show, createMemo, createSignal, onMount } from 'solid-js';
import AdminShell from '~/components/AdminShell';
type VerificationStatus = 'PENDING' | 'UNDER_REVIEW' | 'DOCUMENTS_REQUESTED' | 'REVISION_REQUESTED' | 'APPROVED' | 'REJECTED';
type VerificationPriority = 'HIGH' | 'MEDIUM' | 'LOW';
@ -668,7 +667,6 @@ export default function VerificationManagementPage() {
};
return (
<AdminShell>
<div class="w-full space-y-6 pb-8">
<div style="margin-bottom:1.5rem">
<h1 class="text-[28px] font-bold leading-tight text-[#111827]">Verification Management</h1>
@ -1087,6 +1085,5 @@ export default function VerificationManagementPage() {
</div>
</div>
</Show>
</AdminShell>
);
}

View file

@ -1,6 +1,5 @@
import { A, useSearchParams, useParams } from '@solidjs/router';
import { For, Show, createMemo, createSignal } from 'solid-js';
import AdminShell from '~/components/AdminShell';
type Status = 'UNDER_REVIEW' | 'DOCUMENTS_REQUESTED' | 'REVISION_REQUESTED' | 'APPROVED' | 'REJECTED';
@ -139,7 +138,6 @@ export default function VerificationReviewDetailPage() {
const roleLabel = createMemo(() => String(searchParams.type || 'Portfolio Approval'));
return (
<AdminShell>
<div class="w-full pb-8">
<A href="/admin/verification" style="display:inline-flex;align-items:center;gap:8px;margin-bottom:8px;color:#475569;font-size:13px;text-decoration:none">
Back to Verification Management
@ -410,6 +408,5 @@ export default function VerificationReviewDetailPage() {
</div>
</div>
</div>
</AdminShell>
);
}

View file

@ -1,16 +1,13 @@
import { onMount } from 'solid-js';
import { useNavigate, useParams } from '@solidjs/router';
import AdminShell from '~/components/AdminShell';
export default function WorkspaceMenuAliasPage() {
const navigate = useNavigate();
const params = useParams();
onMount(() => navigate('/admin', { replace: true }));
return (
<AdminShell>
<div class="rounded-xl border border-gray-200 bg-white shadow-sm">
<p class="notice">Redirecting workspace menu <strong>{params.menuId}</strong> to dashboard...</p>
</div>
</AdminShell>
);
}