Skip to content

Surface admin import-log view in user actions#135

Merged
SiteRelEnby merged 1 commit into
mainfrom
admin-import-log-view
Jun 12, 2026
Merged

Surface admin import-log view in user actions#135
SiteRelEnby merged 1 commit into
mainfrom
admin-import-log-view

Conversation

@SiteRelEnby

@SiteRelEnby SiteRelEnby commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Surfaces the existing admin import-job view in the admin UI. The backend endpoints (list a user's import jobs + a reason-gated, audited detail view) and their client functions already shipped; this wires them into the per-user admin panel so support can actually read an import's event log when debugging a failed import.

Changes

  • Adds an ImportLogsSection to the per-user "Explain account" panel (next to Sessions), modelled on the existing SessionsSection pattern.
  • Lists the user's import jobs (source, status, timestamp, error flag). For any one, a required-reason inline prompt fetches and renders the full event log (level / stage / message / record_ref) inline.
  • Viewing a job writes the existing import_log_view audit row (already shown in the admin audit log and the user's own "admin activity on your account" card). On success it refreshes the panel's recent-activity list so the access shows immediately.

Testing

  • ruff check sheaf/ passes (no backend changes)
  • cd web && npm run lint && npx tsc --noEmit passes (zero errors in the touched files)
  • Existing tests pass (no backend changes; the admin endpoints have their own coverage)
  • New tests added (frontend wiring of already-tested endpoints)
  • Tested manually

Security / privacy impact

Article 9 data. The detail view is the existing reason-gated, admin-only endpoint that writes an import_log_view audit row, so reading a user's import history stays transparent to that user. Import events carry only structural data (counts, stages, source ids), never decrypted member content. No new endpoint and no new data exposure; this is UI wiring of an already-audited backend.

Screenshots

Inline addition to the existing admin Users > Explain account expander (an "Import jobs" list with per-job "View logs"); no standalone screen.

The admin import-job endpoints (list + reasoned, audited detail view) and their client functions already existed but weren't surfaced. Adds an ImportLogsSection to the per-user Explain-account panel, next to Sessions and reusing the same pattern: lists a user's import jobs and, on a required reason, shows the full event log inline. Each view writes the existing import_log_view audit row (shown in the audit log and the user's own 'admin activity' card) and refreshes the panel's recent-activity list on success.
@SiteRelEnby SiteRelEnby enabled auto-merge June 12, 2026 00:07
@SiteRelEnby SiteRelEnby disabled auto-merge June 12, 2026 01:54
@SiteRelEnby SiteRelEnby merged commit e734317 into main Jun 12, 2026
4 checks passed
@SiteRelEnby SiteRelEnby deleted the admin-import-log-view branch June 12, 2026 01:55
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