You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Dashboard] Fix: If only one time period has analytics events (#5886)
## Notes for the reviewer
Adds an edge case if a user only has events for a single time period. Previously, this would show 0 in the analytics summary since it normally takes the most recent *complete* time period. Now, it falls back to show the incomplete period if there is no complete period with data.
## How to test
Run the dashboard and view the project client ID listed in the linear ticket
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on improving the handling of time series data in the `aggregateFn` function by ensuring that if there is only one data point, it uses that point instead of the previous one. This change is applied in two files.
### Detailed summary
- Updated `aggregateFn` in `apps/dashboard/src/app/team/[team_slug]/[project_slug]/page.tsx`:
- Added logic to check if there is only one valid data point.
- If only one point exists, it uses the last data point; otherwise, it uses the previous one.
- Updated `aggregateFn` in `apps/dashboard/src/app/team/[team_slug]/(team)/~/analytics/page.tsx`:
- Similar logic added as in the previous file to handle time series data appropriately.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
0 commit comments