feat(audit-log): show resolved names instead of UUIDs in the table + detail #107
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psa-systems/mokosh-apps!107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/audit-log-show-names"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The audit log table rendered an 8-char UUID prefix in both the "Entity ID" and "User" columns, and the expanded detail row dumped the full UUIDs again. Every other user-visible reference to an actor or a record in mokosh already uses resolved names (assigned_to_name on tickets, display_name() on calendar, user_name() on projects); the audit log was the last surface where end users saw a raw UUID.
Pairs with the mokosh-server patch (feat/audit-log-resolve-names) that adds
user_name: Option<String>andentity_name: Option<String>toAuditLogEntryResponse, computed server-side via a LEFT JOIN against users plus a CASE-per-entity-type subselect (companies/contacts/sites/contracts/contract_items/rate_cards/invoices/tickets/projects/assets/credential_vault/payment_gateway_configs/tax_rates, plus theauthsynthetic type whose entity_id is itself a user_id).SPA wiring:
AuditLogEntrygains the two new Option fields with#[serde(default)]so an older server build (pre-rename, before the JOIN ships) decodes cleanly and the UI falls back to the short-UUID rendering rather than failing to parse the response.entity_nameanduser_name.user_namefalls back to "System" when null (catches system-issued rows + JIT-created users whose name hasn't been onboarded yet);entity_namefalls back to the short-UUID prefix so a brand-new entity_type that doesn't have a server-side resolver row yet still gets SOMETHING the reader can correlate against.Net effect for the user: the audit log table now reads "yousif (Yousif Lastname) created ticket T000042 in tenant X" instead of "8abc12... created entity in tenant 4f3e2d...". The short UUID remains as a safety net for any entity_type the server doesn't yet resolve, and a small muted UUID sub-line in the detail view preserves the ability to chase a row through logs by id when debugging.