Add Save and Remove mutation wiring to UserOverridesList

What does this MR do and why?

Wire up the Save button in UserOverridesList using the UpsertUserBudgetCapOverrides GraphQL mutation. Admins can now edit per-user AI credit cap overrides directly from the table and persist changes.

MR series

# MR Status
1

Add UserOverridesList component with data fetching and pagination

✅ Merged
2

Replace JSON output with GlTableLite in UserOverridesList

✅ Merged
3 Add Save and Remove mutation wiring to UserOverridesList ➡️ This MR

Screenshots or screen recordings

Before After
N/A Screenshot_2026-09-02_at_03.13.55
N/A Screenshot_2026-09-02_at_03.15.19

How to set up and validate locally

Prerequisites: self-managed GitLab instance with the Credits Dashboard enabled.

  1. Enable SM instance.
  2. Open /-/graphql-explorer and find some user Global IDs:
query {
  users {
    nodes {
      id
      name
      username
    }
  }
}
  1. Create a per-user cap override for the found users (you can use gid://gitlab/User/1 for admin):
mutation ($overrides: UpsertUserBudgetCapOverridesInput!) {
  upsertUserBudgetCapOverrides(input: $overrides) {
    userOverrides {
      cap
      capEnabled
      user { username }
    }
    errors
  }
}

with variables:

{
  "overrides": {
    "overrides": [
      {
        "userId": "gid://gitlab/User/1",
        "cap": 20,
        "enabled": true
      }
    ]
  }
}
  1. Open http://localhost:3000/admin/gitlab_credits_dashboard/credit_caps.
  2. Verify that override rows appear in the table with editable cap input and enabled toggle.
  3. Change the cap value or toggle, click Save, and verify:
    • A success toast appears.
    • The button shows a loading spinner while the request is in flight.
    • Inputs are disabled during save.
  4. To test error handling, temporarily make the mutation return an error (e.g., edit input min=0 to min=-100 and pass a negative value) and verify an inline error alert appears beneath the row.

Alternatively, via Storybook:

  1. Start Storybook: yarn storybook:start
  2. Verify these stories work:

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

References

Edited by Kos Palchyk

Merge request reports

Loading
Loading