Skip to content

feat(users): Add suspension UI to gsAdmin user details#114354

Merged
dashed merged 5 commits intomasterfrom
aleal/feat/user-suspension-frontend
May 1, 2026
Merged

feat(users): Add suspension UI to gsAdmin user details#114354
dashed merged 5 commits intomasterfrom
aleal/feat/user-suspension-frontend

Conversation

@dashed
Copy link
Copy Markdown
Member

@dashed dashed commented Apr 29, 2026

Add Suspend/Unsuspend actions and Suspended badge to the gsAdmin user detail page so admins can manage user suspension from /_admin/users/:userId/.

Screenshot 2026-04-29 at 8 31 29 PM Screenshot 2026-04-29 at 8 32 10 PM Screenshot 2026-04-29 at 8 33 29 PM

Actions

  • "Suspend Account" — visible for active, non-suspended users. Calls PUT /api/0/users/{id}/ with {isSuspended: true}.
  • "Unsuspend Account" — visible for suspended users. Calls PUT /api/0/users/{id}/ with {isSuspended: false}.
  • "Reactivate Account" is hidden when a user is suspended, since only unsuspending should be offered first.

Status Display

The user overview shows "Suspended", "Active", or "Disabled". A red "Suspended" badge appears next to the user name (can coexist with the "Inactive" badge).

Depends on on #114349 and https://github.com/getsentry/getsentry/pull/20159 (backend logic), and #114328 (migration).

dashed and others added 3 commits April 29, 2026 18:13
Add Suspend/Unsuspend actions and Suspended badge to the gsAdmin user
detail page. Suspended users show a red "Suspended" badge and status.
The Reactivate Account action is hidden when a user is suspended, since
only unsuspending should be offered first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Suspend and unsuspend actions now call POST /_admin/users/{userId}/suspend/
instead of PUT /users/{userId}/, enabling admin audit log entries.
Audit params (notes, ticketURL) flow from the confirmation modal to the
endpoint. The suspend action shows a danger-priority confirm modal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dashed dashed force-pushed the aleal/feat/user-suspension-frontend branch from 8174148 to b55aac0 Compare April 29, 2026 22:16
@dashed dashed changed the base branch from aleal/feat/user-suspension-backend to master April 29, 2026 22:18
The commitAuthor and userDetails fixtures were missing the isSuspended
default, causing TypeScript errors since the User type requires boolean
but the Partial<User> spread made it boolean | undefined.
@dashed dashed marked this pull request as ready for review April 30, 2026 00:36
@dashed dashed requested a review from a team April 30, 2026 00:36
Comment thread static/gsAdmin/views/userDetails.tsx Outdated
The onError handler used `error.message ?? fallback`, but
RequestError.message is always a non-null string so the nullish
coalescing operator never reached the user-friendly fallback. Admin
users saw raw technical messages like "POST /…/suspend/ 500". Use the
hardcoded message directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@geoffg-sentry geoffg-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful

@dashed dashed merged commit e663ff3 into master May 1, 2026
64 checks passed
@dashed dashed deleted the aleal/feat/user-suspension-frontend branch May 1, 2026 17:28
cleptric pushed a commit that referenced this pull request May 5, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants