mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
feat(ui): note in the add-member modal that search covers existing users only
Both fields select from a server-side search over existing accounts, so a typed-in address or id never becomes a value. Say so up front rather than letting the form look like it accepts a new user and fail on submit. Applies to the organization member modal too, which shares this component.
This commit is contained in:
parent
2a13bbe1cb
commit
48b3d18893
2 changed files with 19 additions and 1 deletions
|
|
@ -65,4 +65,14 @@ describe("UserSearchModal", () => {
|
|||
|
||||
expect(userFilterUICall).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("tells the user that only existing accounts can be selected", () => {
|
||||
renderModal();
|
||||
|
||||
const notice = screen.getByRole("alert");
|
||||
expect(notice).toHaveTextContent(/users that already exist/i);
|
||||
expect(notice).toHaveTextContent(/ask a proxy admin to create their account first/i);
|
||||
// info, not warning: a warning here would read as an error state on an empty form
|
||||
expect(notice.className).toMatch(/ant-alert-info/);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useState } from "react";
|
||||
import { Modal, Form, Button, Select, Tooltip } from "antd";
|
||||
import { Modal, Form, Button, Select, Tooltip, Alert } from "antd";
|
||||
import { UserAddOutlined } from "@ant-design/icons";
|
||||
import { useDebouncedCallback } from "@tanstack/react-pacer/debouncer";
|
||||
import { userFilterUICall } from "@/components/networking";
|
||||
|
|
@ -140,6 +140,14 @@ const UserSearchModal: React.FC<UserSearchModalProps> = ({
|
|||
role: defaultRole,
|
||||
}}
|
||||
>
|
||||
<Alert
|
||||
type="info"
|
||||
showIcon
|
||||
className="mb-4"
|
||||
message="Search selects from users that already exist. To add someone new, ask a proxy admin to create their account first."
|
||||
data-testid="member-existing-users-notice"
|
||||
/>
|
||||
|
||||
<Form.Item label="Email" name="user_email" className="mb-4">
|
||||
<Select
|
||||
showSearch
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue