Aayush create line chart showing total injuries over time frontend#3995
Aayush create line chart showing total injuries over time frontend#3995aayushshetty12 wants to merge 20 commits intodevelopmentfrom
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ShradhaMBhadrannavar
left a comment
There was a problem hiding this comment.
Issue: Graph doesn’t render and filters don’t populate or affect results.
Steps:
npm install → npm run start:local
Cleared cache/site data, logged in as Admin
Navigate to /bmdashboard/injuriesovertimechart/
Expected: graph visible; filters show options and update results
Actual: graph area blank; filters show no options / no effect on change
Please address and let me know when to retest.
|
Tested this PR along with Backend PR #1687. |
bhanuanishakkineni
left a comment
There was a problem hiding this comment.
Hello Aayush,
I have tested this PR's frontend and backend. Please find the requested changes from backend PR#1687.
Apart from that, the chart is working fine in both light and dark mode and is responsive. Filters are working fine. But below are the UI issues I identified.
In the dark mode, increase the filters text contrast as it is hard to read them.
While changing projects filter, that is while adding or removing projects from the filter, the lines from the graph are changing colors which is a bit confusing. Please look into it and assign fixed color to the projects.
Also, in smaller screen sizes (mobile) its date selector is going out of window and is not able to choose dates from previous months.

PR.3995+.1687.mp4
…l-injuries-over-time-frontend
0773ec3
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Vikas-8055
left a comment
There was a problem hiding this comment.
Hi Aayush, I tested this PR locally along with backend PR #1687. Similar to other reviewers, I am also not able to see any projects and the page displays "No Data Available"
Shravan-neelamsetty
left a comment
There was a problem hiding this comment.
Hi @aayushshetty12, I have tested this PR locally by checking out the aayush-create-line-chart-showing-total-injuries-over-time-frontend branch and navigating to /bmdashboard/injuriesovertimechart. The page loads successfully and displays the title "Injuries over time (Jan 1 2024 - Dec 31 2024)" along with all filter dropdowns (Projects, Start date, End date, Injury Types, Departments, Severity) which render correctly and are functional. However, the chart area displays "No Data Available" and no line chart is rendered
Ganesh112001
left a comment
There was a problem hiding this comment.
I tested the Injuries Over Time line chart feature which consists of frontend PR #3995 on the aayush-create-line-chart-showing-total-injuries-over-time-frontend branch and backend PR #1687. After checking out both branches, installing dependencies, and starting both servers, I logged in as admin and navigated to /bmdashboard/injuriesovertimechart. However, the line chart does not display any data despite the page loading correctly. The chart area renders but remains empty with no injury data points visible. I tested all five filters (Project, Date, Type, Department, Severity) but none populate the chart with data. This suggests either the backend is not returning data, the API endpoint is not working correctly, or there's a data fetching issue between frontend and backend. I verified dark mode styling works for the empty chart container, and no console errors were observed. The feature cannot be fully verified until the data display issue is resolved.

roshini1212
left a comment
There was a problem hiding this comment.
Hi Aayush,
Tested PR #3995 locally on branch aayush-create-line-chart-showing-total-injuries-over-time-frontend. The /bmdashboard/injuriesovertimechart page loads correctly, but there are no options in the dropdown box and also I am getting "No Data Available".
|
Hi @aayushshetty12 , video1372896020.mp4Suggestion: it would be helpful if the UI visually distinguished selected filter values (similar to how projects are differentiated by line color on the chart). Currently, when multiple values are selected under Injury Type/Department/Severity, it’s not clear which count maps to which selection. For instance, in the attached image I selected Fall and Slip, but the displayed numbers don’t indicate which one is Fall vs Slip. Could we add labels for the selected filter values?
|
| department: selDepts, | ||
| severity: selSeverities, | ||
| }), | ||
| ).finally(() => setLoading(false)); |
There was a problem hiding this comment.
There's no .catch() block, so if the API call fails the loading spinner will stop but the user sees nothing — no error message, no empty state explanation.
|
|
||
| return ( | ||
| <div className={`${styles.wrapper} ${darkMode ? styles.wrapperDark : ''}`}> | ||
| <h2 className={styles.title}>Injuries over time (Jan 1 2024 - Dec 31 2024)</h2> |
There was a problem hiding this comment.
The title is hardcoded but the component has a dynamic dateRange filter. The title should reflect the actual selected range
| const [selSeverities, setSelSeverities] = useState([]); | ||
|
|
||
| useEffect(() => { | ||
| setLoading(true); |
| useEffect(() => { | ||
| setLoading(true); | ||
| dispatch( | ||
| fetchInjuriesOverTime({ |
There was a problem hiding this comment.
Tested the chart filter flow, and the filter UI looks added properly, but the selected values are dispatched as projectId, date, injuryType, department, and severity, while the API action reads projectIds, startDate, endDate, types, departments, and severities. I also see the severity block writing into params.departments instead of a severity param. Filter request mapping could be checked if the selected filters are not being serialized correctly for the API call in this flow.
…me-frontend' of https://github.com/OneCommunityGlobal/HighestGoodNetworkApp into aayush-create-line-chart-showing-total-injuries-over-time-frontend
|
























Description
Related PRS (if any):
This frontend PR is related to the #1687 backend PR.
…
Main changes explained:
…
How to test:
npm installand...to run this PR locallyScreenshots or videos of changes:
demo.mp4