Amaan taking over for Juhitha-Reddy create injury trend chart - #4063
Amaan taking over for Juhitha-Reddy create injury trend chart#4063Juhitha-Reddy wants to merge 17 commits into
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Hi Juhitha,
I tried to review your PR locally but i was unable to, i did assume that the issue is due to old db.js file but even when i replaced it with the latest db.js file, the error disappeared. Also in dark mode the greyed out title and axis points are not visible, especially the dark grey titles.






Screen.Recording.2026-03-02.at.10.32.27.PM.movTested locally and fixed merge conflicts. |
There was a problem hiding this comment.
Hi Juhitha,
I have re-reviewed your PR locally and i believe the code is breaking:
Issue 1: The UI is misaligned

Issue 2: When the dates are unselected the error toast notification appears

**Issue 3: There is no data in the chart, i even checked the backend and once i did the post injuries api and get api for the trend data, there is still no change in the graph **




|
Hi @Anusha-Gali, Can you please re-review the changes? The changes are working as expected in my local Screen.Recording.2026-04-05.at.9.59.19.PM.mov |
Anusha-Gali
left a comment
There was a problem hiding this comment.
Hi Juhitha,
Thanks for the update, i have reviewed your PR again and am able to view the graph data; however the toast notification on clearing the dates still exists. Could you look into it. Maybe a different warning message or default dates in backend.
4063.mov
|
hi, |
@rithika-paii @Anusha-Gali
I have shared a screenshot of how my local is working. Could you please verify again in the netwrok tab or share the screenshot of the network tab to see if we are pointing it to the right environment.
Thank you!
|
|
|
kunchalasireesha
left a comment
There was a problem hiding this comment.
Hi Juhitha, it looks like this PR currently has merge conflicts with the base branch. Could you please rebase or merge the latest changes from development into your branch and resolve the conflicts? Once the build passes, I’ll finish the review.
amaresh2001
left a comment
There was a problem hiding this comment.
Tested locally on Juhitha_Create_Injury_Trend_Chart
Testing:
- Chart loads and displays injury trend data correctly
- Multi-line chart renders with correct color coding (Serious/red, Medium/orange, Low/green)
- Line Chart ↔ Bar Chart toggle works correctly
- Project dropdown filter updates the chart as expected
- Date range filter works and updates the chart correctly
- Dark mode is fully supported, text, labels, and charts adapt correctly
Issue:
Filter control alignment is off. The "Project" label sits at the top, the "All Projects" dropdown sits lower.
AmaanSyed09
left a comment
There was a problem hiding this comment.
Tested locally following the PR instructions.
-
Checked out both frontend and backend branches, rebuilt the backend, and ran the application locally.
-
Verified the Injury Tracking page loads successfully from the BM Dashboard navigation.
-
Tested project filtering with multiple projects. Projects containing injury records displayed the expected injury trend data, while projects without injury records correctly displayed empty results.
-
Tested date range filtering and confirmed the chart updates based on the selected date range.
-
Verified the Line Chart view renders injury trends correctly across severity levels (Serious, Medium, Low).
-
Verified the Bar Chart toggle displays the same underlying data correctly and updates as expected.
-
Tested the feature in both light mode and dark mode and confirmed chart visibility, labels, legends, filters, and controls render properly.
-
Verified tooltip values match the displayed chart data.
-
Checked browser console during testing. The only messages observed were existing Reactstrap deprecation warnings related to defaultProps (attached screenshot). No blocking console errors or functionality issues related to this PR were encountered.
Functionality works as expected. Approving.
akv-iu
left a comment
There was a problem hiding this comment.
Hey @Juhitha-Reddy ,
Test Summary
Tested backend frontend PR #4063 with PR #1723 .
Verified:
- The Page loads correctly with all the data and works consistent both in Dark and Light theme [Addressed one problem in backend PR]
Concern:
- The alignment of the project filter is off. and Dropdown also has 2 arrows.
|
Merged the latest development branch into this PR, resolved the merge conflict in |
kzou55
left a comment
There was a problem hiding this comment.
Hi Amaan,
I ran and tested the PR locally alongside the associated backend.
Verified
- Chart has legend and shows 3 categories(serious, medium, and low), each with a different color
- X label shows month, Y label shows number of injuries
- Project and Date filters work
- Dark Mode looks good
Recording.2026-07-20.193907.mp4
Issues
-
Start Date and End Date can be better aligned with the Project dropdown filter
-
"All Project" filter results inconsistent with the sum of all the other projects. When filtered by "All Projects" it shows some data for injuries. Yet, when I actually choose all the different projects, the individual project's injuries aren't summing up to the total.
Recording.2026-07-20.193355.mp4
|
Addressed the reviewer feedback for PR #4063 and the associated backend PR.
|
PR.4063.demo.mov |
kzou55
left a comment
There was a problem hiding this comment.
Hi Amaan
I ran and tested the Pr locally again alongside its associated backend.
Verified
Issues
-
The main component has some extra/blank extended space at the end
-
Is there a reason you swapped from using project id rather than project name? Right now in the backend, in PR 1723, it only supports project id rather than name.
And I think the reason why the result returns the same thing it doesn't handle project name, meaning it would just default to http://localhost:4500/api/bm/injuries/trend-data?startDate="xxx"&endDate="xxx" As it always return serious = 12, medium = 2, low = 4. Basically treating it the search as All Projects from the specified start and end date.
|
|
Addressed the requested changes. Fixed the Injury Trend layout by removing the unnecessary blank vertical space below the chart while preserving the existing responsive layout and chart behavior. Verified that the available data for the selected date range (2026-01-28 to 2026-07-28). Building 1 contains injury records for that range, while Commercial Test - Project, Residential Test - Project, Housing Project, and Solar Panel Project do not, so those projects correctly return zero values for the selected period. ready for re-review. |
























Frontend PR — Injury Trend Line Chart (Phase 2)
Description
Implements the “Injury Trend Over Time” line chart for Phase 2 Summary Dashboard. Adds Project and Date range filters, dark mode styling, and responsive layout. Integrates with backend APIs to fetch monthly injury counts by severity.
Implements #Phase2-InjuryTrend
Related PRs (if any):
This frontend PR relies on the backend Injury APIs. Please test with the backend PR below.
Main changes explained:
InjuryTrendChartcomponent with Recharts multi-line chart:{ months, serious, medium, low }to chart data#1B2A41)How to test:
npm installREACT_APP_APIENDPOINT=http://localhost:4500/apinpm startnpm run build && node dist/server.js(ornpm run dev)bmdashboard/injurychart.Screenshots or videos of changes:
Screen.Recording.2025-09-12.at.1.01.13.PM.mov
Note: