mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 11:25:06 +03:00
Move "High availability" from internal-only to public. Closes MUL-668. ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Bug fix ## What is the current behavior? "High availability" is an internal-only config <img width="724" height="1126" alt="Screenshot 2026-07-26 at 8 15 57 PM" src="https://github.com/user-attachments/assets/83e1856b-9020-4b65-a019-27e3cc29bae9" /> ## What is the new behavior? "High availability" is a public user-facing config <img width="724" height="1036" alt="Screenshot 2026-07-26 at 8 15 31 PM" src="https://github.com/user-attachments/assets/4f369058-ce91-4bcf-bd3c-120277363b1a" /> Still hidden without the org entitlement, i.e. currently not available anywhere on prod <img width="724" height="931" alt="Screenshot 2026-07-26 at 8 18 58 PM" src="https://github.com/user-attachments/assets/3e1deb76-210c-416b-b716-45ff6e3b0afd" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a High availability option directly to the project creation form. * The option is shown when available for the account and hidden when unavailable. * Enabling High availability automatically selects AWS as the cloud provider. * **Bug Fixes** * Corrected validation for incompatible High availability and OrioleDB selections. * **Tests** * Added coverage for High availability visibility, eligibility, and form submission behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
91 lines
3.3 KiB
TypeScript
91 lines
3.3 KiB
TypeScript
import { useParams } from 'common'
|
|
import { UseFormReturn } from 'react-hook-form'
|
|
import { type CloudProvider } from 'shared-data'
|
|
import { FormControl, FormField, Input } from 'ui'
|
|
import { CollapsibleCardSection } from 'ui-patterns/CollapsibleCardSection'
|
|
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
|
|
|
|
import { CloudProviderSelector } from './CloudProviderSelector'
|
|
import { PostgresVersionSelector } from './PostgresVersionSelector'
|
|
import { CreateProjectForm } from './ProjectCreation.schema'
|
|
import Panel from '@/components/ui/Panel'
|
|
|
|
interface InternalOnlyConfigurationProps {
|
|
form: UseFormReturn<CreateProjectForm>
|
|
}
|
|
|
|
export const InternalOnlyConfiguration = ({ form }: InternalOnlyConfigurationProps) => {
|
|
const { slug } = useParams()
|
|
const showNonProdFields = process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod'
|
|
|
|
return (
|
|
<Panel.Content>
|
|
<CollapsibleCardSection
|
|
title="Internal-only Configuration"
|
|
description="These settings are only visible to internal staff"
|
|
>
|
|
<div className="flex flex-col gap-y-6">
|
|
<div className="flex flex-col gap-y-4">
|
|
<FormField
|
|
control={form.control}
|
|
name="postgresVersionSelection"
|
|
render={({ field }) => (
|
|
<PostgresVersionSelector
|
|
field={field}
|
|
form={form}
|
|
cloudProvider={form.getValues('cloudProvider') as CloudProvider}
|
|
organizationSlug={slug}
|
|
dbRegion={form.getValues('dbRegion')}
|
|
/>
|
|
)}
|
|
/>
|
|
</div>
|
|
|
|
{showNonProdFields && (
|
|
<div>
|
|
<p className="text-xs text-foreground-lighter mb-6">
|
|
The settings below are only applicable for local/staging projects
|
|
</p>
|
|
<div className="flex flex-col gap-y-4">
|
|
<CloudProviderSelector form={form} />
|
|
|
|
<FormField
|
|
control={form.control}
|
|
name="postgresVersion"
|
|
render={({ field }) => (
|
|
<FormItemLayout
|
|
label="Custom Postgres version"
|
|
layout="horizontal"
|
|
description="Specify a custom version of Postgres (defaults to the latest)."
|
|
>
|
|
<FormControl>
|
|
<Input placeholder="e.g 17.6.1.104" {...field} autoComplete="off" />
|
|
</FormControl>
|
|
</FormItemLayout>
|
|
)}
|
|
/>
|
|
|
|
<FormField
|
|
control={form.control}
|
|
name="instanceType"
|
|
render={({ field }) => (
|
|
<FormItemLayout
|
|
label="Custom instance type"
|
|
layout="horizontal"
|
|
description="Specify a custom instance type."
|
|
>
|
|
<FormControl>
|
|
<Input placeholder="e.g t3.nano" {...field} autoComplete="off" />
|
|
</FormControl>
|
|
</FormItemLayout>
|
|
)}
|
|
/>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</div>
|
|
</CollapsibleCardSection>
|
|
</Panel.Content>
|
|
)
|
|
}
|