5c952d6716bbefe423def557f724c2e3c0c335e5
Original task
-------------
The admin Audit Log row for a user.delete entry showed
"Target: user #1234 · @ahmed" — i.e. the @username — even though
admins recognise people by name. Surface displayNameEn / displayNameAr
in that line and fall back to @username only when no display name
exists.
Backend
-------
artifacts/api-server/src/routes/users.ts
The user.delete handler already persists `displayNameEn` and
`displayNameAr` in audit metadata (added in commit 2c4655b). No
code change was needed on the API side. Verified the metadata
shape via the existing audit-log-coverage test.
Frontend
--------
artifacts/tx-os/src/pages/admin.tsx
- Renamed `forceDeletedEntityName` to `deletedEntityName` and
updated the doc-comment.
- Relaxed its gate so it returns a name not only for force-delete
entries but also for plain `user.delete` entries. Other delete
actions (app.delete, group.delete) still gate on force-delete
to avoid changing behaviour outside this task's scope.
- Updated the single call-site to use the new function name.
Effect: a non-force user.delete row now renders a "Target: user
#1234 · Ahmed Al-Saleh" line beneath the summary, with locale-aware
fallback (Ar -> En -> @username).
Verification
------------
- pnpm api-spec codegen + tx-os tsc --noEmit: clean.
- artifacts/api-server `node --test` for audit-log-coverage,
audit-logs-actor-filter, audit-logs-forced-only-filter,
audit-logs-target-filter: 43 / 43 tests pass (CSV export tests
included).
- e2e test via runTest: created a user with displayName
"Ahmed Test User" / "أحمد مستخدم", deleted without force,
opened /#section=audit-log, and confirmed the new row's
summary plus the secondary "Target: user #19630 · أحمد مستخدم"
line render correctly (admin's Arabic locale was honoured).
Description
No description provided
Languages
TypeScript
69.4%
JavaScript
29%
CSS
0.6%
Shell
0.6%
Dockerfile
0.2%
Other
0.2%