Skip to content

fix(ui): allow changing team organization from team settings - #25095

Merged
ryan-crabbe-berri merged 2 commits into
litellm_ryan-march-31from
litellm_fix-ui-update-org-teams
Apr 3, 2026
Merged

fix(ui): allow changing team organization from team settings#25095
ryan-crabbe-berri merged 2 commits into
litellm_ryan-march-31from
litellm_fix-ui-update-org-teams

Conversation

@ryan-crabbe-berri

@ryan-crabbe-berri ryan-crabbe-berri commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the disabled read-only Organization ID input on the Team Settings page with a searchable Select dropdown populated from the organizations list
  • Admins (proxy, team, org) can now assign, reassign, or unassign a team's organization directly from the UI
  • Clearing the dropdown sends an empty string to the backend, which correctly unsets the organization_id

Screenshots

Screenshot 2026-04-03 at 11 59 51 AM

Test plan

  • As a proxy admin, open a team's Settings tab and verify the Organization dropdown appears
  • Select an organization and save — verify the team is now associated with that org
  • Clear the organization and save — verify the team is unassigned from the org
  • Re-save without changes — verify no errors (idempotent)
  • As a team admin, verify the dropdown is editable in the settings tab

@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 3, 2026 7:17pm

Request Review

@greptile-apps

greptile-apps Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the disabled read-only Organization ID Input on the Team Settings page with an interactive allowClear Select dropdown, allowing admins to assign, reassign, or clear a team's organization from the UI. The update payload logic was also refined to only include organization_id when the value has actually changed (using a strict equality check against the current info.organization_id), and empty-string is sent to the backend when the field is cleared — aligning with the existing backend unset path.

Key changes:

  • Form.Item now renders a searchable Select (Ant Design) populated from useOrganizations, replacing the disabled Input
  • allowClear and showSearch with optionFilterProp=\"label\" provide a clean UX for selection
  • Dirty-check guard values.organization_id !== info.organization_id avoids sending an unnecessary organization_id field on idempotent saves
  • The ?? \"\" fallback converts undefined (Ant Design allowClear emits undefined) to \"\" for the backend's unset path

The change is well-scoped and the payload logic handles all cases correctly: no change (null === null → skip), cleared from existing org (undefined !== \"org-id\" → send \"\"), and new selection (\"new-id\" !== null → send new ID). One caveat worth knowing (covered in prior review threads): userOrganizations is scoped to the calling user's org memberships, so team admins who aren't org members will see an empty dropdown with no assignable options.

Confidence Score: 5/5

Safe to merge; the dirty-check and null-coalescing logic are correct for all assignment/clear/no-op paths.

No P0 or P1 issues were found. The payload guard correctly skips the field on idempotent saves, and ?? "" correctly triggers the backend unset path when the dropdown is cleared. All previously raised concerns in review threads have been addressed or are pre-existing UX limitations of useOrganizations scope.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/team/TeamInfo.tsx Replaces disabled Organization ID Input with a searchable Select dropdown; adds a dirty-check guard so organization_id is only sent when it changes; logic handles all null/undefined/string transitions correctly.

Sequence Diagram

sequenceDiagram
    participant U as User (Admin)
    participant UI as TeamInfo Form
    participant UO as useOrganizations Hook
    participant API as LiteLLM Proxy API

    UO->>API: GET /organization/list
    API-->>UO: [{ organization_id, organization_alias }]
    UO-->>UI: userOrganizations[]

    U->>UI: Click "Edit Settings"
    UI->>UI: form.initialValues { organization_id: info.organization_id }

    alt Select new org
        U->>UI: Pick org from dropdown
        UI->>UI: form value = "new-org-id"
    else Clear existing org
        U->>UI: Click allowClear X
        UI->>UI: form value = undefined
    else No change
        U->>UI: Submit unchanged
        UI->>UI: values.org === info.org, skip field
    end

    U->>UI: Submit form
    UI->>UI: values.organization_id !== info.organization_id?
    alt Changed
        UI->>API: PATCH /team/update { organization_id: value ?? "" }
        API-->>UI: Updated team
    else Unchanged
        UI->>API: PATCH /team/update (no organization_id field)
        API-->>UI: Updated team
    end
Loading

Reviews (2): Last reviewed commit: "fix(ui): only send organization_id when ..." | Re-trigger Greptile

Comment thread ui/litellm-dashboard/src/components/team/TeamInfo.tsx Outdated
Comment thread ui/litellm-dashboard/src/components/team/TeamInfo.tsx
@ryan-crabbe-berri
ryan-crabbe-berri temporarily deployed to integration-postgres April 3, 2026 19:16 — with GitHub Actions Inactive
@ryan-crabbe-berri
ryan-crabbe-berri temporarily deployed to integration-postgres April 3, 2026 19:16 — with GitHub Actions Inactive
@ryan-crabbe-berri
ryan-crabbe-berri temporarily deployed to integration-postgres April 3, 2026 19:16 — with GitHub Actions Inactive
@ryan-crabbe-berri
ryan-crabbe-berri temporarily deployed to integration-postgres April 3, 2026 19:16 — with GitHub Actions Inactive
@ryan-crabbe-berri
ryan-crabbe-berri temporarily deployed to integration-redis-postgres April 3, 2026 19:16 — with GitHub Actions Inactive
@ryan-crabbe-berri
ryan-crabbe-berri merged commit 20077fe into litellm_ryan-march-31 Apr 3, 2026
52 of 58 checks passed
@ryan-crabbe-berri
ryan-crabbe-berri deleted the litellm_fix-ui-update-org-teams branch April 3, 2026 23:07
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…rg-teams

fix(ui): allow changing team organization from team settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant