Repository navigation
Isha - feat: add rental cost breakdown chart - #5704
Isha2303165 wants to merge 3 commits into
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
rahulrubugunday
left a comment
There was a problem hiding this comment.
I have reviewed your PR locally (e471881, backend on #2429) and it works as per requirement.
- BM Dashboard > Rental Cost Over Time: the Total Rental Cost line chart loads, with the "How Much of Tools Costs Are Due to Rentals" stacked bar chart below it showing owned and rented tool costs for Project 1, 2 and 3.
- Changing Project to Project 1 updated both charts, and the line points add up to the rented bar ($605.75).
- Setting From 05/01/2024 and To 08/31/2024 updated both charts (two points, rented bar $178.50).
- Money data labels show on both charts, and text, legends and axes are readable in both light and dark mode.
iAbhi001
left a comment
There was a problem hiding this comment.
I tested frontend PR #5704 locally at commit e471881 paired with backend PR #2429, but encountered a blocking data fetching issue on the Rental Cost Over Time dashboard. Navigating to /bmdashboard/rentalchart loads the filter controls, but both the line chart and the stacked bar chart fail to render, displaying an "Error loading rental cost chart data" screen. The underlying API calls fail to return a valid response with the local development dataset. Please verify that the frontend handles empty, missing, or unseeded rental records gracefully without crashing the view, and share instructions on any required local database seeding or fixtures needed to populate the charts. Requesting changes until the dashboard loads and displays data reliably in local testing environments.
|



Task:

Implement the BM Dashboard rental cost visualizations and connect them to backend APIs.
The page should include:
Total Rentals Cost Over Time
How Much of Tools Costs Are Due to Rentals?
The charts should work with the existing BM Dashboard styling and support both light and dark mode.
Description
Implements the frontend charts for displaying rental and tool costs in the BM Dashboard.
This PR adds API integration for the rental cost dashboard and introduces a stacked bar chart titled:
“How Much of Tools Costs Are Due to Rentals?”
The page now displays:
Implements # (WBS)
Related PRS (if any):
Backend: OneCommunityGlobal/HGNRest#2429
To test this frontend PR, checkout the related HGNRest backend PR #XXX.
Main changes explained:
RentalChart.jsxto integrate the new rental cost APIs.BarElementand bar chart rendering.src/utils/URL.js.How to test:
isha-rental-cost-breakdown-chartnpm installnpm startBM Dashboard → Rental Cost Over TimeScreenshots or videos of changes:
Note:
This PR depends on the related backend PR because the new charts consume:
/api/bm/rentals/cost-over-time/api/bm/tools/cost-breakdownThe existing
/api/bm/rentalChartendpoint remains in use for the current project/tool dropdown data.