feat(assets): wire Assets list, create, detail (CMDB) to the backend (MAPPS-129) #92

Merged
longjacksonle merged 1 commit from feat/mapps-129-wire-assets into main 2026-06-07 06:58:56 +02:00

What

Wires the Assets page (src/pages/assets.rs) to the CMDB API (PMS-71). It was hardcoded template: fixed "Exchange Server 01 / Acme Corp" list rows, a decorative mock New Asset submit, and a detail page of fake System Information (hostname/IP/OS/CPU), Recent Alerts, Related Tickets, and RMM Integration that the API doesn't provide.

Closes MAPPS-129.

How

  • List (/assets): GET /api/v1/assets, with type names from /asset-types and company names from /contacts/companies. Real table (name, type, company, serial/tag, status badge), client-side name/serial search, loading/empty/failed states.
  • New (/assets/new): real POST /api/v1/assets with type + company pickers from the live lists and the fields the API has (name, type, company, serial, manufacturer, model, warranty). Dropped the location/notes inputs (no API column).
  • Detail (/assets/:id): GET /api/v1/assets/:id for the info + status sidebar, plus the CMDB surfaces - relationships, configuration items, credentials, and the audit log. Config items and credentials render as secret-free summaries; each row has a Reveal button that calls the audited single-item endpoint (GET /configuration-items/:id, GET /credentials/:id) on demand and shows the decrypted value inline. This matches the PMS-71 model: lists never carry secrets, and every reveal is server-recorded. The fake System Information / Alerts / Related Tickets / RMM cards are gone.

Dependencies / notes

  • The Reveal buttons depend on PMS-71 (#128) - the reveal endpoints - being merged and the server rebuilt. Until then they 404 (the rest of the page works).
  • Creating asset types is admin-gated server-side; a non-admin session can list/view but needs an admin to seed types before assets can be created.

Stacked on #88 / #89 / #91

Built on the MAPPS-126/127/128 projects branch. Until those merge, this PR's diff also shows their changes. Merge #88, #89, #91 first, then this.

Verification

  • cargo fmt --check clean; cargo clippy --target wasm32-unknown-unknown --all-targets -- -D warnings clean.
  • Live: GET /assets and /asset-types -> 200; confirmed /credentials/:id reveal 404s on the current (pre-#128) server, i.e. the dependency is real.

🤖 Generated with Claude Code

## What Wires the Assets page (`src/pages/assets.rs`) to the CMDB API (PMS-71). It was hardcoded template: fixed "Exchange Server 01 / Acme Corp" list rows, a decorative mock New Asset submit, and a detail page of fake System Information (hostname/IP/OS/CPU), Recent Alerts, Related Tickets, and RMM Integration that the API doesn't provide. Closes MAPPS-129. ## How - **List** (`/assets`): `GET /api/v1/assets`, with type names from `/asset-types` and company names from `/contacts/companies`. Real table (name, type, company, serial/tag, status badge), client-side name/serial search, loading/empty/failed states. - **New** (`/assets/new`): real `POST /api/v1/assets` with type + company pickers from the live lists and the fields the API has (name, type, company, serial, manufacturer, model, warranty). Dropped the location/notes inputs (no API column). - **Detail** (`/assets/:id`): `GET /api/v1/assets/:id` for the info + status sidebar, plus the CMDB surfaces - relationships, configuration items, credentials, and the audit log. Config items and credentials render as **secret-free summaries**; each row has a **Reveal** button that calls the audited single-item endpoint (`GET /configuration-items/:id`, `GET /credentials/:id`) on demand and shows the decrypted value inline. This matches the PMS-71 model: lists never carry secrets, and every reveal is server-recorded. The fake System Information / Alerts / Related Tickets / RMM cards are gone. ## Dependencies / notes - The **Reveal** buttons depend on **PMS-71 (#128)** - the reveal endpoints - being merged and the server rebuilt. Until then they 404 (the rest of the page works). - Creating asset **types** is admin-gated server-side; a non-admin session can list/view but needs an admin to seed types before assets can be created. ## Stacked on #88 / #89 / #91 Built on the MAPPS-126/127/128 projects branch. Until those merge, this PR's diff also shows their changes. **Merge #88, #89, #91 first, then this.** ## Verification - `cargo fmt --check` clean; `cargo clippy --target wasm32-unknown-unknown --all-targets -- -D warnings` clean. - Live: `GET /assets` and `/asset-types` -> 200; confirmed `/credentials/:id` reveal 404s on the current (pre-#128) server, i.e. the dependency is real. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(assets): wire Assets list, create, and detail (CMDB) to the backend (MAPPS-129)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 44s
Create release / Create release from merged PR (pull_request) Has been skipped
bbc90486bb
The Assets page was hardcoded template: the list rendered fixed "Exchange Server 01 / Acme Corp" rows, the New Asset form was a decorative mock submit (P1-04 timeout, hardcoded type/company dropdowns), and the detail page showed fake System Information (hostname/IP/OS/CPU), Recent Alerts, Related Tickets, and RMM Integration that the API does not provide. The CMDB backend is live (PMS-71), so all three surfaces are now wired.

AssetListPage fetches GET /api/v1/assets and resolves asset-type names from GET /api/v1/asset-types and company names from GET /api/v1/contacts/companies, rendering a real table (name, type, company, serial/tag, status badge) with client-side name/serial search and loading/empty/failed states.

AssetNewPage replaces the mock submit with a real POST /api/v1/assets: type + company pickers from the live lists, plus the fields the API actually has (name, type, company, serial, manufacturer, model, warranty). The location/notes inputs were dropped (no API column). Validates name/type/company, shows an error banner, and navigates to the list on success.

AssetDetailPage fetches GET /api/v1/assets/:id for the asset info + status sidebar, and renders the CMDB surfaces: relationships (/assets/:id/relationships), configuration items and credentials (/assets/:id/configuration-items, /assets/:id/credentials) as secret-free summaries, and the audit log (/assets/:id/audit-log). Each config item / credential row has a Reveal button that calls the audited single-item reveal endpoint (GET /configuration-items/:id, GET /credentials/:id) on demand and shows the decrypted value inline - matching the PMS-71 model where lists never carry secrets and every reveal is server-recorded. The fake System Information / Recent Alerts / Related Tickets / RMM cards are gone.

Verified the read endpoints against the dev stack (GET /assets, /asset-types -> 200). Note: creating asset types is admin-gated, and the Reveal buttons depend on PMS-71 (#128, the reveal endpoints) being merged + deployed.

Stacked on the MAPPS-126/127/128 projects PRs (#88/#89/#91); merge those first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/mapps-129-wire-assets 2026-06-07 06:58:56 +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!92
No description provided.