feat(projects): wire Projects list + create to the backend (MAPPS-126) #88
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mapps-126-wire-projects"
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?
What
Wires the Projects page (
src/pages/projects.rs) to the live projects API (PMS-51). It was hardcoded template:ProjectListPagerendered six fixed cards with fake progress bars + hardcoded stat cards, andProjectNewPagewas a decorative mock submit (theP1-041s timeout that never POSTed, with a hardcoded company dropdown).Closes MAPPS-126.
How
GET /api/v1/projectsand resolves company names fromGET /api/v1/contacts/companies. Each card shows the real status badge, a budget-utilization bar (actual_amount / budget_amount- the actuals PMS-51 now computes), target end date, and budget. The four stat cards (active / on hold / completed counts, total budget) are computed from the data; search + status filters run client-side. Loading / empty (no projects vs no matches) / load-failed states.ProjectNewPagenow does a realPOST /api/v1/projectswith a company picker from the live companies list, name validation, an error banner, and navigation to the list on success. Company is optional (omitscompany_idwhen unset), matching the server.Decimalfields come over the wire as JSON strings (verified:budget_amount="5000.00"), so money fields decode through a number-or-string-tolerant deserializer instead of a plainf64.ProjectCardcomponent and thegloo_timersmock-submit path.Verification
cargo fmt --checkclean;cargo clippy --target wasm32-unknown-unknown --all-targets -- -D warningsclean.GET /contacts/companies200,POST /projects200 (created + visible inGET /projects), confirming the decimal-as-string wire form. Test project cleaned up afterwards.Follow-up (not in this PR)
ProjectDetailPageandProjectTasksPageare still hardcoded; wire them againstGET /api/v1/projects/:id,/projects/:id/tasks,/projects/:id/phasesseparately.🤖 Generated with Claude Code