Skip to content

feat(admin): Add admin audit log tab to user details view#115405

Draft
dashed wants to merge 1 commit into
masterfrom
aleal/admin-user-audit-log-tab
Draft

feat(admin): Add admin audit log tab to user details view#115405
dashed wants to merge 1 commit into
masterfrom
aleal/admin-user-audit-log-tab

Conversation

@dashed
Copy link
Copy Markdown
Member

@dashed dashed commented May 12, 2026

Summary

  • Adds an "Admin Audit Log" section to the gsAdmin user details page, mirroring how PR #113943 added the same for customer/org details
  • Creates a UserAuditLog component that queries /audit-logs/ filtered by target_id (user ID) and event_prefix=User to show user-scoped admin actions: suspend, unsuspend, merge, reactivate, identity deletion, 2FA deletion
  • Surfaces the suspension audit logs added in getsentry#20159 directly in the admin user view

Changes

  • New: static/gsAdmin/components/users/userAuditLog.tsxUserAuditLog component using ResultGrid
  • New: static/gsAdmin/components/users/userAuditLog.spec.tsx — 6 tests
  • Modified: static/gsAdmin/views/userDetails.tsx — added import and section
  • Modified: static/gsAdmin/views/userDetails.spec.tsx — added mock and assertion

Dependencies

  • Companion backend PR: getsentry#20313 adds the event_prefix filter to the /audit-logs/ endpoint. Without it, the tab still works but may show non-user audit entries if org and user IDs collide.

Test plan

  • userAuditLog.spec.tsx — 6 tests pass (column headers, suspension entry rendering, null actor/ticket/notes fallbacks, multiple entries)
  • userDetails.spec.tsx — 7 tests pass (includes new assertion for "Admin Audit Log" section)
  • customerAuditLog.spec.tsx — 7 tests pass (no regression)

Add a UserAuditLog component and integrate it into the gsAdmin user
details page, mirroring how PR #113943 added CustomerAuditLog to the
customer details page.

The component queries /audit-logs/ with target_id (user ID) and
event_prefix=User to show user-scoped admin actions such as suspend,
unsuspend, merge, reactivate, and identity/2FA deletion.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.50% 93.50% ±0%
Typed 135,324 135,327 🟢 +3
Untyped 9,411 9,413 🔴 +2
🔍 2 new type safety issues introduced

any-typed symbols (2 new)

File Line Detail
static/gsAdmin/components/users/userAuditLog.tsx 18 data (param)
static/gsAdmin/components/users/userAuditLog.tsx 32 row (param)

This is informational only and does not block the PR.

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.

1 participant