From adff4ccf871d25ae3d8e5ee081c52e0288e5be91 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Wed, 19 Aug 2026 15:25:30 -0700 Subject: [PATCH] refactor(ui): move the invite user modal onto the shared Dialog antd renders no OK button when footer is null, so onOk could never fire and is dropped rather than carried over. The antd import stays for Typography, so the file keeps its no-restricted-imports suppression --- .../src/components/CreateUserButton.tsx | 201 +++++++++--------- 1 file changed, 100 insertions(+), 101 deletions(-) diff --git a/ui/litellm-dashboard/src/components/CreateUserButton.tsx b/ui/litellm-dashboard/src/components/CreateUserButton.tsx index a57ea763b6c..c5bbef3ee17 100644 --- a/ui/litellm-dashboard/src/components/CreateUserButton.tsx +++ b/ui/litellm-dashboard/src/components/CreateUserButton.tsx @@ -6,12 +6,13 @@ import { FormField } from "@/components/shared/form/FormField"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; +import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Textarea } from "@/components/ui/textarea"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; import { Alert, AlertDescription, AlertTitle } from "@/components/shared/Alert"; -import { Modal, Typography } from "antd"; +import { Typography } from "antd"; import { ChevronRight, CircleHelp, Info, UserPlus } from "lucide-react"; import React, { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; @@ -328,110 +329,108 @@ export const CreateUserButton: React.FC = ({ - setIsModalVisible(false)} - onCancel={handleCancel} - > -
-

Create a User who can own keys

- -
- -
- - {userEmailField} - {roleField( - labelWithHint( - "Global Proxy Role", - "This role is independent of any team/org specific roles. Configure Team / Organization Admins in the Settings", - ), - )} - {teamField} - - - {({ id, value, onChange }) => ( - + !open && handleCancel()}> + + + Invite User + +
+

Create a User who can own keys

+ +
+ + + + {userEmailField} + {roleField( + labelWithHint( + "Global Proxy Role", + "This role is independent of any team/org specific roles. Configure Team / Organization Admins in the Settings", + ), )} -
+ {teamField} - {metadataField} - {sendInviteEmailField} + + {({ id, value, onChange }) => ( + + )} + - - - - Personal Key Creation - - - - {({ value, onChange }) => ( - ({ label: getModelDisplayName(model), value: model })), - ]} - value={value ?? []} - onValueChange={onChange} - placeholder="Select models" - /> - )} - - - -
+ {metadataField} + {sendInviteEmailField} -
- -
-
-
-
+ + + + Personal Key Creation + + + + {({ value, onChange }) => ( + ({ label: getModelDisplayName(model), value: model })), + ]} + value={value ?? []} + onValueChange={onChange} + placeholder="Select models" + /> + )} + + + + + +
+ +
+ + + + {apiuser && (