feat(assets): edit asset with change history and edited marker (PMS-185) #109

Merged
longjacksonle merged 1 commit from feat/mapps-185-asset-edit-history into main 2026-06-11 04:06:19 +02:00

What

Implements PMS-185: a user can open an asset's full detail, edit it, and see a change history with an "edited" marker (who / when).

Changes

  • Asset detail page gains an Edit button (on the Asset Information card) that opens a modal pre-seeded with the asset's current values. Saving issues PUT /api/v1/assets/{id} and restarts the asset + history resources so the page reflects the change without a reload.
  • The existing audit feed is reworked into a Change History card: action codes are humanized ("Updated", "Status changed", ...), the actor id is resolved to a display name via /auth/users (no more bare UUIDs), and timestamps show date + time.
  • An "Edited {when} by {who}" marker is shown on the Asset Information card whenever the asset has been modified since creation (updated_at strictly after created_at), sourced from the most recent audit entry.

Backend

None required. update_asset already writes an asset_audit_log row in the same transaction as the mutation, and GET /assets/{id}/audit-log already exposes the history.

Acceptance criteria

  • A user can open an asset's full detail and edit it.
  • Edits persist via the asset update endpoint and write an asset_audit_log entry.
  • The asset shows an "edited" marker (who / when).
  • The change history is viewable from the asset detail view.

🤖 Generated with Claude Code

## What Implements PMS-185: a user can open an asset's full detail, edit it, and see a change history with an "edited" marker (who / when). ## Changes - Asset detail page gains an **Edit** button (on the Asset Information card) that opens a modal pre-seeded with the asset's current values. Saving issues `PUT /api/v1/assets/{id}` and restarts the asset + history resources so the page reflects the change without a reload. - The existing audit feed is reworked into a **Change History** card: action codes are humanized ("Updated", "Status changed", ...), the actor id is resolved to a display name via `/auth/users` (no more bare UUIDs), and timestamps show date + time. - An **"Edited {when} by {who}"** marker is shown on the Asset Information card whenever the asset has been modified since creation (`updated_at` strictly after `created_at`), sourced from the most recent audit entry. ## Backend None required. `update_asset` already writes an `asset_audit_log` row in the same transaction as the mutation, and `GET /assets/{id}/audit-log` already exposes the history. ## Acceptance criteria - [x] A user can open an asset's full detail and edit it. - [x] Edits persist via the asset update endpoint and write an `asset_audit_log` entry. - [x] The asset shows an "edited" marker (who / when). - [x] The change history is viewable from the asset detail view. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(assets): edit asset from detail with change history and edited marker (PMS-185)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m17s
Create release / Create release from merged PR (pull_request) Has been skipped
b08fe9c183
Add an Edit affordance to the asset detail page so a user can open an asset's full detail and update its fields (name, tag, type, status, manufacturer, model, serial, purchase/warranty dates) via PUT /assets/{id}. The backend already writes an asset_audit_log row on every update, so the existing detail audit feed now renders as a "Change History" card with humanized action labels, resolved actor names (via /auth/users instead of bare UUIDs), and full timestamps. An "Edited {when} by {who}" marker appears on the Asset Information card whenever the asset has changed since creation, sourced from the most recent audit entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/mapps-185-asset-edit-history 2026-06-11 04:06:19 +02:00
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-apps!109
No description provided.