diff --git a/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx b/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx index b5d7d410eb7..5b9e0523a57 100644 --- a/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx +++ b/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx @@ -22,7 +22,7 @@ import { IntegrationProjectConnection, Integration, } from 'data/integrations/integrations.types' -import { useSelectedOrganization, useStore } from 'hooks' +import { useFlag, useSelectedOrganization, useStore } from 'hooks' import { BASE_PATH } from 'lib/constants' import { pluralize } from 'lib/helpers' import { getIntegrationConfigurationUrl } from 'lib/integration-utils' @@ -30,6 +30,9 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { useForm } from 'react-hook-form' import { useSidePanelsStateSnapshot } from 'state/side-panels' import { + AlertDescription_Shadcn_, + AlertTitle_Shadcn_, + Alert_Shadcn_, Button, CommandEmpty_Shadcn_, CommandGroup_Shadcn_, @@ -43,8 +46,10 @@ import { FormItem_Shadcn_, FormLabel_Shadcn_, Form_Shadcn_, + IconAlertTriangle, IconCheck, IconChevronDown, + IconClock, Input_Shadcn_, Label_Shadcn_, PopoverContent_Shadcn_, @@ -268,29 +273,29 @@ You can change the scope of the access for Supabase by configuring connection: IntegrationProjectConnection integration: Integration }) => { + const enableVercelConnectionsConfig = useFlag('enableVercelConnectionsConfig') + const { ui } = useStore() const config = connection.metadata.supabaseConfig const FormSchema = z.object({ environmentVariablesProduction: z .boolean() - .default(config?.environmentVariables?.production ?? false), - authRedirectUrisProduction: z - .boolean() - .default(config?.authRedirectUris?.production ?? false), + .default(config?.environmentVariables?.production ?? true), + authRedirectUrisProduction: z.boolean().default(config?.authRedirectUris?.production ?? true), environmentVariablesPreview: z .boolean() - .default(config?.environmentVariables?.preview ?? false), - authRedirectUrisPreview: z.boolean().default(config?.authRedirectUris?.preview ?? false), + .default(config?.environmentVariables?.preview ?? true), + authRedirectUrisPreview: z.boolean().default(config?.authRedirectUris?.preview ?? true), }) const form = useForm>({ resolver: zodResolver(FormSchema), defaultValues: { - environmentVariablesProduction: config?.environmentVariables?.production ?? false, - environmentVariablesPreview: config?.environmentVariables?.preview ?? false, - authRedirectUrisProduction: config?.authRedirectUris?.production ?? false, - authRedirectUrisPreview: config?.authRedirectUris?.preview ?? false, + environmentVariablesProduction: config?.environmentVariables?.production ?? true, + environmentVariablesPreview: config?.environmentVariables?.preview ?? true, + authRedirectUrisProduction: config?.authRedirectUris?.production ?? true, + authRedirectUrisPreview: config?.authRedirectUris?.preview ?? true, }, }) @@ -305,6 +310,11 @@ You can change the scope of the access for Supabase by configuring }) function onSubmit(data: z.infer) { + /** + * remove this hardcoded if statement when we are ready to enable this feature + */ + if (!enableVercelConnectionsConfig) return + const metadata = { ...connection.metadata, } @@ -329,10 +339,25 @@ You can change the scope of the access for Supabase by configuring return ( -
+
+ + + Vercel Connection configuration coming soon + + This configuration will allow you to control the environment variables and auth + redirects for production and preview deployments. + + +
+ +
{/* {isUpdatingVercelConnection && 'isUpdatingVercelConnection'} */}
+
Vercel Production deployments
-
- -
Database Branching configuration
-
+
Vercel Preview deployments