Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add HA toggle to enabled features (#50344)

Joshen Limc9e035910df8
diff --git a/apps/studio/components/interfaces/ProjectCreation/HighAvailabilityInput.tsx b/apps/studio/components/interfaces/ProjectCreation/HighAvailabilityInput.tsx
index 9b619fe1ee8..85de5ccca4f 100644
--- a/apps/studio/components/interfaces/ProjectCreation/HighAvailabilityInput.tsx
+++ b/apps/studio/components/interfaces/ProjectCreation/HighAvailabilityInput.tsx
@@ -8,6 +8,7 @@ import { HIGH_AVAILABILITY_INSTANCE_SIZE } from './ProjectCreation.constants'
import { CreateProjectForm } from './ProjectCreation.schema'
import Panel from '@/components/ui/Panel'
import { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'
+import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
interface HighAvailabilityInputProps {
form: UseFormReturn<CreateProjectForm>
@@ -22,6 +23,7 @@ export const HighAvailabilityInput = ({
}: HighAvailabilityInputProps) => {
const { getValues, setValue } = form
const { hasAccess } = useCheckEntitlements('instances.high_availability')
+ const showHighAvailability = useIsFeatureEnabled('project_creation:show_high_availability')
const highAvailability = useWatch({ control: form.control, name: 'highAvailability' })
// Fields to revert to when toggling off HA, so previously selected values aren't lost.
@@ -105,7 +107,7 @@ export const HighAvailabilityInput = ({
setValue('dbRegion', highAvailabilityRegionName)
}, [highAvailability, highAvailabilityRegionName, getValues, setValue])
- if (!hasAccess) return null
+ if (!hasAccess || !showHighAvailability) return null
return (
<Panel.Content>
diff --git a/packages/common/enabled-features/enabled-features.json b/packages/common/enabled-features/enabled-features.json
index e1a7a682b44..49032592106 100644
--- a/packages/common/enabled-features/enabled-features.json
+++ b/packages/common/enabled-features/enabled-features.json
@@ -102,6 +102,7 @@
"project_connection:show_warehouse": true,
"project_creation:show_advanced_config": true,
+ "project_creation:show_high_availability": true,
"project_homepage:show_instance_size": true,
"project_homepage:show_examples": true,
diff --git a/packages/common/enabled-features/enabled-features.schema.json b/packages/common/enabled-features/enabled-features.schema.json
index 463df741ebf..9943d645c31 100644
--- a/packages/common/enabled-features/enabled-features.schema.json
+++ b/packages/common/enabled-features/enabled-features.schema.json
@@ -354,6 +354,10 @@
"type": "boolean",
"description": "Show the advanced configuration option in the project creation flow"
},
+ "project_creation:show_high_availability": {
+ "type": "boolean",
+ "description": "Show the high availability toggle in the project creation flow"
+ },
"project_homepage:show_instance_size": {
"type": "boolean",