2026-04-26 23:58:42 +02:00
|
|
|
import { A, useLocation, useNavigate, useSearchParams } from "@solidjs/router";
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
import {
|
2026-04-26 23:58:42 +02:00
|
|
|
For,
|
|
|
|
|
Show,
|
|
|
|
|
createEffect,
|
|
|
|
|
createMemo,
|
|
|
|
|
createSignal,
|
|
|
|
|
onCleanup,
|
|
|
|
|
onMount,
|
|
|
|
|
type JSX,
|
|
|
|
|
} from "solid-js";
|
|
|
|
|
import { Bell, Moon, Search, Settings, Sun, User } from "lucide-solid";
|
|
|
|
|
import AdminSidebar from "./AdminSidebar";
|
|
|
|
|
import { isExternalIdentity } from "~/lib/admin-auth";
|
|
|
|
|
import { clearAdminSession, hasAdminSession, setAdminSession } from "~/lib/admin-session";
|
|
|
|
|
import { normalizeAllowedModules } from "~/lib/admin/module-access";
|
2026-07-19 00:03:57 +05:30
|
|
|
import { sessionExpired, clearSessionExpired, installSessionExpiryWatcher } from "~/lib/session-expired";
|
2026-07-19 00:14:39 +05:30
|
|
|
import { installSessionRefreshLoop } from "~/lib/session-refresh";
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
|
|
|
|
|
type Tab = { href: string; label: string; exact?: boolean };
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
type SearchResult = { id: string; title: string; subtitle: string; href: string };
|
2026-03-25 22:15:06 +01:00
|
|
|
type SearchGroup = { label: string; viewAllHref: string; results: SearchResult[] };
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
const PAGE_TITLES: Array<{ prefix: string; label: string; exact?: boolean }> = [
|
2026-04-26 23:58:42 +02:00
|
|
|
{ prefix: "/admin", label: "Dashboard", exact: true },
|
|
|
|
|
{ prefix: "/admin/department", label: "Department Management" },
|
|
|
|
|
{ prefix: "/admin/designation", label: "Designation Management" },
|
|
|
|
|
{ prefix: "/admin/roles", label: "Internal Role Management" },
|
|
|
|
|
{ prefix: "/admin/employees", label: "Employee Management" },
|
|
|
|
|
{ prefix: "/admin/external-roles", label: "External Role Management" },
|
|
|
|
|
{ prefix: "/admin/internal-dashboard-management", label: "Internal Dashboard Management" },
|
|
|
|
|
{ prefix: "/admin/external-dashboard-management", label: "External Dashboard Management" },
|
|
|
|
|
{ prefix: "/admin/role-ui-configs", label: "External Dashboard Management" },
|
|
|
|
|
{ prefix: "/admin/verification", label: "Verification Management" },
|
|
|
|
|
{ prefix: "/admin/verification-status", label: "Verification Management" },
|
|
|
|
|
{ prefix: "/admin/approval", label: "Approval Management" },
|
|
|
|
|
{ prefix: "/admin/approvals", label: "Approval Management" },
|
|
|
|
|
{ prefix: "/admin/approval-management", label: "Approval Management" },
|
|
|
|
|
{ prefix: "/admin/users", label: "Users Management" },
|
|
|
|
|
{ prefix: "/admin/company", label: "Company Management" },
|
|
|
|
|
{ prefix: "/admin/candidate", label: "Candidate Management" },
|
|
|
|
|
{ prefix: "/admin/customer", label: "Customer Management" },
|
|
|
|
|
{ prefix: "/admin/photographer", label: "Photographer Management" },
|
|
|
|
|
{ prefix: "/admin/makeup-artist", label: "Makeup Artist Management" },
|
|
|
|
|
{ prefix: "/admin/tutors", label: "Tutors Management" },
|
|
|
|
|
{ prefix: "/admin/developers", label: "Developers Management" },
|
|
|
|
|
{ prefix: "/admin/video-editors", label: "Video Editor Management" },
|
|
|
|
|
{ prefix: "/admin/fitness-trainers", label: "Fitness Trainer Management" },
|
|
|
|
|
{ prefix: "/admin/catering-services", label: "Catering Services Management" },
|
|
|
|
|
{ prefix: "/admin/ugc-content-creators", label: "UGC Content Creator Management" },
|
|
|
|
|
{ prefix: "/admin/graphic-designers", label: "Graphic Designer Management" },
|
|
|
|
|
{ prefix: "/admin/social-media-managers", label: "Social Media Manager Management" },
|
|
|
|
|
{ prefix: "/admin/jobs", label: "Jobs Management" },
|
|
|
|
|
{ prefix: "/admin/leads", label: "Leads Management" },
|
|
|
|
|
{ prefix: "/admin/applications", label: "Applications Management" },
|
|
|
|
|
{ prefix: "/admin/responses", label: "Responses Management" },
|
|
|
|
|
{ prefix: "/admin/pricing", label: "Pricing Management" },
|
|
|
|
|
{ prefix: "/admin/credit", label: "Credit Management" },
|
|
|
|
|
{ prefix: "/admin/coupon", label: "Coupon Management" },
|
|
|
|
|
{ prefix: "/admin/discount", label: "Discount Management" },
|
|
|
|
|
{ prefix: "/admin/tax", label: "Tax Management" },
|
|
|
|
|
{ prefix: "/admin/order", label: "Order Management" },
|
|
|
|
|
{ prefix: "/admin/invoice", label: "Invoice Management" },
|
|
|
|
|
{ prefix: "/admin/payment-gateway", label: "Payment Gateway Management" },
|
|
|
|
|
{ prefix: "/admin/smtp", label: "SMTP Management" },
|
|
|
|
|
{ prefix: "/admin/kb", label: "Knowledge Base Management" },
|
|
|
|
|
{ prefix: "/admin/notifications", label: "Notifications" },
|
|
|
|
|
{ prefix: "/admin/review", label: "Review Management" },
|
|
|
|
|
{ prefix: "/admin/support", label: "Support Management" },
|
|
|
|
|
{ prefix: "/admin/report", label: "Report Management" },
|
|
|
|
|
{ prefix: "/admin/ledger", label: "Ledger Management" },
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
];
|
|
|
|
|
|
2026-03-27 05:35:18 +01:00
|
|
|
const TAB_SETS: Array<{ prefixes: string[]; tabs: Tab[] }> = [];
|
2026-03-27 21:25:00 +01:00
|
|
|
const ROUTE_MODULE_KEYS: Array<{ prefix: string; keys: string[] }> = [
|
2026-04-26 23:58:42 +02:00
|
|
|
{ prefix: "/admin", keys: ["ADMIN_DASHBOARD", "DASHBOARD"] },
|
|
|
|
|
{ prefix: "/admin/department", keys: ["DEPARTMENT_MANAGEMENT", "DEPARTMENTS"] },
|
|
|
|
|
{ prefix: "/admin/department-management", keys: ["DEPARTMENT_MANAGEMENT", "DEPARTMENTS"] },
|
|
|
|
|
{ prefix: "/admin/designation", keys: ["DESIGNATION_MANAGEMENT", "DESIGNATIONS"] },
|
|
|
|
|
{ prefix: "/admin/designation-management", keys: ["DESIGNATION_MANAGEMENT", "DESIGNATIONS"] },
|
|
|
|
|
{ prefix: "/admin/roles", keys: ["INTERNAL_ROLE_MANAGEMENT", "ROLES"] },
|
|
|
|
|
{ prefix: "/admin/employees", keys: ["EMPLOYEE_MANAGEMENT", "EMPLOYEES"] },
|
|
|
|
|
{ prefix: "/admin/external-roles", keys: ["EXTERNAL_ROLE_MANAGEMENT", "EXTERNAL_ROLES"] },
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/internal-dashboard-management",
|
|
|
|
|
keys: ["INTERNAL_DASHBOARD_MANAGEMENT", "INTERNAL_DASHBOARDS", "INTERNAL_DASHBOARD_CONFIG"],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/external-dashboard-management",
|
|
|
|
|
keys: [
|
|
|
|
|
"DASHBOARD_CONFIG_MANAGEMENT",
|
|
|
|
|
"EXTERNAL_DASHBOARD_MANAGEMENT",
|
|
|
|
|
"EXTERNAL_DASHBOARDS",
|
|
|
|
|
"EXTERNAL_DASHBOARD_CONFIG",
|
|
|
|
|
"RUNTIME_ROLES",
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/role-ui-configs",
|
|
|
|
|
keys: [
|
|
|
|
|
"DASHBOARD_CONFIG_MANAGEMENT",
|
|
|
|
|
"EXTERNAL_DASHBOARD_MANAGEMENT",
|
|
|
|
|
"EXTERNAL_DASHBOARDS",
|
|
|
|
|
"EXTERNAL_DASHBOARD_CONFIG",
|
|
|
|
|
"RUNTIME_ROLES",
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{ prefix: "/admin/verification", keys: ["VERIFICATION_MANAGEMENT", "VERIFICATIONS"] },
|
|
|
|
|
{ prefix: "/admin/verification-status", keys: ["VERIFICATION_MANAGEMENT", "VERIFICATIONS"] },
|
|
|
|
|
{ prefix: "/admin/approval", keys: ["APPROVAL_MANAGEMENT", "APPROVALS"] },
|
|
|
|
|
{ prefix: "/admin/approvals", keys: ["APPROVAL_MANAGEMENT", "APPROVALS"] },
|
|
|
|
|
{ prefix: "/admin/approval-management", keys: ["APPROVAL_MANAGEMENT", "APPROVALS"] },
|
|
|
|
|
{ prefix: "/admin/users", keys: ["USER_MANAGEMENT", "USERS"] },
|
|
|
|
|
{ prefix: "/admin/company", keys: ["COMPANY_MANAGEMENT", "COMPANIES"] },
|
|
|
|
|
{ prefix: "/admin/candidate", keys: ["CANDIDATE_MANAGEMENT", "CANDIDATES"] },
|
|
|
|
|
{ prefix: "/admin/customer", keys: ["CUSTOMER_MANAGEMENT", "CUSTOMERS"] },
|
|
|
|
|
{ prefix: "/admin/photographer", keys: ["PHOTOGRAPHER_MANAGEMENT", "PHOTOGRAPHERS"] },
|
|
|
|
|
{ prefix: "/admin/makeup-artist", keys: ["MAKEUP_ARTIST_MANAGEMENT", "MAKEUP_ARTISTS"] },
|
|
|
|
|
{ prefix: "/admin/tutors", keys: ["TUTOR_MANAGEMENT", "TUTORS"] },
|
|
|
|
|
{ prefix: "/admin/developers", keys: ["DEVELOPER_MANAGEMENT", "DEVELOPERS"] },
|
|
|
|
|
{ prefix: "/admin/video-editors", keys: ["VIDEO_EDITOR_MANAGEMENT", "VIDEO_EDITORS"] },
|
|
|
|
|
{ prefix: "/admin/fitness-trainers", keys: ["FITNESS_TRAINER_MANAGEMENT", "FITNESS_TRAINERS"] },
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/catering-services",
|
|
|
|
|
keys: ["CATERING_SERVICES_MANAGEMENT", "CATERING_SERVICES"],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/ugc-content-creator",
|
|
|
|
|
keys: ["UGC_CONTENT_CREATOR_MANAGEMENT", "UGC_CONTENT_CREATOR"],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/graphic-designers",
|
|
|
|
|
keys: ["GRAPHIC_DESIGNER_MANAGEMENT", "GRAPHIC_DESIGNERS"],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/social-media-managers",
|
|
|
|
|
keys: ["SOCIAL_MEDIA_MANAGEMENT", "SOCIAL_MEDIA_MANAGER_MANAGEMENT", "SOCIAL_MEDIA_MANAGERS"],
|
|
|
|
|
},
|
|
|
|
|
{ prefix: "/admin/jobs", keys: ["JOBS_MANAGEMENT", "JOBS"] },
|
|
|
|
|
{
|
|
|
|
|
prefix: "/admin/leads",
|
|
|
|
|
keys: ["LEADS_MANAGEMENT", "LEADS", "REQUIREMENTS_MANAGEMENT", "REQUIREMENTS"],
|
|
|
|
|
},
|
|
|
|
|
{ prefix: "/admin/applications", keys: ["APPLICATIONS_MANAGEMENT", "APPLICATIONS"] },
|
|
|
|
|
{ prefix: "/admin/responses", keys: ["RESPONSES_MANAGEMENT", "RESPONSES"] },
|
|
|
|
|
{ prefix: "/admin/pricing", keys: ["PRICING_MANAGEMENT", "PRICING"] },
|
|
|
|
|
{ prefix: "/admin/credit", keys: ["CREDIT_MANAGEMENT", "CREDITS"] },
|
|
|
|
|
{ prefix: "/admin/coupon", keys: ["COUPON_MANAGEMENT", "COUPONS"] },
|
|
|
|
|
{ prefix: "/admin/discount", keys: ["DISCOUNT_MANAGEMENT", "DISCOUNTS"] },
|
|
|
|
|
{ prefix: "/admin/tax", keys: ["TAX_MANAGEMENT", "TAXES"] },
|
|
|
|
|
{ prefix: "/admin/order", keys: ["ORDER_MANAGEMENT", "ORDERS"] },
|
|
|
|
|
{ prefix: "/admin/invoice", keys: ["INVOICE_MANAGEMENT", "INVOICES"] },
|
|
|
|
|
{ prefix: "/admin/payment-gateway", keys: ["PAYMENT_GATEWAY_MANAGEMENT", "PAYMENT_GATEWAY"] },
|
|
|
|
|
{ prefix: "/admin/smtp", keys: ["SMTP_MANAGEMENT", "SMTP"] },
|
|
|
|
|
{ prefix: "/admin/kb", keys: ["KNOWLEDGE_BASE_MANAGEMENT", "KNOWLEDGE_BASE", "KB"] },
|
|
|
|
|
{ prefix: "/admin/notifications", keys: ["NOTIFICATIONS_MANAGEMENT", "NOTIFICATIONS"] },
|
|
|
|
|
{ prefix: "/admin/review", keys: ["REVIEW_MANAGEMENT", "REVIEWS"] },
|
|
|
|
|
{ prefix: "/admin/support", keys: ["SUPPORT_MANAGEMENT", "SUPPORT"] },
|
|
|
|
|
{ prefix: "/admin/report", keys: ["REPORT_MANAGEMENT", "REPORTS"] },
|
|
|
|
|
{ prefix: "/admin/ledger", keys: ["LEDGER", "LEDGER_MANAGEMENT"] },
|
2026-03-27 21:25:00 +01:00
|
|
|
];
|
2026-03-16 23:20:54 +01:00
|
|
|
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
const SEARCH_MODULES = [
|
|
|
|
|
{
|
2026-04-26 23:58:42 +02:00
|
|
|
label: "Users",
|
|
|
|
|
viewAllHref: "/admin/users",
|
|
|
|
|
api: "/api/admin/users",
|
|
|
|
|
listKeys: ["users", "items"],
|
|
|
|
|
titleKeys: ["full_name", "name"],
|
|
|
|
|
subtitleKeys: ["email", "phone"],
|
|
|
|
|
detailBase: "/admin/users",
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
},
|
|
|
|
|
{
|
2026-04-26 23:58:42 +02:00
|
|
|
label: "Companies",
|
|
|
|
|
viewAllHref: "/admin/company",
|
|
|
|
|
api: "/api/admin/companies",
|
|
|
|
|
listKeys: ["companies", "items"],
|
|
|
|
|
titleKeys: ["name", "companyName"],
|
|
|
|
|
subtitleKeys: ["email", "phone"],
|
|
|
|
|
detailBase: "/admin/company",
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
},
|
|
|
|
|
{
|
2026-04-26 23:58:42 +02:00
|
|
|
label: "Employees",
|
|
|
|
|
viewAllHref: "/admin/employees",
|
|
|
|
|
api: "/api/admin/employees",
|
|
|
|
|
listKeys: ["employees", "items"],
|
|
|
|
|
titleKeys: ["full_name", "name"],
|
|
|
|
|
subtitleKeys: ["email", "department_name"],
|
|
|
|
|
detailBase: "/admin/employees",
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
},
|
|
|
|
|
{
|
2026-04-26 23:58:42 +02:00
|
|
|
label: "Jobs",
|
|
|
|
|
viewAllHref: "/admin/jobs",
|
|
|
|
|
api: "/api/admin/jobs",
|
|
|
|
|
listKeys: ["jobs", "items"],
|
|
|
|
|
titleKeys: ["title", "name"],
|
|
|
|
|
subtitleKeys: ["status", "company_name"],
|
|
|
|
|
detailBase: "/admin/jobs",
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
},
|
|
|
|
|
{
|
2026-04-26 23:58:42 +02:00
|
|
|
label: "Leads",
|
|
|
|
|
viewAllHref: "/admin/leads",
|
|
|
|
|
api: "/api/admin/leads",
|
|
|
|
|
listKeys: ["leads", "items"],
|
|
|
|
|
titleKeys: ["name", "full_name"],
|
|
|
|
|
subtitleKeys: ["email", "status"],
|
|
|
|
|
detailBase: "/admin/leads",
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
function pickStr(obj: Record<string, any>, keys: string[]): string {
|
|
|
|
|
for (const k of keys) if (obj[k]) return String(obj[k]);
|
2026-04-26 23:58:42 +02:00
|
|
|
return "—";
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function extractList(data: any, keys: string[]): any[] {
|
|
|
|
|
if (Array.isArray(data)) return data;
|
|
|
|
|
for (const k of keys) if (Array.isArray(data[k])) return data[k];
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function GlobalSearch() {
|
2026-04-26 23:58:42 +02:00
|
|
|
const [query, setQuery] = createSignal("");
|
2026-03-25 22:15:06 +01:00
|
|
|
const [open, setOpen] = createSignal(false);
|
|
|
|
|
const [groups, setGroups] = createSignal<SearchGroup[]>([]);
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
const [searching, setSearching] = createSignal(false);
|
|
|
|
|
let wrapRef!: HTMLDivElement;
|
|
|
|
|
let timer: ReturnType<typeof setTimeout>;
|
|
|
|
|
|
|
|
|
|
const doSearch = async (q: string) => {
|
|
|
|
|
const trimmed = q.trim();
|
2026-04-26 23:58:42 +02:00
|
|
|
if (trimmed.length < 2) {
|
|
|
|
|
setGroups([]);
|
|
|
|
|
setOpen(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
setSearching(true);
|
|
|
|
|
const settled = await Promise.allSettled(
|
|
|
|
|
SEARCH_MODULES.map(async (mod) => {
|
2026-04-26 23:58:42 +02:00
|
|
|
const res = await fetch(`${mod.api}?search=${encodeURIComponent(trimmed)}&limit=4`).catch(
|
|
|
|
|
() => null
|
|
|
|
|
);
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
if (!res?.ok) return null;
|
|
|
|
|
const data = await res.json().catch(() => null);
|
|
|
|
|
if (!data) return null;
|
|
|
|
|
const items = extractList(data, mod.listKeys).slice(0, 4);
|
|
|
|
|
if (!items.length) return null;
|
|
|
|
|
return {
|
|
|
|
|
label: mod.label,
|
|
|
|
|
viewAllHref: mod.viewAllHref,
|
|
|
|
|
results: items.map((item: any) => ({
|
|
|
|
|
id: item.id,
|
|
|
|
|
title: pickStr(item, mod.titleKeys),
|
|
|
|
|
subtitle: pickStr(item, mod.subtitleKeys),
|
|
|
|
|
href: `${mod.detailBase}/${item.id}`,
|
|
|
|
|
})),
|
|
|
|
|
} satisfies SearchGroup;
|
2026-04-26 23:58:42 +02:00
|
|
|
})
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
);
|
2026-04-26 23:58:42 +02:00
|
|
|
setGroups(settled.flatMap((r) => (r.status === "fulfilled" && r.value ? [r.value] : [])));
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
setOpen(true);
|
|
|
|
|
setSearching(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleInput = (val: string) => {
|
|
|
|
|
setQuery(val);
|
|
|
|
|
clearTimeout(timer);
|
2026-04-26 23:58:42 +02:00
|
|
|
if (val.trim().length < 2) {
|
|
|
|
|
setGroups([]);
|
|
|
|
|
setOpen(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2026-03-25 22:15:06 +01:00
|
|
|
timer = setTimeout(() => doSearch(val), 350);
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
};
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
const close = () => {
|
|
|
|
|
setOpen(false);
|
|
|
|
|
setQuery("");
|
|
|
|
|
setGroups([]);
|
|
|
|
|
};
|
|
|
|
|
const onOutside = (e: MouseEvent) => {
|
|
|
|
|
if (!wrapRef.contains(e.target as Node)) setOpen(false);
|
|
|
|
|
};
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
onMount(() => document.addEventListener("mousedown", onOutside));
|
|
|
|
|
onCleanup(() => document.removeEventListener("mousedown", onOutside));
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
|
|
|
|
|
return (
|
2026-03-26 20:58:39 +01:00
|
|
|
<div ref={wrapRef!} class="relative ml-10 w-[560px] shrink-0">
|
2026-04-26 23:58:42 +02:00
|
|
|
<Search
|
|
|
|
|
size={20}
|
|
|
|
|
class="pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 text-[#9498ad]"
|
|
|
|
|
/>
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
value={query()}
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
placeholder="Search system resources..."
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
onInput={(e) => handleInput(e.currentTarget.value)}
|
|
|
|
|
onFocus={() => groups().length > 0 && setOpen(true)}
|
2026-04-26 23:58:42 +02:00
|
|
|
onKeyDown={(e) => e.key === "Escape" && close()}
|
2026-03-26 20:58:39 +01:00
|
|
|
class="h-[68px] w-full rounded-[24px] border-2 border-transparent bg-[#f4f5f8] pl-[60px] pr-6 text-[16px] text-[#0D0D2A] placeholder:text-[rgba(13,13,42,0.4)] outline-none transition-all focus:border-[#e5e7eb] focus:bg-white"
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Show when={open() && groups().length > 0}>
|
2026-03-25 22:15:06 +01:00
|
|
|
<div class="absolute left-0 right-0 top-[calc(100%+8px)] z-[300] max-h-[460px] overflow-y-auto rounded-2xl border border-[#e5e7eb] bg-white shadow-xl">
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
<For each={groups()}>
|
|
|
|
|
{(group) => (
|
2026-03-25 22:15:06 +01:00
|
|
|
<div class="border-b border-[#f1f2f5] px-4 py-3 last:border-b-0">
|
|
|
|
|
<div class="mb-2 flex items-center justify-between">
|
2026-04-26 23:58:42 +02:00
|
|
|
<span class="text-[10px] font-bold uppercase tracking-[0.12em] text-[#9aa0b9]">
|
|
|
|
|
{group.label}
|
|
|
|
|
</span>
|
|
|
|
|
<A
|
|
|
|
|
href={group.viewAllHref}
|
|
|
|
|
onClick={close}
|
|
|
|
|
class="text-[12px] font-semibold text-[#FF5E13]"
|
|
|
|
|
>
|
|
|
|
|
View all
|
|
|
|
|
</A>
|
2026-03-25 22:15:06 +01:00
|
|
|
</div>
|
|
|
|
|
<div class="space-y-1">
|
|
|
|
|
<For each={group.results}>
|
|
|
|
|
{(item) => (
|
2026-04-26 23:58:42 +02:00
|
|
|
<A
|
|
|
|
|
href={item.href}
|
|
|
|
|
onClick={close}
|
|
|
|
|
class="flex items-center gap-3 rounded-xl px-2 py-2 hover:bg-[#f9fafb]"
|
|
|
|
|
>
|
feat(admin): employee management redesign + routing fix
- Fix employees routing: employees.tsx → Outlet layout, actual pages in employees/index.tsx and employees/create.tsx
- Employee list: stat cards, search/filter toolbar, table with 3-dot action menu (Edit, Deactivate, Delete), fallback data
- Employee create: form with full_name, email, role_id, department_id, designation_id selectors; auto-credential note
- Stage all other modified routes for next phases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:07:55 +01:00
|
|
|
<div class="flex h-8 w-8 items-center justify-center rounded-full bg-[rgba(255,94,19,0.12)] text-[12px] font-bold text-[#FF5E13]">
|
2026-03-25 22:15:06 +01:00
|
|
|
{item.title.trim().slice(0, 1).toUpperCase()}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="min-w-0">
|
2026-04-26 23:58:42 +02:00
|
|
|
<p class="truncate text-[13px] font-semibold text-[#0D0D2A]">
|
|
|
|
|
{item.title}
|
|
|
|
|
</p>
|
|
|
|
|
<p class="truncate text-[12px] text-[rgba(13,13,42,0.55)]">
|
|
|
|
|
{item.subtitle}
|
|
|
|
|
</p>
|
2026-03-25 22:15:06 +01:00
|
|
|
</div>
|
|
|
|
|
</A>
|
|
|
|
|
)}
|
|
|
|
|
</For>
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</For>
|
|
|
|
|
</div>
|
|
|
|
|
</Show>
|
|
|
|
|
|
|
|
|
|
<Show when={open() && !searching() && query().trim().length >= 2 && groups().length === 0}>
|
feat(admin): employee management redesign + routing fix
- Fix employees routing: employees.tsx → Outlet layout, actual pages in employees/index.tsx and employees/create.tsx
- Employee list: stat cards, search/filter toolbar, table with 3-dot action menu (Edit, Deactivate, Delete), fallback data
- Employee create: form with full_name, email, role_id, department_id, designation_id selectors; auto-credential note
- Stage all other modified routes for next phases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 08:07:55 +01:00
|
|
|
<div class="absolute left-0 right-0 top-[calc(100%+8px)] z-[300] rounded-2xl border border-[#e5e7eb] bg-white px-4 py-6 text-center text-[13px] text-[rgba(13,13,42,0.55)]">
|
2026-03-25 22:15:06 +01:00
|
|
|
No results for "{query()}"
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
</div>
|
|
|
|
|
</Show>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ShowTabs(props: {
|
|
|
|
|
tabs: Tab[];
|
|
|
|
|
isTabActive: (tab: Tab) => boolean;
|
|
|
|
|
setTabsTrackEl: (el: HTMLDivElement) => void;
|
2026-04-26 23:58:42 +02:00
|
|
|
setTabRefs: (
|
|
|
|
|
fn: (prev: Record<string, HTMLAnchorElement>) => Record<string, HTMLAnchorElement>
|
|
|
|
|
) => void;
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
tabIndicator: () => { left: number; width: number; ready: boolean };
|
|
|
|
|
}) {
|
|
|
|
|
if (props.tabs.length === 0) return null;
|
|
|
|
|
return (
|
2026-04-26 23:58:42 +02:00
|
|
|
<div
|
|
|
|
|
ref={props.setTabsTrackEl}
|
|
|
|
|
class="relative mb-6 mt-1 flex items-center gap-1 border-b border-[#e5e7eb]"
|
|
|
|
|
>
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
<For each={props.tabs}>
|
|
|
|
|
{(tab) => (
|
|
|
|
|
<A
|
|
|
|
|
href={tab.href}
|
|
|
|
|
ref={(el) => props.setTabRefs((prev) => ({ ...prev, [tab.href]: el }))}
|
2026-04-26 23:58:42 +02:00
|
|
|
aria-current={props.isTabActive(tab) ? "page" : undefined}
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
class={`px-4 pb-3 pt-3 text-[14px] font-semibold transition-colors ${
|
2026-04-26 23:58:42 +02:00
|
|
|
props.isTabActive(tab)
|
|
|
|
|
? "text-[#FF5E13]"
|
|
|
|
|
: "text-[rgba(13,13,42,0.6)] hover:text-[#0D0D2A]"
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
{tab.label}
|
|
|
|
|
</A>
|
|
|
|
|
)}
|
|
|
|
|
</For>
|
|
|
|
|
<div
|
2026-04-26 23:58:42 +02:00
|
|
|
class={`absolute bottom-0 h-[2px] bg-[#FF5E13] transition-all duration-300 ease-out ${props.tabIndicator().ready ? "opacity-100" : "opacity-0"}`}
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
style={{ left: `${props.tabIndicator().left}px`, width: `${props.tabIndicator().width}px` }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-16 23:20:54 +01:00
|
|
|
export default function AdminShell(props: { children: JSX.Element }) {
|
2026-03-25 22:15:06 +01:00
|
|
|
const location = useLocation();
|
|
|
|
|
const navigate = useNavigate();
|
feat(admin-parity): approval management, submission viewer, role builder offline fallback
- Rebuilt approval.tsx: reject with reason prompt, request changes with field
keys, request more documents flow, RoleTypeBadge per role type, parsed
requestReason (ONBOARDING_SUBMISSION prefix), management page routing for
approved items, inline ApprovalDetailPanel with remarks timeline
- Rebuilt approval/[id].tsx: full onboarding submission viewer loading from
GET /api/admin/approvals/submission/{user_id}?roleKey=X, flattenFields
recursive flattener, detectKind image/pdf/document/url/text classifier,
image lightbox, PDF iframe modal, approve/reject per role type routing
- Added src/lib/admin-modules.ts: STATIC_PERMISSIONS fallback (39 modules x4
actions) for Internal Role Builder when backend is offline
- roles/create.tsx + roles/[id]/edit.tsx: use STATIC_PERMISSIONS when API
returns empty or fails, builder now works offline
- AdminShell + AdminSidebar: alignment/style fixes from parity review
- ExternalRoleForm: extended fields for external runtime role management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:38 +01:00
|
|
|
const [searchParams] = useSearchParams();
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
const [checkedSession, setCheckedSession] = createSignal(true);
|
|
|
|
|
const [adminName, setAdminName] = createSignal("Admin User");
|
2026-03-27 21:25:00 +01:00
|
|
|
const [allowedModules, setAllowedModules] = createSignal<string[] | null>(null);
|
|
|
|
|
const [isSuperAdmin, setIsSuperAdmin] = createSignal(false);
|
2026-03-25 22:15:06 +01:00
|
|
|
const [sidebarOpen, setSidebarOpen] = createSignal(false);
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
const [sidebarCollapsed, setSidebarCollapsed] = createSignal(false);
|
2026-04-06 18:38:28 +02:00
|
|
|
const [unreadCount, setUnreadCount] = createSignal(0);
|
2026-04-26 23:58:42 +02:00
|
|
|
const [theme, setTheme] = createSignal<"light" | "dark">("light");
|
2026-03-30 04:48:09 +02:00
|
|
|
const [routeTransitioning, setRouteTransitioning] = createSignal(false);
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
const [tabsTrackEl, setTabsTrackEl] = createSignal<HTMLDivElement>();
|
2026-03-25 22:15:06 +01:00
|
|
|
const [tabRefs, setTabRefs] = createSignal<Record<string, HTMLAnchorElement>>({});
|
2026-03-24 02:36:40 +01:00
|
|
|
const [tabIndicator, setTabIndicator] = createSignal({ left: 0, width: 0, ready: false });
|
2026-03-30 04:48:09 +02:00
|
|
|
let contentScrollRef: HTMLDivElement | undefined;
|
|
|
|
|
|
|
|
|
|
const logout = async () => {
|
|
|
|
|
try {
|
2026-04-26 23:58:42 +02:00
|
|
|
const accessToken =
|
|
|
|
|
typeof sessionStorage !== "undefined"
|
|
|
|
|
? sessionStorage.getItem("nxtgauge_admin_access_token") || ""
|
|
|
|
|
: "";
|
|
|
|
|
await fetch("/api/auth/logout", {
|
|
|
|
|
method: "POST",
|
2026-03-30 04:48:09 +02:00
|
|
|
headers: {
|
2026-04-26 23:58:42 +02:00
|
|
|
Accept: "application/json",
|
|
|
|
|
"x-portal-target": "admin",
|
2026-03-30 04:48:09 +02:00
|
|
|
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
|
|
|
|
|
},
|
2026-04-26 23:58:42 +02:00
|
|
|
credentials: "include",
|
2026-03-30 04:48:09 +02:00
|
|
|
}).catch(() => null);
|
|
|
|
|
} finally {
|
2026-04-26 23:58:42 +02:00
|
|
|
if (typeof sessionStorage !== "undefined") {
|
|
|
|
|
sessionStorage.removeItem("nxtgauge_admin_access_token");
|
|
|
|
|
sessionStorage.removeItem("nxtgauge_admin_preview");
|
2026-03-30 04:48:09 +02:00
|
|
|
}
|
|
|
|
|
clearAdminSession();
|
2026-04-26 23:58:42 +02:00
|
|
|
navigate("/login", { replace: true });
|
2026-03-30 04:48:09 +02:00
|
|
|
}
|
|
|
|
|
};
|
2026-03-19 03:36:46 +01:00
|
|
|
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
const tabs = createMemo<Tab[]>(() => {
|
|
|
|
|
const path = location.pathname;
|
|
|
|
|
for (const set of TAB_SETS) {
|
2026-03-25 22:15:06 +01:00
|
|
|
if (set.prefixes.some((p) => path === p || path.startsWith(`${p}/`))) return set.tabs;
|
2026-03-19 03:36:46 +01:00
|
|
|
}
|
feat(admin): build complete admin panel with UI parity and search/filter
- Implement all admin management pages (employees, users, jobs, leads, orders, companies, customers, candidates, approval, invoices, reviews, support, KB, pricing, coupons, credits, discounts, tax, reports, ledger)
- Implement 9 professional vertical pages (developers, designers, tutors, video editors, photographers, makeup artists, graphic designers, social media managers, fitness trainers)
- Implement internal/external dashboard and role management with builder UI
- Fix tab styling: replace inline border-bottom styles with admin-tab CSS class across 8+ pages
- Add search/filter functionality to invoice and review pages
- Add toggle status (activate/deactivate) to employees page with PATCH /api/admin/employees/{id}
- Align UI styling with NextJS admin panel for visual parity
- Add stat cards to approval page showing counts by status
- Implement graceful empty states for all list views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-19 13:04:10 +01:00
|
|
|
return [];
|
|
|
|
|
});
|
|
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
const isTabActive = (tab: Tab) =>
|
|
|
|
|
tab.exact
|
|
|
|
|
? location.pathname === tab.href
|
|
|
|
|
: location.pathname === tab.href || location.pathname.startsWith(`${tab.href}/`);
|
2026-03-19 03:36:46 +01:00
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
const refreshTabIndicator = () => {
|
|
|
|
|
const activeTab = tabs().find((tab) => isTabActive(tab));
|
|
|
|
|
const track = tabsTrackEl();
|
2026-04-26 23:58:42 +02:00
|
|
|
if (!activeTab || !track) {
|
|
|
|
|
setTabIndicator((p) => ({ ...p, ready: false }));
|
|
|
|
|
return;
|
|
|
|
|
}
|
2026-03-24 02:36:40 +01:00
|
|
|
const el = tabRefs()[activeTab.href];
|
|
|
|
|
if (!el) return;
|
|
|
|
|
setTabIndicator({ left: el.offsetLeft, width: el.offsetWidth, ready: true });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
createEffect(() => {
|
2026-03-25 22:15:06 +01:00
|
|
|
tabs();
|
|
|
|
|
location.pathname;
|
2026-03-24 02:36:40 +01:00
|
|
|
requestAnimationFrame(refreshTabIndicator);
|
2026-03-19 13:50:20 +01:00
|
|
|
});
|
|
|
|
|
|
2026-03-30 04:48:09 +02:00
|
|
|
createEffect(() => {
|
|
|
|
|
location.pathname;
|
2026-04-26 23:58:42 +02:00
|
|
|
if (contentScrollRef) {
|
|
|
|
|
contentScrollRef.scrollTop = 0;
|
|
|
|
|
}
|
2026-03-30 04:48:09 +02:00
|
|
|
});
|
|
|
|
|
|
2026-07-19 00:03:57 +05:30
|
|
|
const goToLoginAfterExpiry = () => {
|
|
|
|
|
clearSessionExpired();
|
|
|
|
|
if (typeof sessionStorage !== "undefined") {
|
|
|
|
|
sessionStorage.removeItem("nxtgauge_admin_access_token");
|
|
|
|
|
sessionStorage.removeItem("nxtgauge_admin_preview");
|
|
|
|
|
}
|
|
|
|
|
clearAdminSession();
|
|
|
|
|
navigate(`/login?from=${encodeURIComponent(location.pathname + location.search)}`, {
|
|
|
|
|
replace: true,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-19 03:36:46 +01:00
|
|
|
onMount(() => {
|
2026-07-19 00:03:57 +05:30
|
|
|
installSessionExpiryWatcher();
|
2026-07-19 00:14:39 +05:30
|
|
|
installSessionRefreshLoop();
|
2026-07-19 00:03:57 +05:30
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
const savedTheme = (
|
|
|
|
|
typeof localStorage !== "undefined" ? localStorage.getItem("nxtgauge_admin_theme") : null
|
|
|
|
|
) as "light" | "dark" | null;
|
|
|
|
|
const nextTheme = savedTheme === "dark" ? "dark" : "light";
|
2026-03-30 04:48:09 +02:00
|
|
|
setTheme(nextTheme);
|
2026-04-26 23:58:42 +02:00
|
|
|
if (typeof document !== "undefined") {
|
|
|
|
|
document.documentElement.setAttribute("data-theme", nextTheme);
|
2026-03-30 04:48:09 +02:00
|
|
|
}
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
window.addEventListener("resize", refreshTabIndicator);
|
|
|
|
|
onCleanup(() => window.removeEventListener("resize", refreshTabIndicator));
|
2026-03-24 02:36:40 +01:00
|
|
|
|
2026-04-06 18:38:28 +02:00
|
|
|
// Fetch unread notification count and poll every 30 seconds
|
|
|
|
|
const fetchUnreadCount = async () => {
|
|
|
|
|
try {
|
2026-04-26 23:58:42 +02:00
|
|
|
const accessToken =
|
|
|
|
|
typeof sessionStorage !== "undefined"
|
|
|
|
|
? sessionStorage.getItem("nxtgauge_admin_access_token") || ""
|
|
|
|
|
: "";
|
2026-04-06 18:38:28 +02:00
|
|
|
if (!accessToken) return;
|
2026-04-26 23:58:42 +02:00
|
|
|
const res = await fetch("/api/me/notifications/unread-count", {
|
|
|
|
|
method: "GET",
|
2026-04-06 18:38:28 +02:00
|
|
|
headers: {
|
2026-04-26 23:58:42 +02:00
|
|
|
Accept: "application/json",
|
|
|
|
|
"x-portal-target": "admin",
|
2026-04-06 18:38:28 +02:00
|
|
|
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
|
|
|
|
|
},
|
2026-04-26 23:58:42 +02:00
|
|
|
credentials: "include",
|
2026-04-06 18:38:28 +02:00
|
|
|
});
|
|
|
|
|
if (res.ok) {
|
|
|
|
|
const data = await res.json();
|
|
|
|
|
setUnreadCount(data.unread_count || 0);
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
2026-04-26 23:58:42 +02:00
|
|
|
console.error("Failed to fetch unread count:", e);
|
2026-04-06 18:38:28 +02:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fetchUnreadCount();
|
|
|
|
|
const interval = setInterval(fetchUnreadCount, 30000);
|
|
|
|
|
onCleanup(() => clearInterval(interval));
|
|
|
|
|
|
2026-03-20 22:37:17 +01:00
|
|
|
const verify = async () => {
|
|
|
|
|
if (!hasAdminSession()) {
|
2026-04-26 23:58:42 +02:00
|
|
|
navigate(`/login?from=${encodeURIComponent(location.pathname + location.search)}`, {
|
|
|
|
|
replace: true,
|
|
|
|
|
});
|
2026-03-20 22:37:17 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
2026-04-26 23:58:42 +02:00
|
|
|
const accessToken =
|
|
|
|
|
typeof sessionStorage !== "undefined"
|
|
|
|
|
? sessionStorage.getItem("nxtgauge_admin_access_token") || ""
|
|
|
|
|
: "";
|
|
|
|
|
const response = await fetch("/api/auth/session", {
|
|
|
|
|
method: "GET",
|
2026-03-20 22:37:17 +01:00
|
|
|
headers: {
|
2026-04-26 23:58:42 +02:00
|
|
|
Accept: "application/json",
|
|
|
|
|
"x-portal-target": "admin",
|
2026-03-23 21:13:42 +01:00
|
|
|
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
|
2026-03-20 22:37:17 +01:00
|
|
|
},
|
2026-04-26 23:58:42 +02:00
|
|
|
credentials: "include",
|
2026-03-20 22:37:17 +01:00
|
|
|
});
|
|
|
|
|
const payload = await response.json().catch(() => ({}));
|
2026-04-26 23:58:42 +02:00
|
|
|
if (!response.ok || isExternalIdentity(payload)) throw new Error("Unauthorized");
|
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
|
|
|
if (payload?.full_name) setAdminName(payload.full_name);
|
2026-03-27 21:25:00 +01:00
|
|
|
|
|
|
|
|
const roleKey = String(
|
2026-04-26 23:58:42 +02:00
|
|
|
payload?.active_role ||
|
|
|
|
|
payload?.role ||
|
|
|
|
|
payload?.user?.active_role ||
|
|
|
|
|
payload?.user?.active_role_key ||
|
|
|
|
|
payload?.user?.role ||
|
|
|
|
|
payload?.user?.role_key ||
|
|
|
|
|
""
|
2026-03-27 21:25:00 +01:00
|
|
|
).toUpperCase();
|
2026-04-26 23:58:42 +02:00
|
|
|
setIsSuperAdmin(roleKey === "SUPER_ADMIN");
|
2026-03-27 21:25:00 +01:00
|
|
|
|
|
|
|
|
try {
|
2026-04-26 23:58:42 +02:00
|
|
|
const res = await fetch("/api/runtime-config", {
|
|
|
|
|
method: "GET",
|
2026-03-27 21:25:00 +01:00
|
|
|
headers: {
|
2026-04-26 23:58:42 +02:00
|
|
|
Accept: "application/json",
|
|
|
|
|
"x-portal-target": "admin",
|
2026-03-27 21:25:00 +01:00
|
|
|
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
|
|
|
|
|
},
|
2026-04-26 23:58:42 +02:00
|
|
|
credentials: "include",
|
2026-03-27 21:25:00 +01:00
|
|
|
});
|
|
|
|
|
const runtime = await res.json().catch(() => ({}));
|
|
|
|
|
if (res.ok) {
|
2026-03-30 04:48:09 +02:00
|
|
|
setAllowedModules(normalizeAllowedModules(runtime));
|
2026-04-26 23:58:42 +02:00
|
|
|
const activeRole = String(
|
|
|
|
|
runtime?.active_role || runtime?.user?.active_role || roleKey || ""
|
|
|
|
|
).toUpperCase();
|
|
|
|
|
if (activeRole) setIsSuperAdmin(activeRole === "SUPER_ADMIN");
|
2026-03-27 21:25:00 +01:00
|
|
|
} else {
|
|
|
|
|
setAllowedModules(null);
|
|
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
setAllowedModules(null);
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-20 22:37:17 +01:00
|
|
|
setCheckedSession(true);
|
|
|
|
|
} catch {
|
|
|
|
|
clearAdminSession();
|
2026-04-26 23:58:42 +02:00
|
|
|
navigate(`/login?from=${encodeURIComponent(location.pathname + location.search)}`, {
|
|
|
|
|
replace: true,
|
|
|
|
|
});
|
2026-03-20 22:37:17 +01:00
|
|
|
}
|
|
|
|
|
};
|
2026-03-25 22:15:06 +01:00
|
|
|
|
2026-03-20 22:37:17 +01:00
|
|
|
void verify();
|
2026-03-19 03:36:46 +01:00
|
|
|
});
|
|
|
|
|
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
const pageTitle = createMemo(() => {
|
|
|
|
|
const path = location.pathname;
|
|
|
|
|
for (const entry of PAGE_TITLES) {
|
2026-04-26 23:58:42 +02:00
|
|
|
if (
|
|
|
|
|
entry.exact
|
|
|
|
|
? path === entry.prefix
|
|
|
|
|
: path === entry.prefix || path.startsWith(`${entry.prefix}/`)
|
|
|
|
|
) {
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
return entry.label;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-26 23:58:42 +02:00
|
|
|
return "Admin";
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
});
|
|
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
const adminInitials = createMemo(() => {
|
2026-04-26 23:58:42 +02:00
|
|
|
if (adminName().trim().toLowerCase() === "admin user") return "AD";
|
|
|
|
|
const parts = adminName()
|
|
|
|
|
.split(" ")
|
|
|
|
|
.map((s) => s.trim())
|
|
|
|
|
.filter(Boolean);
|
|
|
|
|
if (parts.length === 0) return "U";
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
|
|
|
return `${parts[0][0]}${parts[1][0]}`.toUpperCase();
|
2026-03-24 02:36:40 +01:00
|
|
|
});
|
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
|
|
|
|
2026-03-30 04:48:09 +02:00
|
|
|
createEffect(() => {
|
|
|
|
|
const t = theme();
|
2026-04-26 23:58:42 +02:00
|
|
|
if (typeof localStorage !== "undefined") localStorage.setItem("nxtgauge_admin_theme", t);
|
|
|
|
|
if (typeof document !== "undefined") document.documentElement.setAttribute("data-theme", t);
|
2026-03-30 04:48:09 +02:00
|
|
|
});
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
const toggleTheme = () => setTheme((v) => (v === "dark" ? "light" : "dark"));
|
|
|
|
|
const isDark = () => theme() === "dark";
|
2026-03-30 04:48:09 +02:00
|
|
|
|
2026-03-27 21:25:00 +01:00
|
|
|
createEffect(() => {
|
|
|
|
|
if (!checkedSession()) return;
|
|
|
|
|
if (isSuperAdmin()) return;
|
|
|
|
|
|
|
|
|
|
const modules = allowedModules();
|
|
|
|
|
if (!modules || modules.length === 0) return;
|
|
|
|
|
|
|
|
|
|
const path = location.pathname;
|
2026-04-26 23:58:42 +02:00
|
|
|
if (path === "/admin") return;
|
2026-03-27 21:25:00 +01:00
|
|
|
|
2026-03-30 04:48:09 +02:00
|
|
|
const matches = ROUTE_MODULE_KEYS.filter(
|
2026-04-26 23:58:42 +02:00
|
|
|
(entry) => path === entry.prefix || path.startsWith(`${entry.prefix}/`)
|
2026-03-30 04:48:09 +02:00
|
|
|
);
|
|
|
|
|
const guard = matches.sort((a, b) => b.prefix.length - a.prefix.length)[0];
|
2026-03-27 21:25:00 +01:00
|
|
|
if (!guard) return;
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
const allowed = new Set(
|
|
|
|
|
modules
|
|
|
|
|
.map((m) =>
|
|
|
|
|
String(m || "")
|
|
|
|
|
.trim()
|
|
|
|
|
.toUpperCase()
|
|
|
|
|
)
|
|
|
|
|
.filter(Boolean)
|
|
|
|
|
);
|
2026-03-27 21:25:00 +01:00
|
|
|
const ok = guard.keys.some((k) => allowed.has(String(k).toUpperCase()));
|
|
|
|
|
if (ok) return;
|
|
|
|
|
|
2026-04-26 23:58:42 +02:00
|
|
|
navigate(
|
|
|
|
|
`/admin?denied=${encodeURIComponent(guard.keys[0])}&from=${encodeURIComponent(path)}`,
|
|
|
|
|
{ replace: true }
|
|
|
|
|
);
|
2026-03-27 21:25:00 +01:00
|
|
|
});
|
|
|
|
|
|
2026-03-16 23:20:54 +01:00
|
|
|
return (
|
2026-04-26 23:58:42 +02:00
|
|
|
<div
|
|
|
|
|
class="min-h-screen"
|
|
|
|
|
style={{
|
|
|
|
|
background: isDark() ? "#0B1220" : "#F9FAFB",
|
|
|
|
|
color: isDark() ? "#E5E7EB" : "#0D0D2A",
|
|
|
|
|
}}
|
|
|
|
|
>
|
2026-07-19 00:03:57 +05:30
|
|
|
<Show when={sessionExpired()}>
|
|
|
|
|
<div
|
|
|
|
|
style="position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;background:rgba(13,13,42,0.55);padding:16px"
|
|
|
|
|
role="alertdialog"
|
|
|
|
|
aria-modal="true"
|
|
|
|
|
aria-labelledby="session-expired-title"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
background: isDark() ? "#111827" : "white",
|
|
|
|
|
color: isDark() ? "#E5E7EB" : "#0D0D2A",
|
|
|
|
|
"border-radius": "12px",
|
|
|
|
|
padding: "24px",
|
|
|
|
|
"max-width": "380px",
|
|
|
|
|
width: "100%",
|
|
|
|
|
"box-shadow": "0 20px 40px rgba(0,0,0,0.25)",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<h2 id="session-expired-title" style="font-size:16px;font-weight:700;margin:0 0 8px">
|
|
|
|
|
You have been logged out
|
|
|
|
|
</h2>
|
|
|
|
|
<p style="font-size:14px;color:#6B7280;margin:0 0 20px">
|
|
|
|
|
Your session has expired for security reasons. Please log in again to continue.
|
|
|
|
|
</p>
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={goToLoginAfterExpiry}
|
|
|
|
|
style="width:100%;padding:10px 16px;border-radius:8px;border:none;background:#FF5E13;color:white;font-size:14px;font-weight:600;cursor:pointer"
|
|
|
|
|
>
|
|
|
|
|
Log In Again
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Show>
|
|
|
|
|
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
<Show
|
|
|
|
|
when={checkedSession()}
|
2026-04-26 23:58:42 +02:00
|
|
|
fallback={
|
|
|
|
|
<div class="flex min-h-screen items-center justify-center text-[14px] text-[rgba(13,13,42,0.55)]">
|
|
|
|
|
Checking session…
|
|
|
|
|
</div>
|
|
|
|
|
}
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
>
|
2026-03-27 02:09:55 +01:00
|
|
|
<div style="display:flex;height:100vh;overflow:hidden">
|
2026-04-26 23:58:42 +02:00
|
|
|
<div
|
|
|
|
|
class={`fixed inset-0 z-20 bg-black/30 transition-opacity lg:hidden ${sidebarOpen() ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"}`}
|
|
|
|
|
onClick={() => setSidebarOpen(false)}
|
|
|
|
|
/>
|
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
|
|
|
|
2026-03-27 02:09:55 +01:00
|
|
|
<div style="height:100%;display:flex;flex-shrink:0">
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<AdminSidebar
|
|
|
|
|
collapsed={sidebarCollapsed()}
|
|
|
|
|
onToggle={() => setSidebarCollapsed((v) => !v)}
|
|
|
|
|
onNavigate={() => setSidebarOpen(false)}
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
adminName={adminName()}
|
|
|
|
|
adminInitials={adminInitials()}
|
2026-03-30 04:48:09 +02:00
|
|
|
theme={theme()}
|
2026-03-27 21:25:00 +01:00
|
|
|
allowedModules={allowedModules()}
|
|
|
|
|
isSuperAdmin={isSuperAdmin()}
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
/>
|
2026-03-24 02:36:40 +01:00
|
|
|
</div>
|
|
|
|
|
|
2026-03-25 22:15:06 +01:00
|
|
|
<div class="flex min-w-0 flex-1 flex-col">
|
2026-04-26 23:58:42 +02:00
|
|
|
<header
|
|
|
|
|
style={`height:64px;border-bottom:1px solid ${isDark() ? "#1F2937" : "#E5E7EB"};background:${isDark() ? "#111827" : "white"};flex-shrink:0`}
|
|
|
|
|
>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
<div style="display:flex;height:100%;width:100%;align-items:center;justify-content:flex-end;padding:0 32px">
|
|
|
|
|
<div style="display:flex;align-items:center;gap:4px">
|
2026-04-26 23:58:42 +02:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={toggleTheme}
|
|
|
|
|
style={`display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;border-radius:8px;color:${isDark() ? "#CBD5E1" : "#6B7280"};background:none;border:none;cursor:pointer`}
|
|
|
|
|
aria-label="Toggle theme"
|
|
|
|
|
>
|
2026-03-30 04:48:09 +02:00
|
|
|
<Show when={isDark()} fallback={<Moon size={18} />}>
|
|
|
|
|
<Sun size={18} />
|
|
|
|
|
</Show>
|
|
|
|
|
</button>
|
2026-04-26 23:58:42 +02:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
style={`position:relative;display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;border-radius:8px;color:${isDark() ? "#CBD5E1" : "#6B7280"};background:none;border:none;cursor:pointer`}
|
|
|
|
|
aria-label="Notifications"
|
|
|
|
|
>
|
|
|
|
|
<Bell size={18} />
|
|
|
|
|
<Show when={unreadCount() > 0}>
|
|
|
|
|
<span
|
|
|
|
|
style={`position:absolute;right:8px;top:8px;width:7px;height:7px;border-radius:50%;border:2px solid ${isDark() ? "#111827" : "white"};background:#FF5E13`}
|
|
|
|
|
/>
|
|
|
|
|
</Show>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
style={`display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;border-radius:8px;color:${isDark() ? "#CBD5E1" : "#6B7280"};background:none;border:none;cursor:pointer`}
|
|
|
|
|
aria-label="Settings"
|
|
|
|
|
>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
<Settings size={18} />
|
2026-03-25 22:15:06 +01:00
|
|
|
</button>
|
2026-04-26 23:58:42 +02:00
|
|
|
<div
|
|
|
|
|
style={`width:1px;height:24px;background:${isDark() ? "#1F2937" : "#E5E7EB"};margin:0 8px`}
|
|
|
|
|
/>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
style="display:inline-flex;align-items:center;gap:8px;border-radius:8px;padding:4px 8px 4px 4px;background:none;border:none;cursor:pointer"
|
|
|
|
|
aria-label="User menu"
|
|
|
|
|
>
|
|
|
|
|
<div style="width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#FF5E13,#ff7a3d);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:white;flex-shrink:0">
|
2026-03-25 22:15:06 +01:00
|
|
|
{adminInitials()}
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
</div>
|
|
|
|
|
<div style="text-align:left">
|
2026-04-26 23:58:42 +02:00
|
|
|
<p
|
|
|
|
|
style={`font-size:13px;font-weight:600;color:${isDark() ? "#E5E7EB" : "#111827"};line-height:1.3`}
|
|
|
|
|
>
|
|
|
|
|
{adminName()}
|
|
|
|
|
</p>
|
|
|
|
|
<p
|
|
|
|
|
style={`font-size:11px;color:${isDark() ? "#94A3B8" : "#6B7280"};line-height:1.3`}
|
|
|
|
|
>
|
|
|
|
|
Super Admin
|
|
|
|
|
</p>
|
feat(admin): pixel-perfect UI overhaul for department, designation, roles, employees pages
- Rewrote all layout/spacing with inline styles (Tailwind v4 doesn't generate most utility classes)
- AdminSidebar: all 37 modules in 9 groups, scrollable, 220px/64px collapse, no bottom user section
- AdminShell: header height 64px, user avatar top-right (Gmail-style), removed search bar
- Department: orange-only status badges, dark navy table header (white text), edge-to-edge table, View/Create/All tabs, View action in row menu, form with inline styles
- Designation: full rewrite matching department pattern — same tabs, filter bar, table, form
- Roles/Employees: compact filter bar and table cell sizing fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:56:55 +01:00
|
|
|
</div>
|
2026-03-25 22:15:06 +01:00
|
|
|
</button>
|
2026-03-30 04:48:09 +02:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => void logout()}
|
2026-04-26 23:58:42 +02:00
|
|
|
style={`height:32px;border-radius:8px;border:1px solid ${isDark() ? "#374151" : "#E5E7EB"};background:${isDark() ? "#1F2937" : "white"};padding:0 12px;font-size:12px;font-weight:600;color:${isDark() ? "#E5E7EB" : "#374151"};cursor:pointer`}
|
2026-03-30 04:48:09 +02:00
|
|
|
>
|
|
|
|
|
Logout
|
|
|
|
|
</button>
|
2026-03-25 22:15:06 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
2026-03-30 04:48:09 +02:00
|
|
|
<div
|
2026-04-26 23:58:42 +02:00
|
|
|
ref={(el) => {
|
|
|
|
|
contentScrollRef = el;
|
|
|
|
|
}}
|
2026-03-30 04:48:09 +02:00
|
|
|
class="min-h-0 flex-1 overflow-y-scroll"
|
2026-04-26 23:58:42 +02:00
|
|
|
style={{ background: isDark() ? "#0B1220" : "#F9FAFB", "scrollbar-gutter": "stable" }}
|
2026-03-30 04:48:09 +02:00
|
|
|
>
|
|
|
|
|
<main
|
|
|
|
|
class="admin-main"
|
|
|
|
|
style={{
|
2026-04-26 23:58:42 +02:00
|
|
|
width: "100%",
|
|
|
|
|
padding: "28px 24px 36px 24px",
|
|
|
|
|
filter: isDark() ? "brightness(0.96)" : "none",
|
|
|
|
|
transition: "opacity 150ms ease",
|
|
|
|
|
opacity: routeTransitioning() ? "0.92" : "1",
|
2026-03-30 04:48:09 +02:00
|
|
|
}}
|
|
|
|
|
>
|
2026-03-25 22:15:06 +01:00
|
|
|
{props.children}
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-03-19 03:36:46 +01:00
|
|
|
</div>
|
feat: phase 1+2 — shell redesign + drag-and-drop dashboard
Shell (AdminShell + AdminSidebar):
- Logo moved to header-left section, width syncs with sidebar collapse state
- Global search bar with debounced multi-module API calls and grouped dropdown
- Bell notification icon with badge, gear → /admin/settings, user dropdown with logout
- Sidebar: 7 grouped nav sections with dividers, orange left-border active state,
removed "Active" badge pill, user info (avatar + name + role) pinned to bottom
- Fixed all sidebar labels to match Figma (Employee Management, External Onboarding
Management, Users Management, Verification Management)
- Added missing sidebar items: Verification, Fitness Trainers, Graphic Designers,
Social Media, Video Editors, Catering Services, Applications, Responses
Dashboard (admin/index):
- Rebuilt to match Figma: "Dashboard Overview" title, Export Report button
- 4 stat cards (Total Users, Active Companies, Open Leads, Credits Purchased)
with real API fetch, orange icons, delta badges, graceful — fallback
- ApexCharts: Leads Trend (orange gradient line) + Revenue Overview (navy bars)
- Drag-and-drop widget system via @thisbeyond/solid-dnd — sortable stat cards
and chart cards with handles and remove buttons in Customise mode
- Add Widget panel shows all available widgets not on dashboard
- 8 stat widgets + 3 chart widgets available; layout persists in localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 19:21:54 +01:00
|
|
|
</Show>
|
2026-03-24 02:36:40 +01:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|