feat(assets): edit-modal write surface for CMDB expansion fields (PMS-473) #328

Merged
YousifShkara merged 1 commit from feat/PMS-473-cmdb-asset-edit-fields into main 2026-06-24 10:38:52 +02:00
Owner

PMS-454 phase 1 added the CMDB asset expansion server-side (assigned_user_id, ip_address, hostname, mac_address, installed_date, department, in_transit_ticket_id columns + the new in_transit asset status) and an earlier client PR landed the read surface on the asset detail page. The edit modal was the open follow-up - agents had to set these fields through the API. PMS-473 closes that loop:

  • Seven new field signals (e_assigned_user, e_ip, e_hostname, e_mac, e_installed, e_department, e_in_transit) seed off the loaded asset on edit-open. Empty signals serialise to a JSON null in the PUT body so the server COALESCEs the column rather than rewriting it - a partial edit only sends what changed.

  • Form layout in the edit modal: an Assigned-user Select built from the already-cached users_resource (no extra /auth/users fetch); a hostname/IP row with a help line documenting the IPv4-or-IPv6 server validator; a MAC/Installed-date row; a free-text Department input; a free-text In-transit ticket UUID input. The grid layout matches the surrounding two-column shape so the existing dispatcher mental model keeps working.

  • The save handler appends assigned_user_id, ip_address, hostname, mac_address, installed_date, department, and in_transit_ticket_id to the body. The server-side validators stay the source of truth for value shape (INET / MAC / UUID FK) so a malformed value still 422s with a field-named hint.

The asset-list ?in_transit filter and a typeahead Ticket picker for the in-transit reference both stay as future follow-ups - the picker UI doesn't exist as a reusable primitive yet and a one-shot version would be its own scope.

#PMS-473

PMS-454 phase 1 added the CMDB asset expansion server-side (assigned_user_id, ip_address, hostname, mac_address, installed_date, department, in_transit_ticket_id columns + the new `in_transit` asset status) and an earlier client PR landed the read surface on the asset detail page. The edit modal was the open follow-up - agents had to set these fields through the API. PMS-473 closes that loop: * Seven new field signals (`e_assigned_user`, `e_ip`, `e_hostname`, `e_mac`, `e_installed`, `e_department`, `e_in_transit`) seed off the loaded asset on edit-open. Empty signals serialise to a JSON null in the PUT body so the server `COALESCE`s the column rather than rewriting it - a partial edit only sends what changed. * Form layout in the edit modal: an Assigned-user `Select` built from the already-cached `users_resource` (no extra `/auth/users` fetch); a hostname/IP row with a help line documenting the IPv4-or-IPv6 server validator; a MAC/Installed-date row; a free-text Department input; a free-text In-transit ticket UUID input. The grid layout matches the surrounding two-column shape so the existing dispatcher mental model keeps working. * The save handler appends `assigned_user_id`, `ip_address`, `hostname`, `mac_address`, `installed_date`, `department`, and `in_transit_ticket_id` to the body. The server-side validators stay the source of truth for value shape (INET / MAC / UUID FK) so a malformed value still 422s with a field-named hint. The asset-list `?in_transit` filter and a typeahead Ticket picker for the in-transit reference both stay as future follow-ups - the picker UI doesn't exist as a reusable primitive yet and a one-shot version would be its own scope. #PMS-473
feat(assets): edit-modal write surface for CMDB expansion fields (PMS-473)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 28m20s
4dbc7494d0
PMS-454 phase 1 added the CMDB asset expansion server-side (assigned_user_id, ip_address, hostname, mac_address, installed_date, department, in_transit_ticket_id columns + the new `in_transit` asset status) and an earlier client PR landed the read surface on the asset detail page. The edit modal was the open follow-up - agents had to set these fields through the API. PMS-473 closes that loop:

* Seven new field signals (`e_assigned_user`, `e_ip`, `e_hostname`, `e_mac`, `e_installed`, `e_department`, `e_in_transit`) seed off the loaded asset on edit-open. Empty signals serialise to a JSON null in the PUT body so the server `COALESCE`s the column rather than rewriting it - a partial edit only sends what changed.

* Form layout in the edit modal: an Assigned-user `Select` built from the already-cached `users_resource` (no extra `/auth/users` fetch); a hostname/IP row with a help line documenting the IPv4-or-IPv6 server validator; a MAC/Installed-date row; a free-text Department input; a free-text In-transit ticket UUID input. The grid layout matches the surrounding two-column shape so the existing dispatcher mental model keeps working.

* The save handler appends `assigned_user_id`, `ip_address`, `hostname`, `mac_address`, `installed_date`, `department`, and `in_transit_ticket_id` to the body. The server-side validators stay the source of truth for value shape (INET / MAC / UUID FK) so a malformed value still 422s with a field-named hint.

The asset-list `?in_transit` filter and a typeahead Ticket picker for the in-transit reference both stay as future follow-ups - the picker UI doesn't exist as a reusable primitive yet and a one-shot version would be its own scope.

#PMS-473
YousifShkara force-pushed feat/PMS-473-cmdb-asset-edit-fields from 4dbc7494d0
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 28m20s
to 1126d341da
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 16m7s
Create release / Create release from merged PR (pull_request) Has been skipped
2026-06-24 10:05:41 +02:00
Compare
YousifShkara deleted branch feat/PMS-473-cmdb-asset-edit-fields 2026-06-24 10:38:52 +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!328
No description provided.