fix(tickets): humanise FK column names in change-history field labels #267

Merged
vas2000-work merged 1 commit from fix/pms-370-humanize-history-field-labels into main 2026-06-16 23:49:30 +02:00
Owner

PMS-359 added inline-edit dropdowns for Status, Priority and Assigned To and routed each change through the existing ticket audit snapshot path. The per-record history feed derives its field labels straight from the changed JSON column keys, so the FK columns (status_id, priority_id, assigned_to_id) leaked into the rendered labels as Updated: Status id, Updated: Priority id, Updated: Assigned to id.

Strip a trailing _id suffix and replace underscores with spaces at the history read boundary (From<HistoryRow> for EntityHistoryEntry) via a single humanize_field helper. The stored audit rows still record the exact column that changed; only the rendered label is cleaned up, so any future FK field inherits the fix without a client change. The raw field_changes writer (asset audit log) is untouched and keeps storing exact column names.

Adds a humanize_field unit test and a Postgres-backed integration test that performs an inline Status edit and asserts the history row carries the humanised status field, never status_id.

#PMS-370

PMS-359 added inline-edit dropdowns for Status, Priority and Assigned To and routed each change through the existing ticket audit snapshot path. The per-record history feed derives its `field` labels straight from the changed JSON column keys, so the FK columns (`status_id`, `priority_id`, `assigned_to_id`) leaked into the rendered labels as `Updated: Status id`, `Updated: Priority id`, `Updated: Assigned to id`. Strip a trailing `_id` suffix and replace underscores with spaces at the history read boundary (`From<HistoryRow> for EntityHistoryEntry`) via a single `humanize_field` helper. The stored audit rows still record the exact column that changed; only the rendered label is cleaned up, so any future FK field inherits the fix without a client change. The raw `field_changes` writer (asset audit log) is untouched and keeps storing exact column names. Adds a `humanize_field` unit test and a Postgres-backed integration test that performs an inline Status edit and asserts the history row carries the humanised `status` field, never `status_id`. #PMS-370
fix(tickets): humanise FK column names in change-history field labels
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 36s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 1m4s
Integration / integration tests (pull_request) Successful in 2m50s
Create release / Create release from merged PR (pull_request) Has been skipped
a7565fedc9
PMS-359 added inline-edit dropdowns for Status, Priority and Assigned To and routed each change through the existing ticket audit snapshot path. The per-record history feed derives its `field` labels straight from the changed JSON column keys, so the FK columns (`status_id`, `priority_id`, `assigned_to_id`) leaked into the rendered labels as `Updated: Status id`, `Updated: Priority id`, `Updated: Assigned to id`.

Strip a trailing `_id` suffix and replace underscores with spaces at the history read boundary (`From<HistoryRow> for EntityHistoryEntry`) via a single `humanize_field` helper. The stored audit rows still record the exact column that changed; only the rendered label is cleaned up, so any future FK field inherits the fix without a client change. The raw `field_changes` writer (asset audit log) is untouched and keeps storing exact column names.

Adds a `humanize_field` unit test and a Postgres-backed integration test that performs an inline Status edit and asserts the history row carries the humanised `status` field, never `status_id`.

#PMS-370
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!267
No description provided.