mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
fix(ui): rename Customer Portal to Customer Management (#51891)
* fix(ui): rename Customer Portal to Customer Management Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * fix(ui): polish Customer Management product copy Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * style(ui): format Customer Management test assertions Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
This commit is contained in:
parent
745886e5ff
commit
61483d8f04
12 changed files with 44 additions and 38 deletions
|
|
@ -553,7 +553,7 @@ async def _register_organization(
|
|||
if isinstance(registered, Failure):
|
||||
if registered.code is ErrorCode.FREE_TIER_LIMIT:
|
||||
verbose_proxy_logger.warning(
|
||||
"CUSTOMER TRACKING OFF for organization %s because the free customer portal limit was reached. "
|
||||
"CUSTOMER TRACKING OFF for organization %s because the Customer Management free tier limit was reached. "
|
||||
"Upgrade to Enterprise to remove the limits: https://www.litellm.ai/enterprise",
|
||||
customer_org_alias,
|
||||
)
|
||||
|
|
@ -620,7 +620,7 @@ async def _register_member(
|
|||
if isinstance(registered, Failure):
|
||||
if registered.code is ErrorCode.FREE_TIER_LIMIT:
|
||||
verbose_proxy_logger.warning(
|
||||
"CUSTOMER TRACKING OFF for member %s because the free customer portal limit was reached. "
|
||||
"CUSTOMER TRACKING OFF for member %s because the Customer Management free tier limit was reached. "
|
||||
"Upgrade to Enterprise to remove the limits: https://www.litellm.ai/enterprise",
|
||||
customer_member_id,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -54,13 +54,13 @@ _ERROR_DETAILS: Final[Mapping[ErrorCode, tuple[int, str, str]]] = MappingProxyTy
|
|||
{
|
||||
ErrorCode.CAPACITY_BUSY: (
|
||||
503,
|
||||
"Customer portal busy",
|
||||
"Customer portal capacity is being updated. Retry the request.",
|
||||
"Customer Management busy",
|
||||
"Customer Management capacity is being updated. Retry the request.",
|
||||
),
|
||||
ErrorCode.FREE_TIER_LIMIT: (
|
||||
403,
|
||||
"Free customer portal limit reached",
|
||||
"Free customer portal limit reached: up to 5 customer organizations, 5 teams per organization and "
|
||||
"Customer Management free tier limit reached",
|
||||
"Customer Management free tier limit reached: up to 5 customer organizations, 5 teams per organization and "
|
||||
"5 members per team without a LiteLLM Enterprise license. Upgrade to Enterprise to remove the limits: "
|
||||
"https://www.litellm.ai/enterprise",
|
||||
),
|
||||
|
|
@ -213,7 +213,8 @@ AuthCache: TypeAlias = Annotated[UserApiKeyCache, Depends(get_user_api_key_cache
|
|||
@router.get(
|
||||
"/customer_portal/limits",
|
||||
response_model=CustomerPortalLimits,
|
||||
description="Get customer portal free-tier limits and current capacity. Proxy admins only.",
|
||||
summary="Get Customer Management Limits",
|
||||
description="Get Customer Management free-tier limits and current capacity. Proxy admins only.",
|
||||
)
|
||||
@management_endpoint_wrapper
|
||||
async def get_customer_portal_limits(
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ beforeEach(() => {
|
|||
creations.push(await request.json());
|
||||
if (freeTierReached)
|
||||
return Response.json(
|
||||
{ detail: "Free customer portal limit reached. Upgrade to Enterprise." },
|
||||
{ detail: "Customer Management free tier limit reached. Upgrade to Enterprise." },
|
||||
{ status: 403 },
|
||||
);
|
||||
return rejectCreation
|
||||
|
|
@ -65,7 +65,7 @@ describe("CreateCustomerDialog", () => {
|
|||
fireEvent.click(screen.getByRole("button", { name: "Create customer" }));
|
||||
await waitFor(() =>
|
||||
expect(toast.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("Free customer portal limit reached. Upgrade to Enterprise."),
|
||||
expect.stringContaining("Customer Management free tier limit reached. Upgrade to Enterprise."),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -164,7 +164,9 @@ describe("CreateCustomerHierarchyDialog", () => {
|
|||
});
|
||||
|
||||
it.each(["team", "member"] as const)("surfaces the free-tier 403 detail when creating a %s", async (kind) => {
|
||||
fetchMock.mockResolvedValue(json({ detail: "Free customer portal limit reached. Upgrade to Enterprise." }, 403));
|
||||
fetchMock.mockResolvedValue(
|
||||
json({ detail: "Customer Management free tier limit reached. Upgrade to Enterprise." }, 403),
|
||||
);
|
||||
render(
|
||||
<CreateCustomerHierarchyDialog
|
||||
kind={kind}
|
||||
|
|
@ -178,7 +180,7 @@ describe("CreateCustomerHierarchyDialog", () => {
|
|||
fireEvent.change(screen.getByRole("textbox", { name: "Display name" }), { target: { value: "Example" } });
|
||||
fireEvent.click(screen.getByRole("button", { name: "Create" }));
|
||||
expect(await screen.findByRole("alert")).toHaveTextContent(
|
||||
"Free customer portal limit reached. Upgrade to Enterprise.",
|
||||
"Customer Management free tier limit reached. Upgrade to Enterprise.",
|
||||
);
|
||||
expect(onOpenChange).not.toHaveBeenCalled();
|
||||
expect(onCreated).not.toHaveBeenCalled();
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ describe("CustomerHierarchySettings", () => {
|
|||
/>
|
||||
</CustomersLayout>,
|
||||
);
|
||||
expect(await screen.findByRole("alert")).toHaveTextContent("Free customer portal limit reached");
|
||||
expect(await screen.findByRole("alert")).toHaveTextContent("Customer Management free tier limit reached");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Delete customer member" }));
|
||||
const dialog = await screen.findByRole("dialog", { name: "Delete customer member" });
|
||||
fireEvent.change(within(dialog).getByPlaceholderText("member-1"), { target: { value: "member-1" } });
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ afterEach(() => {
|
|||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
describe("Customer portal limits", () => {
|
||||
describe("Customer Management limits", () => {
|
||||
it.each([
|
||||
{ limitsApply: true, reached: false },
|
||||
{ limitsApply: true, reached: true },
|
||||
|
|
@ -50,7 +50,7 @@ describe("Customer portal limits", () => {
|
|||
expect(screen.queryByText(/Free tier:/)).not.toBeInTheDocument();
|
||||
}
|
||||
if (limitsApply && reached) {
|
||||
expect(await screen.findByRole("alert")).toHaveTextContent("Free customer portal limit reached");
|
||||
expect(await screen.findByRole("alert")).toHaveTextContent("Customer Management free tier limit reached");
|
||||
expect(screen.getByRole("alert")).toHaveTextContent(
|
||||
"Requests from new customers or members still go through but are not tracked",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -106,23 +106,23 @@ describe("ViewSwitcher", () => {
|
|||
expect(assignSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should open the Customer Portal at the customers page and come back to the gateway", async () => {
|
||||
it("should open Customer Management at the customers page and come back to the gateway", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderSwitcher();
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "Switch workspace, current: AI Gateway" }));
|
||||
await user.click(await screen.findByRole("menuitem", { name: /Customer Portal/ }));
|
||||
await user.click(await screen.findByRole("menuitem", { name: /Customer Management/ }));
|
||||
expect(pushMock).toHaveBeenCalledWith("/ui/customers");
|
||||
expect(assignSpy).not.toHaveBeenCalled();
|
||||
expect(localStorage.getItem("litellm_plugin_mode")).toBeNull();
|
||||
});
|
||||
|
||||
it("should route back to the gateway from Customer Portal mode instead of only flipping the mode", async () => {
|
||||
it("should route back to the gateway from Customer Management mode instead of only flipping the mode", async () => {
|
||||
localStorage.setItem("litellm_plugin_mode", "customer-portal");
|
||||
const user = userEvent.setup();
|
||||
renderSwitcher();
|
||||
|
||||
await user.click(await screen.findByRole("button", { name: "Switch workspace, current: Customer Portal" }));
|
||||
await user.click(await screen.findByRole("button", { name: "Switch workspace, current: Customer Management" }));
|
||||
await user.click(await screen.findByRole("menuitem", { name: /^AI Gateway/ }));
|
||||
expect(pushMock).toHaveBeenCalledWith("/ui/api-keys");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ describe("Sidebar (leftnav)", () => {
|
|||
expect(screen.getByRole("link", { name: /litellm home/i })).toHaveAttribute("href", "/ui");
|
||||
});
|
||||
|
||||
it("should make customer organizations reachable from the Customer Portal sidebar", () => {
|
||||
it("should make customer organizations reachable from the Customer Management sidebar", () => {
|
||||
localStorage.setItem("litellm_plugin_mode", "customer-portal");
|
||||
navState.pathname = "/ui/customers/manage";
|
||||
renderWithProviders(
|
||||
|
|
@ -765,14 +765,17 @@ describe("Sidebar (leftnav)", () => {
|
|||
describe("getBreadcrumb", () => {
|
||||
it("should identify the customer organizations list and its hierarchy routes", () => {
|
||||
expect(getBreadcrumb("/ui/customers/usage")).toEqual({
|
||||
section: "Customer Portal",
|
||||
section: "Customer Management",
|
||||
title: "Customer organizations",
|
||||
});
|
||||
expect(getBreadcrumb("/ui/customers/manage")).toEqual({
|
||||
section: "Customer Portal",
|
||||
section: "Customer Management",
|
||||
title: "Customer organizations",
|
||||
});
|
||||
expect(getBreadcrumb("/ui/customers/")).toEqual({
|
||||
section: "Customer Management",
|
||||
title: "Customer organizations",
|
||||
});
|
||||
expect(getBreadcrumb("/ui/customers/")).toEqual({ section: "Customer Portal", title: "Customer organizations" });
|
||||
});
|
||||
it("resolves a top-level route to its section + title", () => {
|
||||
expect(getBreadcrumb("/ui/api-keys")).toEqual({ section: "AI Gateway", title: "Virtual Keys" });
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ export const visibleMenuGroups = (groups: readonly MenuGroup[], context: MenuVis
|
|||
// icons changed to lucide as part of the sidebar redesign.
|
||||
const customerPortalGroups: MenuGroup[] = [
|
||||
{
|
||||
groupLabel: "CUSTOMER PORTAL",
|
||||
groupLabel: "CUSTOMER MANAGEMENT",
|
||||
items: [
|
||||
{
|
||||
key: "customers",
|
||||
|
|
@ -531,7 +531,7 @@ const findMenuItemKey = (route: string): string => {
|
|||
|
||||
const GROUP_LABELS: Record<string, ParseKeys> = {
|
||||
"AI GATEWAY": "shell.nav.groups.aiGateway",
|
||||
"CUSTOMER PORTAL": "shell.nav.groups.customerPortal",
|
||||
"CUSTOMER MANAGEMENT": "shell.nav.groups.customerPortal",
|
||||
OBSERVABILITY: "shell.nav.groups.observability",
|
||||
"ACCESS CONTROL": "shell.nav.groups.accessControl",
|
||||
"DEVELOPER TOOLS": "shell.nav.groups.developerTools",
|
||||
|
|
@ -543,7 +543,7 @@ export const groupText = (groupLabel: string): string =>
|
|||
|
||||
const SECTION_DISPLAY: Record<string, ParseKeys> = {
|
||||
"AI GATEWAY": "shell.nav.sections.aiGateway",
|
||||
"CUSTOMER PORTAL": "shell.nav.sections.customerPortal",
|
||||
"CUSTOMER MANAGEMENT": "shell.nav.sections.customerPortal",
|
||||
OBSERVABILITY: "shell.nav.sections.observability",
|
||||
"ACCESS CONTROL": "shell.nav.sections.accessControl",
|
||||
"DEVELOPER TOOLS": "shell.nav.sections.developerTools",
|
||||
|
|
|
|||
|
|
@ -8164,7 +8164,7 @@
|
|||
"accessControl": "ACCESS CONTROL",
|
||||
"developerTools": "DEVELOPER TOOLS",
|
||||
"settings": "SETTINGS",
|
||||
"customerPortal": "CUSTOMER PORTAL"
|
||||
"customerPortal": "CUSTOMER MANAGEMENT"
|
||||
},
|
||||
"sections": {
|
||||
"aiGateway": "AI Gateway",
|
||||
|
|
@ -8172,7 +8172,7 @@
|
|||
"accessControl": "Access Control",
|
||||
"developerTools": "Developer Tools",
|
||||
"settings": "Settings",
|
||||
"customerPortal": "Customer Portal"
|
||||
"customerPortal": "Customer Management"
|
||||
},
|
||||
"items": {
|
||||
"home": "Home",
|
||||
|
|
@ -20672,15 +20672,15 @@
|
|||
},
|
||||
"limits": {
|
||||
"byline": "Free tier: up to 5 customers, 5 teams per customer, 5 members per team. LiteLLM <enterprise>Enterprise</enterprise> removes these limits.",
|
||||
"reachedTitle": "Free customer portal limit reached",
|
||||
"reachedDescription": "New customers, teams and members can't be created. Requests from new customers or members still go through but are not tracked in the customer portal.",
|
||||
"reachedTitle": "Customer Management free tier limit reached",
|
||||
"reachedDescription": "New customers, teams and members can't be created. Requests from new customers or members still go through but are not tracked in Customer Management.",
|
||||
"upgrade": "Upgrade to Enterprise"
|
||||
},
|
||||
"hierarchy": {
|
||||
"customerNavigation": "Customer navigation",
|
||||
"usage": "Usage",
|
||||
"manage": "Manage",
|
||||
"title": "Customer management",
|
||||
"title": "Customer Management",
|
||||
"subtitle": "Manage customer teams, customer members, and settings for this customer organization.",
|
||||
"teamSubtitle": "Manage customer members and settings for this customer team.",
|
||||
"memberSubtitle": "Manage settings and budget for this customer member.",
|
||||
|
|
@ -20778,7 +20778,7 @@
|
|||
"deleteInformationTitle": "{{kind}} details"
|
||||
},
|
||||
"switcher": {
|
||||
"label": "Customer Portal",
|
||||
"label": "Customer Management",
|
||||
"description": "Customer organizations and usage"
|
||||
},
|
||||
"status": {
|
||||
|
|
|
|||
4
litellm/ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
4
litellm/ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
|
|
@ -9934,8 +9934,8 @@ export interface paths {
|
|||
cookie?: never;
|
||||
};
|
||||
/**
|
||||
* Get Customer Portal Limits
|
||||
* @description Get customer portal free-tier limits and current capacity. Proxy admins only.
|
||||
* Get Customer Management Limits
|
||||
* @description Get Customer Management free-tier limits and current capacity. Proxy admins only.
|
||||
*/
|
||||
get: operations["get_customer_portal_limits_management_v1_customer_portal_limits_get"];
|
||||
put?: never;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ def test_customer_portal_limits_and_free_tier_problem(premium: bool) -> None:
|
|||
assert sixth.status_code == (201 if premium else 403), sixth.text
|
||||
if not premium:
|
||||
assert sixth.json()["detail"] == (
|
||||
"Free customer portal limit reached: up to 5 customer organizations, 5 teams per organization and "
|
||||
"Customer Management free tier limit reached: up to 5 customer organizations, 5 teams per organization and "
|
||||
"5 members per team without a LiteLLM Enterprise license. Upgrade to Enterprise to remove the limits: "
|
||||
"https://www.litellm.ai/enterprise"
|
||||
)
|
||||
|
|
@ -161,9 +161,9 @@ def test_capacity_contention_is_retryable_without_hiding_other_database_errors(e
|
|||
assert response.status_code == 503, response.text
|
||||
assert response.json() == {
|
||||
"type": "urn:litellm:error:customer-hierarchy-capacity-busy",
|
||||
"title": "Customer portal busy",
|
||||
"title": "Customer Management busy",
|
||||
"status": 503,
|
||||
"detail": "Customer portal capacity is being updated. Retry the request.",
|
||||
"detail": "Customer Management capacity is being updated. Retry the request.",
|
||||
}
|
||||
assert http.get("/management/v1/customer_members/blocked").status_code == 404
|
||||
|
||||
|
|
@ -197,9 +197,9 @@ def test_team_model_write_contention_is_retryable_and_rolls_back(error: DataErro
|
|||
assert response.status_code == 503, response.text
|
||||
assert response.json() == {
|
||||
"type": "urn:litellm:error:customer-hierarchy-capacity-busy",
|
||||
"title": "Customer portal busy",
|
||||
"title": "Customer Management busy",
|
||||
"status": 503,
|
||||
"detail": "Customer portal capacity is being updated. Retry the request.",
|
||||
"detail": "Customer Management capacity is being updated. Retry the request.",
|
||||
}
|
||||
assert http.get("/management/v1/customer_teams/blocked").status_code == 404
|
||||
assert not database.litellm_budgettable.rows
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue