-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(drizzle): added ods for analytics from drizzle #1956
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||
| 'use client' | ||||||||||||||||||
|
|
||||||||||||||||||
| import { useEffect } from 'react' | ||||||||||||||||||
| import { configure } from 'onedollarstats' | ||||||||||||||||||
| import { env } from '@/lib/env' | ||||||||||||||||||
|
|
||||||||||||||||||
| export function OneDollarStats() { | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Missing TSDoc. Per .cursorrules line 144, components must have TSDoc with description,
Suggested change
Context Used: Context from Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/components/analytics/onedollarstats.tsx
Line: 7:7
Comment:
**style:** Missing TSDoc. Per .cursorrules line 144, components must have TSDoc with description, `@param`, and `@returns`
```suggestion
/**
* OneDollarStats analytics component. Initializes analytics tracking
* when DRIZZLE_ODS_API_KEY is configured.
*
* @returns null - component has no visual output
*/
export function OneDollarStats() {
```
**Context Used:** Context from `dashboard` - apps/sim/.cursorrules ([source](https://app.greptile.com/review/custom-context?memory=867b3993-a968-40e2-b2e0-8ce533acea2e))
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||
| const shouldInitialize = !!env.DRIZZLE_ODS_API_KEY | ||||||||||||||||||
|
|
||||||||||||||||||
| if (!shouldInitialize) { | ||||||||||||||||||
| return | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| configure({ | ||||||||||||||||||
| collectorUrl: 'https://collector.onedollarstats.com/events', | ||||||||||||||||||
| autocollect: true, | ||||||||||||||||||
| hashRouting: true, | ||||||||||||||||||
| }) | ||||||||||||||||||
|
Comment on lines
+15
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/components/analytics/onedollarstats.tsx
Line: 15:19
Comment:
**logic:** `DRIZZLE_ODS_API_KEY` is checked but never passed to `configure()`. Analytics packages typically require the API key in their config.
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||
| }, []) | ||||||||||||||||||
|
|
||||||||||||||||||
| return null | ||||||||||||||||||
| } | ||||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Script loads unconditionally but
OneDollarStatscomponent only initializes whenDRIZZLE_ODS_API_KEYis set. This wastes bandwidth loading an unused script.Consider conditionally rendering based on the API key presence or move script loading into the component.
Prompt To Fix With AI