Skip to content

Commit 22aad59

Browse files
committed
Dashboard: Fix Active Users calculation in team and project analytics charts (#7854)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on modifying the `aggregateFn` function in two files related to analytics highlights cards, ensuring consistent functionality for aggregating data. ### Detailed summary - In both `highlights-card.tsx` files, the `aggregateFn` function is updated to include logic for handling the `activeUsers` key. - The function calculates the maximum value for `activeUsers` and sums values for other keys. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Standardized analytics aggregation across Highlights cards. All metrics, including Active Users, now show the total over the selected period (previously Active Users showed the peak value). Expect updated figures in both Team Analytics Highlights and Project Overview Highlights, ensuring consistency between summary cards and detailed views. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a3b2f8f commit 22aad59

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/analytics/highlights-card.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ export function TeamHighlightsCard({
7676
: "activeUsers"
7777
}
7878
aggregateFn={(_data, key) => {
79-
if (key === "activeUsers") {
80-
return Math.max(...timeSeriesData.map((d) => d[key]));
81-
}
8279
return timeSeriesData.reduce((acc, curr) => acc + curr[key], 0);
8380
}}
8481
chartConfig={chartConfig}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/overview/highlights-card.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ export function ProjectHighlightsCard(props: {
7070
: "activeUsers"
7171
}
7272
aggregateFn={(_data, key) => {
73-
if (key === "activeUsers") {
74-
return Math.max(...timeSeriesData.map((d) => d[key]));
75-
}
7673
return timeSeriesData.reduce((acc, curr) => acc + curr[key], 0);
7774
}}
7875
chartConfig={chartConfig}

0 commit comments

Comments
 (0)