Repository navigation
Gayatri - Fix Total Active Teams card not matching Team Stats - #2391
Open
sawantgayatri19 wants to merge 1 commit into
Open
sawantgayatri19 wants to merge 1 commit into
sawantgayatri19 wants to merge 1 commit into
Conversation
|
mahikakakkad
approved these changes
Oct 10, 2026
mahikakakkad
left a comment
There was a problem hiding this comment.
Tested locally with this branch and frontend #5634 on shared dev data, Current Week and Previous Week, light mode.
✅ The Active Teams card now shows 213, matching Team Stats’ “213 teams with 2+ active members” (previously 4 vs 211).
✅ The value stays consistent across Current Week and Previous Week.
Looks good, approving. Note for merging: #2389 also changes overviewReportHelper.js, so whichever merges second may need a quick rebase.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
On Total Org Summary (Current Week), the "Total Active Teams" card showed 4 while Team Stats showed "211 teams with 2+ active members". They used different definitions of "active team": the card counted teams where any member logged time in the period, while Team Stats counts active teams with N+ currently active members.
Fixes # (bug list priority urgent: P1 Total Org Summary "Total Active Teams" card doesn't match Team Stats)
Related PRS (if any):
Frontend label: OneCommunityGlobal/HighestGoodNetworkApp#5634
To test, run this backend branch with that frontend PR.
Main changes explained:
src/helpers/overviewReportHelper.js:getTotalActiveTeamCountnow uses the same definition as Team Stats: an active team (created by the end date) with at least 2 currently active members, by reusinggetTeamsWithActiveMembers. The card now equals Team Stats' default "N teams with 2+ active members". Comparison periods use the same definition.console.logstatements and an unusedTeam.countDocumentsquery from that function.src/helpers/overviewReportHelper.spec.js: added tests for the shared definition, the comparison values, and the zero case.How to test:
Screenshots or videos of changes:
Note:
Definition chosen: "active team = active team with 2+ active members", matching Team Stats' default. The card no longer means "teams that logged hours this week". If a different minimum (e.g. 1) is preferred, it's a one-line change (
ACTIVE_TEAM_MIN_MEMBERS).