2026-03-18 23:04:28 +01:00
|
|
|
import { useNavigate, useLocation } from 'react-router-dom'
|
2026-03-18 17:50:41 +01:00
|
|
|
import { TopBar } from '../../design-system/layout/TopBar/TopBar'
|
refactor: admin section UX/UI redesign
- Fix critical --bg-base token bug (dark mode broken), replace with --bg-surface
- Replace hand-rolled admin nav with Tabs composite (proper ARIA)
- Migrate AuditLog from custom table to DataTable with sorting, row accents, card wrapper
- Remove duplicate h2 page titles (breadcrumb + tab already identify the page)
- Rework user creation with provider-aware form (Local/OIDC RadioGroup)
- Add Security section with password reset for local users, OIDC info for external
- Add toast notifications to all RBAC mutations (create/delete/add/remove)
- Add confirmation dialogs for cascading removals (group/role)
- Add keyboard accessibility to entity lists (role/tabIndex/aria-selected)
- Add empty search states, duplicate name validation
- Replace lock emoji with Badge, fix radii/shadow/padding consistency
- Badge dashed variant keeps background color
- Inherited roles shown with dashed outline + reduced opacity
- Inline MultiSelect (+Add) for groups, roles, members, child groups
- Center OIDC form, replace inline styles with CSS modules
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 09:44:19 +01:00
|
|
|
import { Tabs } from '../../design-system/composites/Tabs/Tabs'
|
2026-03-18 23:04:28 +01:00
|
|
|
import styles from './Admin.module.css'
|
|
|
|
|
import type { ReactNode } from 'react'
|
|
|
|
|
|
|
|
|
|
const ADMIN_TABS = [
|
refactor: admin section UX/UI redesign
- Fix critical --bg-base token bug (dark mode broken), replace with --bg-surface
- Replace hand-rolled admin nav with Tabs composite (proper ARIA)
- Migrate AuditLog from custom table to DataTable with sorting, row accents, card wrapper
- Remove duplicate h2 page titles (breadcrumb + tab already identify the page)
- Rework user creation with provider-aware form (Local/OIDC RadioGroup)
- Add Security section with password reset for local users, OIDC info for external
- Add toast notifications to all RBAC mutations (create/delete/add/remove)
- Add confirmation dialogs for cascading removals (group/role)
- Add keyboard accessibility to entity lists (role/tabIndex/aria-selected)
- Add empty search states, duplicate name validation
- Replace lock emoji with Badge, fix radii/shadow/padding consistency
- Badge dashed variant keeps background color
- Inherited roles shown with dashed outline + reduced opacity
- Inline MultiSelect (+Add) for groups, roles, members, child groups
- Center OIDC form, replace inline styles with CSS modules
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 09:44:19 +01:00
|
|
|
{ label: 'User Management', value: '/admin/rbac' },
|
|
|
|
|
{ label: 'Audit Log', value: '/admin/audit' },
|
|
|
|
|
{ label: 'OIDC', value: '/admin/oidc' },
|
2026-03-18 23:04:28 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
interface AdminLayoutProps {
|
|
|
|
|
title: string
|
|
|
|
|
children: ReactNode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AdminLayout({ title, children }: AdminLayoutProps) {
|
|
|
|
|
const navigate = useNavigate()
|
|
|
|
|
const location = useLocation()
|
2026-03-18 17:50:41 +01:00
|
|
|
|
|
|
|
|
return (
|
2026-04-02 18:09:16 +02:00
|
|
|
<>
|
2026-03-18 17:50:41 +01:00
|
|
|
<TopBar
|
2026-03-18 23:04:28 +01:00
|
|
|
breadcrumb={[
|
|
|
|
|
{ label: 'Admin', href: '/admin' },
|
|
|
|
|
{ label: title },
|
|
|
|
|
]}
|
2026-03-18 17:50:41 +01:00
|
|
|
environment="PRODUCTION"
|
|
|
|
|
user={{ name: 'hendrik' }}
|
|
|
|
|
/>
|
refactor: admin section UX/UI redesign
- Fix critical --bg-base token bug (dark mode broken), replace with --bg-surface
- Replace hand-rolled admin nav with Tabs composite (proper ARIA)
- Migrate AuditLog from custom table to DataTable with sorting, row accents, card wrapper
- Remove duplicate h2 page titles (breadcrumb + tab already identify the page)
- Rework user creation with provider-aware form (Local/OIDC RadioGroup)
- Add Security section with password reset for local users, OIDC info for external
- Add toast notifications to all RBAC mutations (create/delete/add/remove)
- Add confirmation dialogs for cascading removals (group/role)
- Add keyboard accessibility to entity lists (role/tabIndex/aria-selected)
- Add empty search states, duplicate name validation
- Replace lock emoji with Badge, fix radii/shadow/padding consistency
- Badge dashed variant keeps background color
- Inherited roles shown with dashed outline + reduced opacity
- Inline MultiSelect (+Add) for groups, roles, members, child groups
- Center OIDC form, replace inline styles with CSS modules
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 09:44:19 +01:00
|
|
|
<Tabs
|
|
|
|
|
tabs={ADMIN_TABS}
|
|
|
|
|
active={location.pathname}
|
|
|
|
|
onChange={(path) => navigate(path)}
|
|
|
|
|
/>
|
2026-03-18 23:04:28 +01:00
|
|
|
<div className={styles.adminContent}>
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
2026-04-02 18:09:16 +02:00
|
|
|
</>
|
2026-03-18 17:50:41 +01:00
|
|
|
)
|
|
|
|
|
}
|