feat(assets): add add/delete credential UI to asset detail #245
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-231-asset-credential-add-delete"
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 Credentials card on the asset detail page rendered only a "Reveal" button per credential, so a technician could not add or remove an asset credential from the UI even though the vault endpoints support it. The server exposes create (POST /assets/{id}/credentials) and delete (DELETE /credentials/{id}); there is no update endpoint (the audit log records only credential_created / credential_deleted), so credentials are add/remove only and editing is intentionally out of scope.
Add an "Add" action in the Credentials card header that opens a modal posting name / type / username / password / optional url / optional notes to the create endpoint, validating a required, 100-char-capped Name and required type/username/password inline (mirroring the asset create/edit forms and the server's CreateCredentialRequest limits) and routing server-flagged name/url messages to their fields. Add a per-credential Delete button that opens the styled ConfirmDialog and fires the delete on confirm. Both actions refresh the credentials list and audit log on success.
#MAPPS-231
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
The Credentials card on the asset detail page rendered only a "Reveal" button per credential, so a technician could not add or remove an asset credential from the UI even though the vault endpoints support it. The server exposes create (POST /assets/{id}/credentials) and delete (DELETE /credentials/{id}); there is no update endpoint (the audit log records only credential_created / credential_deleted), so credentials are add/remove only and editing is intentionally out of scope. Add an "Add" action in the Credentials card header that opens a modal posting name / type / username / password / optional url / optional notes to the create endpoint, validating a required, 100-char-capped Name and required type/username/password inline (mirroring the asset create/edit forms and the server's CreateCredentialRequest limits) and routing server-flagged name/url messages to their fields. Add a per-credential Delete button that opens the styled ConfirmDialog and fires the delete on confirm. Both actions refresh the credentials list and audit log on success. #MAPPS-231 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>