Files
supabase/apps/studio/hooks/misc/useDataApiGrantTogglesEnabled.ts
Charis 6b805289c7 chore(studio): remove feature flag for dataApiExposedBadge (#42563)
Cleanup / chore — removing a feature flag that has been at 100% rollout
with no issues.

## What is the current behavior?

The `dataApiExposedBadge` feature flag is checked at runtime via
ConfigCat, even though it has been set to 100% for a while with no
issues.

## What is the new behavior?

The feature flag check is removed and the gated behavior is now
unconditionally enabled. A reminder has been set to delete the flag from
ConfigCat in a month.

## Summary by CodeRabbit

**Refactor**
* Simplified API access status indicators in the studio editor, ensuring
security-related tooltips now display consistently based on actual
access conditions.
* Updated component interfaces and consolidated internal hook
dependencies for improved code maintainability and organization.
2026-02-10 21:18:53 +00:00

23 lines
726 B
TypeScript

import { usePHFlag } from '../ui/useFlag'
import { IS_TEST_ENV } from '@/lib/constants'
/**
* Determine whether a user has access to Data API grant toggles.
*
* Requires that the ConfigCat flag for Data API badges and the PostHog flag
* for Table Editor API access are both enabled.
*
* In test environments, this returns true to allow E2E testing of the feature
* without requiring the feature flag infrastructure.
*/
export const useDataApiGrantTogglesEnabled = (): boolean => {
const isTableEditorApiAccessEnabled = usePHFlag<boolean>('tableEditorApiAccessToggle')
// In test environment, enable the feature for E2E testing
if (IS_TEST_ENV) {
return true
}
return !!isTableEditorApiAccessEnabled
}