mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +03:00
### Changes
- Replace plan-based checks (`LOG_RETENTION`, `availableIn`) with
`useCheckEntitlements('log.retention_days')` in the chart interval
dropdown
- `ChartIntervalDropdown` now calls the entitlements hook internally
instead of receiving plan props
- Remove `LOG_RETENTION` constant and `availableIn` from
`CHART_INTERVALS`
- Update consumer components (`ProjectUsage`, `ProjectUsageSection`,
`ObservabilityOverview`) to remove plan prop passing
### Testing
- Head to `/project/_/observability` with a Free plan org.
- Click on the time selector "Last 7 days" is disabled, default is "Last
60 minutes", tooltip shows retention limit and upgrade link
<img width="827" height="151" alt="image"
src="https://github.com/user-attachments/assets/20988398-8f0a-46b6-be3d-af4e9d530f81"
/>
- With a Pro Org and above the "Last 7 days" option should be enabled
26 lines
459 B
TypeScript
26 lines
459 B
TypeScript
import type { ChartIntervals } from 'types'
|
|
|
|
export const CHART_INTERVALS: ChartIntervals[] = [
|
|
{
|
|
key: '1hr',
|
|
label: 'Last 60 minutes',
|
|
startValue: 1,
|
|
startUnit: 'hour',
|
|
format: 'MMM D, h:mma',
|
|
},
|
|
{
|
|
key: '1day',
|
|
label: 'Last 24 hours',
|
|
startValue: 24,
|
|
startUnit: 'hour',
|
|
format: 'MMM D, ha',
|
|
},
|
|
{
|
|
key: '7day',
|
|
label: 'Last 7 days',
|
|
startValue: 7,
|
|
startUnit: 'day',
|
|
format: 'MMM D',
|
|
},
|
|
]
|