feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
import { useState, useMemo } from 'react';
|
2026-03-23 18:32:07 +01:00
|
|
|
import {
|
|
|
|
|
Avatar,
|
|
|
|
|
Badge,
|
|
|
|
|
Button,
|
|
|
|
|
Input,
|
|
|
|
|
MonoText,
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
SectionHeader,
|
2026-03-23 18:32:07 +01:00
|
|
|
Tag,
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
ConfirmDialog,
|
|
|
|
|
SplitPane,
|
|
|
|
|
EntityList,
|
|
|
|
|
Spinner,
|
2026-03-23 18:32:07 +01:00
|
|
|
useToast,
|
|
|
|
|
} from '@cameleer/design-system';
|
|
|
|
|
import {
|
|
|
|
|
useRoles,
|
|
|
|
|
useRole,
|
|
|
|
|
useCreateRole,
|
|
|
|
|
useDeleteRole,
|
|
|
|
|
} from '../../api/queries/admin/rbac';
|
|
|
|
|
import type { RoleDetail } from '../../api/queries/admin/rbac';
|
|
|
|
|
import styles from './UserManagement.module.css';
|
|
|
|
|
|
|
|
|
|
export default function RolesTab() {
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
const { toast } = useToast();
|
2026-03-23 18:32:07 +01:00
|
|
|
const { data: roles, isLoading } = useRoles();
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
|
2026-03-23 18:32:07 +01:00
|
|
|
const [search, setSearch] = useState('');
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
const [selectedId, setSelectedId] = useState<string | null>(null);
|
|
|
|
|
const [creating, setCreating] = useState(false);
|
|
|
|
|
const [deleteTarget, setDeleteTarget] = useState<RoleDetail | null>(null);
|
|
|
|
|
|
|
|
|
|
// Create form state
|
2026-03-23 18:32:07 +01:00
|
|
|
const [newName, setNewName] = useState('');
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
const [newDesc, setNewDesc] = useState('');
|
2026-03-23 18:32:07 +01:00
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
// Detail query
|
2026-03-23 18:32:07 +01:00
|
|
|
const { data: detail, isLoading: detailLoading } = useRole(selectedId);
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
|
|
|
|
|
// Mutations
|
2026-03-23 18:32:07 +01:00
|
|
|
const createRole = useCreateRole();
|
|
|
|
|
const deleteRole = useDeleteRole();
|
|
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
const filtered = useMemo(() => {
|
|
|
|
|
const list = roles ?? [];
|
|
|
|
|
if (!search) return list;
|
|
|
|
|
const q = search.toLowerCase();
|
|
|
|
|
return list.filter(
|
|
|
|
|
(r) =>
|
|
|
|
|
r.name.toLowerCase().includes(q) ||
|
|
|
|
|
r.description.toLowerCase().includes(q),
|
|
|
|
|
);
|
|
|
|
|
}, [roles, search]);
|
|
|
|
|
|
|
|
|
|
const duplicateRoleName =
|
|
|
|
|
newName.trim() !== '' &&
|
|
|
|
|
(roles ?? []).some((r) => r.name === newName.trim().toUpperCase());
|
2026-03-23 18:32:07 +01:00
|
|
|
|
|
|
|
|
function handleCreate() {
|
|
|
|
|
if (!newName.trim()) return;
|
|
|
|
|
createRole.mutate(
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{ name: newName.trim().toUpperCase(), description: newDesc.trim() || undefined },
|
2026-03-23 18:32:07 +01:00
|
|
|
{
|
|
|
|
|
onSuccess: () => {
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
toast({
|
|
|
|
|
title: 'Role created',
|
|
|
|
|
description: newName.trim().toUpperCase(),
|
|
|
|
|
variant: 'success',
|
|
|
|
|
});
|
|
|
|
|
setCreating(false);
|
2026-03-23 18:32:07 +01:00
|
|
|
setNewName('');
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
setNewDesc('');
|
2026-03-23 18:32:07 +01:00
|
|
|
},
|
|
|
|
|
onError: () => {
|
|
|
|
|
toast({ title: 'Failed to create role', variant: 'error' });
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleDelete() {
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
if (!deleteTarget) return;
|
|
|
|
|
deleteRole.mutate(deleteTarget.id, {
|
2026-03-23 18:32:07 +01:00
|
|
|
onSuccess: () => {
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
toast({
|
|
|
|
|
title: 'Role deleted',
|
|
|
|
|
description: deleteTarget.name,
|
|
|
|
|
variant: 'warning',
|
|
|
|
|
});
|
|
|
|
|
if (selectedId === deleteTarget.id) setSelectedId(null);
|
|
|
|
|
setDeleteTarget(null);
|
2026-03-23 18:32:07 +01:00
|
|
|
},
|
|
|
|
|
onError: () => {
|
|
|
|
|
toast({ title: 'Failed to delete role', variant: 'error' });
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
setDeleteTarget(null);
|
2026-03-23 18:32:07 +01:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
function getAssignmentCount(role: RoleDetail): number {
|
|
|
|
|
return (
|
|
|
|
|
(role.assignedGroups?.length ?? 0) + (role.directUsers?.length ?? 0)
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-03-23 18:32:07 +01:00
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
if (isLoading) return <Spinner size="md" />;
|
2026-03-23 18:32:07 +01:00
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<SplitPane
|
|
|
|
|
list={
|
|
|
|
|
<>
|
|
|
|
|
{creating && (
|
|
|
|
|
<div className={styles.createForm}>
|
|
|
|
|
<Input
|
|
|
|
|
placeholder="Role name *"
|
|
|
|
|
value={newName}
|
|
|
|
|
onChange={(e) => setNewName(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
{duplicateRoleName && (
|
|
|
|
|
<span style={{ color: 'var(--error)', fontSize: 11 }}>
|
|
|
|
|
Role name already exists
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
<Input
|
|
|
|
|
placeholder="Description"
|
|
|
|
|
value={newDesc}
|
|
|
|
|
onChange={(e) => setNewDesc(e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
<div className={styles.createFormActions}>
|
|
|
|
|
<Button
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
onClick={() => setCreating(false)}
|
|
|
|
|
>
|
|
|
|
|
Cancel
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="primary"
|
|
|
|
|
onClick={handleCreate}
|
|
|
|
|
loading={createRole.isPending}
|
|
|
|
|
disabled={!newName.trim() || duplicateRoleName}
|
|
|
|
|
>
|
|
|
|
|
Create
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<EntityList
|
|
|
|
|
items={filtered}
|
|
|
|
|
renderItem={(role) => (
|
|
|
|
|
<>
|
2026-03-23 18:32:07 +01:00
|
|
|
<Avatar name={role.name} size="sm" />
|
|
|
|
|
<div className={styles.entityInfo}>
|
|
|
|
|
<div className={styles.entityName}>
|
|
|
|
|
{role.name}
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{role.system && (
|
|
|
|
|
<Badge
|
|
|
|
|
label="system"
|
|
|
|
|
color="auto"
|
|
|
|
|
variant="outlined"
|
|
|
|
|
className={styles.providerBadge}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
2026-03-23 18:32:07 +01:00
|
|
|
</div>
|
|
|
|
|
<div className={styles.entityMeta}>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{role.description || '\u2014'} \u00b7{' '}
|
|
|
|
|
{getAssignmentCount(role)} assignments
|
|
|
|
|
</div>
|
|
|
|
|
<div className={styles.entityTags}>
|
|
|
|
|
{(role.assignedGroups ?? []).map((g) => (
|
|
|
|
|
<Badge key={g.id} label={g.name} color="success" />
|
|
|
|
|
))}
|
|
|
|
|
{(role.directUsers ?? []).map((u) => (
|
|
|
|
|
<Badge
|
|
|
|
|
key={u.userId}
|
|
|
|
|
label={u.displayName}
|
|
|
|
|
color="auto"
|
|
|
|
|
/>
|
|
|
|
|
))}
|
2026-03-23 18:32:07 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
getItemId={(role) => role.id}
|
|
|
|
|
selectedId={selectedId ?? undefined}
|
|
|
|
|
onSelect={setSelectedId}
|
|
|
|
|
searchPlaceholder="Search roles..."
|
|
|
|
|
onSearch={setSearch}
|
|
|
|
|
addLabel="+ Add role"
|
|
|
|
|
onAdd={() => setCreating(true)}
|
|
|
|
|
emptyMessage="No roles match your search"
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
detail={
|
|
|
|
|
selectedId && (detailLoading || !detail) ? (
|
|
|
|
|
<Spinner size="md" />
|
|
|
|
|
) : detail ? (
|
|
|
|
|
<RoleDetailPanel
|
|
|
|
|
role={detail}
|
|
|
|
|
onDeleteRequest={() => setDeleteTarget(detail)}
|
|
|
|
|
/>
|
|
|
|
|
) : null
|
|
|
|
|
}
|
|
|
|
|
emptyMessage="Select a role to view details"
|
|
|
|
|
/>
|
2026-03-23 18:32:07 +01:00
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<ConfirmDialog
|
|
|
|
|
open={deleteTarget !== null}
|
|
|
|
|
onClose={() => setDeleteTarget(null)}
|
|
|
|
|
onConfirm={handleDelete}
|
|
|
|
|
message={`Delete role "${deleteTarget?.name}"? This cannot be undone.`}
|
|
|
|
|
confirmText={deleteTarget?.name ?? ''}
|
|
|
|
|
loading={deleteRole.isPending}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
2026-03-23 18:32:07 +01:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Detail panel ──────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
interface RoleDetailPanelProps {
|
|
|
|
|
role: RoleDetail;
|
|
|
|
|
onDeleteRequest: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function RoleDetailPanel({ role, onDeleteRequest }: RoleDetailPanelProps) {
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
const directUserIds = new Set(
|
|
|
|
|
(role.directUsers ?? []).map((u) => u.userId),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const assignedGroups = role.assignedGroups ?? [];
|
|
|
|
|
const directUsers = role.directUsers ?? [];
|
|
|
|
|
const effectivePrincipals = role.effectivePrincipals ?? [];
|
2026-03-23 18:32:07 +01:00
|
|
|
|
|
|
|
|
return (
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<>
|
2026-03-23 18:32:07 +01:00
|
|
|
<div className={styles.detailHeader}>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<Avatar name={role.name} size="lg" />
|
|
|
|
|
<div className={styles.detailHeaderInfo}>
|
|
|
|
|
<div className={styles.detailName}>{role.name}</div>
|
2026-03-23 18:32:07 +01:00
|
|
|
{role.description && (
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<div className={styles.detailEmail}>{role.description}</div>
|
2026-03-23 18:32:07 +01:00
|
|
|
)}
|
|
|
|
|
</div>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{!role.system && (
|
|
|
|
|
<Button size="sm" variant="danger" onClick={onDeleteRequest}>
|
|
|
|
|
Delete
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
2026-03-23 18:32:07 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className={styles.metaGrid}>
|
|
|
|
|
<span className={styles.metaLabel}>ID</span>
|
|
|
|
|
<MonoText size="xs">{role.id}</MonoText>
|
|
|
|
|
<span className={styles.metaLabel}>Scope</span>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<span className={styles.metaValue}>{role.scope || '\u2014'}</span>
|
|
|
|
|
{role.system && (
|
|
|
|
|
<>
|
|
|
|
|
<span className={styles.metaLabel}>Type</span>
|
|
|
|
|
<span className={styles.metaValue}>System role (read-only)</span>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
2026-03-23 18:32:07 +01:00
|
|
|
</div>
|
|
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<SectionHeader>Assigned to groups</SectionHeader>
|
2026-03-23 18:32:07 +01:00
|
|
|
<div className={styles.sectionTags}>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{assignedGroups.map((g) => (
|
|
|
|
|
<Tag key={g.id} label={g.name} color="success" />
|
|
|
|
|
))}
|
|
|
|
|
{assignedGroups.length === 0 && (
|
|
|
|
|
<span className={styles.inheritedNote}>(none)</span>
|
2026-03-23 18:32:07 +01:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<SectionHeader>Assigned to users (direct)</SectionHeader>
|
2026-03-23 18:32:07 +01:00
|
|
|
<div className={styles.sectionTags}>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{directUsers.map((u) => (
|
|
|
|
|
<Tag key={u.userId} label={u.displayName} color="auto" />
|
|
|
|
|
))}
|
|
|
|
|
{directUsers.length === 0 && (
|
|
|
|
|
<span className={styles.inheritedNote}>(none)</span>
|
2026-03-23 18:32:07 +01:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
<SectionHeader>Effective principals</SectionHeader>
|
2026-03-23 18:32:07 +01:00
|
|
|
<div className={styles.sectionTags}>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{effectivePrincipals.map((u) => {
|
|
|
|
|
const isDirect = directUserIds.has(u.userId);
|
|
|
|
|
return isDirect ? (
|
|
|
|
|
<Badge
|
|
|
|
|
key={u.userId}
|
|
|
|
|
label={u.displayName}
|
|
|
|
|
color="auto"
|
|
|
|
|
variant="filled"
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<Badge
|
|
|
|
|
key={u.userId}
|
|
|
|
|
label={u.displayName}
|
|
|
|
|
color="auto"
|
|
|
|
|
variant="dashed"
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
{effectivePrincipals.length === 0 && (
|
|
|
|
|
<span className={styles.inheritedNote}>(none)</span>
|
2026-03-23 18:32:07 +01:00
|
|
|
)}
|
|
|
|
|
</div>
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
{effectivePrincipals.some((u) => !directUserIds.has(u.userId)) && (
|
|
|
|
|
<span className={styles.inheritedNote}>
|
2026-03-23 18:32:07 +01:00
|
|
|
Dashed entries inherit this role through group membership
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
</span>
|
2026-03-23 18:32:07 +01:00
|
|
|
)}
|
feat: replace UI with design system example pages wired to real API
Migrate all page components from the @cameleer/design-system v0.0.3
example UI, replacing mock data with real backend API hooks. This brings
richer visuals (KpiStrip, GroupCard, RouteFlow, ProcessorTimeline,
DateRangePicker, expandable rows) while preserving all existing API
integration, auth, and routing infrastructure.
Pages migrated: Dashboard, RoutesMetrics, RouteDetail, ExchangeDetail,
AgentHealth, AgentInstance, OidcConfig, AuditLog, RBAC (Users/Groups/Roles).
Also enhanced LayoutShell CommandPalette with real search data from catalog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:42:16 +01:00
|
|
|
</>
|
2026-03-23 18:32:07 +01:00
|
|
|
);
|
|
|
|
|
}
|