[Feature] UI - Team Settings: Soft Budget + Alerting Emails#20634
[Feature] UI - Team Settings: Soft Budget + Alerting Emails#20634yuneng-jiang merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile OverviewGreptile Summary
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/package.json | Switches Next dev script from --turbo to --webpack; no functional app code changes but alters local dev behavior. |
| ui/litellm-dashboard/tsconfig.json | Changes TSX emit from jsx: preserve to react-jsx, which can affect tooling/build expectations; no direct runtime code changes. |
| ui/litellm-dashboard/src/components/mcp_tools/MCPPermissionManagement.test.tsx | Updates tests to select the first switch via getAllByRole('switch')[0]; fixes ambiguity but introduces a brittle index-based selector. |
| ui/litellm-dashboard/src/components/mcp_tools/mcp_servers.test.tsx | Expands networking mocks to include additional functions required by MCPServers tests; appears consistent with component dependencies. |
| ui/litellm-dashboard/src/components/team/team_info.test.tsx | Adds tests for soft budget + alert emails display; file contains a duplicate vi.mock() for the same module which can cause brittle behavior. |
| ui/litellm-dashboard/src/components/team/team_info.tsx | Adds soft budget field + alerting emails UI, and includes them in update payload; ensure soft_budget is normalized/coerced consistently with other numeric budget fields. |
Sequence Diagram
sequenceDiagram
participant U as User (Dashboard)
participant T as TeamInfoView
participant API as Backend API
U->>T: Open Team Settings
T->>API: teamInfoCall(accessToken, teamId)
API-->>T: TeamData(team_info, metadata)
T-->>U: Render Settings view (soft_budget + alert emails)
U->>T: Click "Edit Settings"
T-->>U: Prefill form
Note over T: soft_budget from team_info
Note over T: soft_budget_alerting_emails from metadata[]
U->>T: Enter soft budget + comma-separated emails
U->>T: Click "Save Changes"
T->>T: Parse metadata JSON
T->>T: Split/trim/filter emails
T->>API: teamUpdateCall(accessToken, updateData)
API-->>T: 200 OK
T-->>U: Success + refresh
T->>API: teamInfoCall(accessToken, teamId)
| it("should default allow_all_keys switch to unchecked for new servers", async () => { | ||
| renderWithForm(); | ||
| await expandPanel(); | ||
| const toggle = screen.getByRole("switch"); | ||
| // Find the switch associated with "Allow All LiteLLM Keys" text | ||
| // The first switch in the component is for allow_all_keys | ||
| const switches = screen.getAllByRole("switch"); | ||
| const toggle = switches[0]; | ||
| expect(toggle).toHaveAttribute("aria-checked", "false"); |
There was a problem hiding this comment.
Brittle switch selection
These tests assume getAllByRole("switch")[0] is the allow_all_keys control. If another switch is added/reordered in MCPPermissionManagement, the test will silently start asserting the wrong switch. Prefer selecting the switch by accessible name/label (e.g., getByRole('switch', { name: /allow all litellm keys/i })) so the test stays aligned with the UI.
Additional Comments (2)
This file mocks |
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
✅ Test
Changes
Adds soft budget and soft budget alerting emails fields to the team settings UI. Users can now set a soft budget value and configure comma-separated email addresses to receive alerts when the soft budget is reached. The soft budget and alerting emails are displayed in the team settings view and can be edited through the settings form.
Screenshots