fix: move footfall dashboard into /rwa-admin with sidebar#9
fix: move footfall dashboard into /rwa-admin with sidebar#9
Conversation
Integrates FootfallCard, TrainerAttendanceCard, and BookingFeed into the proper /rwa-admin page (with sidebar) replacing the placeholder. Scopes stat queries to the active center. Removes the orphaned /rwa standalone page that had no layout or navigation. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
This PR migrates the footfall dashboard from a standalone /rwa page without layout to the proper /rwa-admin page with sidebar navigation. The changes integrate footfall widgets (FootfallCard, TrainerAttendanceCard, BookingFeed) into the RWA Admin dashboard and scope all stat queries to the active center for data correctness. The orphaned standalone /rwa/page.tsx is removed.
Changes:
- Deletes the standalone
/rwa/page.tsxdashboard page (42 lines) - Adds new
getCenter()function to/rwa-admin/page.tsxto fetch the active center - Refactors
getStats()to acceptcenterIdparameter and scopes amenity booking and trainer attendance queries to the center - Integrates FootfallCard, TrainerAttendanceCard, and BookingFeed components with proper
centerIdpassing - Updates dashboard header to display center name and formatted date dynamically
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/rwa/page.tsx | Deleted — orphaned standalone page without layout or navigation |
| app/rwa-admin/page.tsx | Integrated footfall dashboard components with sidebar, added center retrieval, refactored stats queries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| prisma.equipmentAsset.count({ | ||
| where: { condition: { in: ["FAIR", "POOR"] } }, | ||
| }), | ||
| prisma.serviceRequest.count({ | ||
| where: { status: { in: ["OPEN", "ASSIGNED"] } }, | ||
| }), |
There was a problem hiding this comment.
According to the PR description, "Scopes all stat queries to the active center (centerId) for correctness." However, the equipmentAsset and serviceRequest count queries are missing the centerId filter. These models have centerId fields in the schema (EquipmentAsset line 120, ServiceRequest line 210), so these stats will display data from all centers instead of just the active center. Add centerId to the where clause for both queries to maintain data isolation.
Summary
FootfallCard,TrainerAttendanceCard, andBookingFeedinto the proper/rwa-adminpage (with sidebar) instead of the orphaned/rwastandalone routecenterId) for correctnessapp/rwa/page.tsx— a no-layout, no-nav dead-end that served no purpose post-PR feat: replace FootfallEvent with AmenityBooking + RWA dashboard widgets #8main(post PR feat: replace FootfallEvent with AmenityBooking + RWA dashboard widgets #8 merge)Test plan
/rwa-admin— confirm sidebar is present and footfall widgets load/rwa(bare) returns 404 — old page is goneMade with Cursor