From 13fcb52ceb399b3242c137e01a868e7f97805a22 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 09:18:15 +0000 Subject: [PATCH] feat(ui): migrate SSOSettings/RoleMappings to shadcn - antd Card/Divider/Table/Tag/Typography \u2192 shadcn Card/Separator/Table/ Badge + plain headings. - Inlines the table render columns since shadcn Table doesn't take a ColumnsType array. Gates: TS \u2713 | Vitest 4/4 \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../SSOSettings/RoleMappings.tsx | 114 ++++++++++-------- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git a/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/RoleMappings.tsx b/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/RoleMappings.tsx index 3750ee88183..8f4b77dd412 100644 --- a/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/RoleMappings.tsx +++ b/ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/RoleMappings.tsx @@ -1,73 +1,85 @@ import type { RoleMappings as RoleMappingsType } from "@/app/(dashboard)/hooks/sso/useSSOSettings"; -import { Card, Divider, Table, Tag, Typography } from "antd"; +import { Badge } from "@/components/ui/badge"; +import { Card } from "@/components/ui/card"; +import { Separator } from "@/components/ui/separator"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; import { Users } from "lucide-react"; import { defaultRoleDisplayNames } from "./constants"; -const { Title, Text } = Typography; -export default function RoleMappings({ roleMappings }: { roleMappings: RoleMappingsType | undefined }) { - if (!roleMappings) { - return null; - } +export default function RoleMappings({ + roleMappings, +}: { + roleMappings: RoleMappingsType | undefined; +}) { + if (!roleMappings) return null; - const roleMappingsColumns = [ - { - title: "Role", - dataIndex: "role", - key: "role", - render: (text: string) => {defaultRoleDisplayNames[text]}, - }, - { - title: "Mapped Groups", - dataIndex: "groups", - key: "groups", - render: (groups: string[]) => ( - <> - {groups.length > 0 ? ( - groups.map((group, index) => ( - - {group} - - )) - ) : ( - No groups mapped - )} - - ), - }, - ]; return ( - +
- - Role Mappings + +

Role Mappings

- Group Claim +
Group Claim
- {roleMappings.group_claim} + + {roleMappings.group_claim} +
- Default Role +
Default Role
- {defaultRoleDisplayNames[roleMappings.default_role]} + + {defaultRoleDisplayNames[roleMappings.default_role]} +
- - ({ - role, - groups, - }))} - pagination={false} - bordered - size="small" - className="w-full" - /> + +
+ + + Role + Mapped Groups + + + + {Object.entries(roleMappings.roles).map(([role, groups]) => ( + + + + {defaultRoleDisplayNames[role]} + + + + {groups.length > 0 ? ( +
+ {groups.map((group, index) => ( + + {group} + + ))} +
+ ) : ( + + No groups mapped + + )} +
+
+ ))} +
+
);