Skip to content

Gayatri -fix: add committed hours stats to total org summary - #2388

Merged
one-community merged 2 commits into
developmentfrom
gayatri/fix-weekly-committed-hours-be
Oct 10, 2026
Merged

one-community merged 2 commits into
developmentfrom
gayatri/fix-weekly-committed-hours-be

Conversation

@sawantgayatri19

Copy link
Copy Markdown

Description

Screenshot 2026-10-08 at 3 06 29 AM

Fixes the blank "Weekly Committed Hours" chart on Total Org Summary, which showed "TOTAL VOLUNTEERS 0" and no chart on both Current Week and Previous Week.

Fixes # (bug list priority urgent: P1 Total Org Summary "Weekly Committed Hours" chart is blank)

The frontend chart reads volunteerCommittedHoursStats from the volunteer stats API, but the backend never returned that field, so the chart always received no data. The original backend implementation (commit cd8f5e9 on saisandeep_fix_incorrect_volunteer_hours_backend) was never merged into development.

Related PRS (if any):

This backend PR is related to frontend PR #5623 (hours bucket labels).
To test this backend PR, check out frontend PR #5623. The chart also renders with frontend development, but the bucket labels are only correct with #5623.

Main changes explained:

  • src/helpers/overviewReportHelper.js: added getCommittedHoursStats(), which groups active volunteers (committed hours ≥ 1, role not Mentor, the same population as the Active Volunteers card) by weeklycommittedHours into buckets '10', '20', '30', '40', '40+'. Bucket ids are upper limits ('10' = 1–10 hrs, '20' = 11–20, '30' = 21–30, '40' = 31–40, '40+' = over 40), matching the frontend labels.
  • src/controllers/reportsController.js: calls the new helper and returns volunteerCommittedHoursStats in the response.
  • Compared with cd8f5e9: volunteers committing 1–9 hrs are now included (they were previously dropped), and the buckets are aligned with the frontend labels. Only the committed-hours part is included; the worked-hours date changes from that commit are intentionally left out.

How to test:

  1. Check out this branch (gayatri/fix-weekly-committed-hours-be) and run the backend
  2. Check out frontend PR #5623 and run npm install and npm start
  3. Clear site data/cache
  4. Log in as an admin user
  5. Go to Dashboard → Total Org Summary → Volunteer Workload and Task Completion Analysis → Volunteer Hours Distribution
  6. Verify Weekly Committed Hours shows a chart with legend 0-10, 11-20, 21-30, 31-40, Over 40 hrs
  7. Verify TOTAL VOLUNTEERS equals the Active Volunteers card at the top (e.g. 2,583 = 2,583)
  8. Verify on both Current Week and Previous Week, and in dark mode

Screenshots or videos of changes:

Screenshot 2026-10-08 at 3 06 42 AM

Note:

Committed hours reflect each volunteer's current weeklycommittedHours, so this chart is the same for any selected date range. Backend tests for overviewReportHelper and reportsController pass.

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@mahikakakkad mahikakakkad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with frontend #5623 on dev data, Current and Previous Week.

✅ The Weekly Committed Hours chart now renders.
✅ TOTAL VOLUNTEERS (2,585) matches the Active Volunteers card.
✅ The legend reads 0-10, 11-20, 21-30, 31-40, Over 40 hrs.
✅ Same result on both weeks.

Approving.

@one-community

Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community
one-community merged commit cdce09c into development Oct 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants