feat(admin): Add admin audit log tab to user details view#115405
Draft
dashed wants to merge 1 commit into
Draft
Conversation
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.
Contributor
📊 Type Coverage Diff
🔍 2 new type safety issues introduced
This is informational only and does not block the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UserAuditLogcomponent that queries/audit-logs/filtered bytarget_id(user ID) andevent_prefix=Userto show user-scoped admin actions: suspend, unsuspend, merge, reactivate, identity deletion, 2FA deletionChanges
static/gsAdmin/components/users/userAuditLog.tsx—UserAuditLogcomponent usingResultGridstatic/gsAdmin/components/users/userAuditLog.spec.tsx— 6 testsstatic/gsAdmin/views/userDetails.tsx— added import and sectionstatic/gsAdmin/views/userDetails.spec.tsx— added mock and assertionDependencies
event_prefixfilter 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)