-
Notifications
You must be signed in to change notification settings - Fork 544
[Dashboard] Fix: If only one time period has analytics events #5886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dashboard] Fix: If only one time period has analytics events #5886
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5886 +/- ##
=======================================
Coverage 55.19% 55.19%
=======================================
Files 1123 1123
Lines 59617 59617
Branches 5028 5028
=======================================
Hits 32905 32905
Misses 25992 25992
Partials 720 720
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
Merge activity
|
## 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 -->
4984c01
to
2a9d996
Compare
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
PR-Codex overview
This PR focuses on enhancing the logic for aggregating time series data in two components, ensuring that the correct data point is used based on the number of available data points.
Detailed summary
aggregateFn
inapps/dashboard/src/app/team/[team_slug]/[project_slug]/page.tsx
to handle cases with fewer data points.apps/dashboard/src/app/team/[team_slug]/(team)/~/analytics/page.tsx
.