The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Change Bulk Invite User Roles to match backend (#16906)
yuneng-jiangf56c7e1ef9ae
diff --git a/ui/litellm-dashboard/src/components/bulk_create_users_button.test.tsx b/ui/litellm-dashboard/src/components/bulk_create_users_button.test.tsxnew file mode 100644index 00000000000..7397eaa6b24--- /dev/null+++ b/ui/litellm-dashboard/src/components/bulk_create_users_button.test.tsx@@ -0,0 +1,28 @@+import { render } from "@testing-library/react";+import { describe, it, expect, vi } from "vitest";+import BulkCreateUsersButton from "./bulk_create_users_button";++vi.mock("./networking", () => ({+ userCreateCall: vi.fn(),+ invitationCreateCall: vi.fn(),+ getProxyUISettings: vi.fn().mockResolvedValue({+ PROXY_BASE_URL: null,+ PROXY_LOGOUT_URL: null,+ DEFAULT_TEAM_DISABLED: false,+ SSO_ENABLED: false,+ }),+}));++vi.mock("./molecules/notifications_manager", () => ({+ default: {+ success: vi.fn(),+ fromBackend: vi.fn(),+ },+}));++describe("BulkCreateUsersButton", () => {+ it("should render", () => {+ const { getByText } = render(<BulkCreateUsersButton accessToken="test-token" teams={[]} possibleUIRoles={null} />);+ expect(getByText("+ Bulk Invite Users")).toBeInTheDocument();+ });+});diff --git a/ui/litellm-dashboard/src/components/bulk_create_users_button.tsx b/ui/litellm-dashboard/src/components/bulk_create_users_button.tsxindex 981683cf541..d34b14ceabf 100644--- a/ui/litellm-dashboard/src/components/bulk_create_users_button.tsx+++ b/ui/litellm-dashboard/src/components/bulk_create_users_button.tsx@@ -210,7 +210,7 @@ const BulkCreateUsersButton: React.FC<BulkCreateUsersProps> = ({errors.push("Role is required");} else {// Validate user role- const validRoles = ["proxy_admin", "proxy_admin_view_only", "internal_user", "internal_user_view_only"];+ const validRoles = ["proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer"];if (!validRoles.includes(user.user_role)) {errors.push(`Invalid role "${user.user_role}". Must be one of: ${validRoles.join(", ")}`);}@@ -587,8 +587,8 @@ const BulkCreateUsersButton: React.FC<BulkCreateUsersProps> = ({<div><p className="font-medium">user_role</p><p className="text-sm text-gray-600">- User's role (one of: "proxy_admin", "proxy_admin_view_only",- "internal_user", "internal_user_view_only")+ User's role (one of: "proxy_admin", "proxy_admin_viewer",+ "internal_user", "internal_user_viewer")</p></div></div>