@@ -23,6 +23,7 @@ import type {
2323 IntegrationProjectConnection ,
2424} from 'data/integrations/integrations.types'
2525import { useVercelConnectionUpdateMutation } from 'data/integrations/vercel-connection-update-mutate'
26+ import { useFlag } from 'hooks'
2627
2728const VercelIntegrationConnectionForm = ( {
2829 connection,
@@ -32,6 +33,7 @@ const VercelIntegrationConnectionForm = ({
3233 integration : Integration
3334} ) => {
3435 const config = connection . metadata . supabaseConfig
36+ const enableVercelConnectionsConfig = useFlag ( 'enableVercelConnectionsConfig' )
3537
3638 const FormSchema = z . object ( {
3739 environmentVariablesProduction : z
@@ -59,6 +61,11 @@ const VercelIntegrationConnectionForm = ({
5961 } )
6062
6163 function onSubmit ( data : z . infer < typeof FormSchema > ) {
64+ /**
65+ * remove this hardcoded if statement when we are ready to enable this feature
66+ */
67+ if ( ! enableVercelConnectionsConfig ) return
68+
6269 const metadata = {
6370 ...connection . metadata ,
6471 }
@@ -94,7 +101,10 @@ const VercelIntegrationConnectionForm = ({
94101 </ Alert_Shadcn_ >
95102 </ div >
96103 < ScaffoldDivider />
97- < form onSubmit = { form . handleSubmit ( onSubmit ) } className = { cn ( 'w-full space-y-6' ) } >
104+ < form
105+ onSubmit = { form . handleSubmit ( onSubmit ) }
106+ className = { cn ( ! enableVercelConnectionsConfig && 'opacity-30' , 'w-full space-y-6' ) }
107+ >
98108 < div >
99109 { /* {isUpdatingVercelConnection && 'isUpdatingVercelConnection'} */ }
100110 < div className = "flex flex-col gap-6 px-8 py-8" >
@@ -115,6 +125,7 @@ const VercelIntegrationConnectionForm = ({
115125 < FormControl_Shadcn_ >
116126 < Switch
117127 checked = { field . value }
128+ disabled = { ! enableVercelConnectionsConfig }
118129 onCheckedChange = { ( e ) => {
119130 field . onChange ( e )
120131 form . handleSubmit ( onSubmit ) ( )
@@ -141,6 +152,7 @@ const VercelIntegrationConnectionForm = ({
141152 < FormControl_Shadcn_ >
142153 < Switch
143154 checked = { field . value }
155+ disabled = { ! enableVercelConnectionsConfig }
144156 onCheckedChange = { ( e ) => {
145157 field . onChange ( e )
146158 form . handleSubmit ( onSubmit ) ( )
@@ -171,6 +183,7 @@ const VercelIntegrationConnectionForm = ({
171183 < FormControl_Shadcn_ >
172184 < Switch
173185 checked = { field . value }
186+ disabled = { ! enableVercelConnectionsConfig }
174187 onCheckedChange = { ( e ) => {
175188 field . onChange ( e )
176189 form . handleSubmit ( onSubmit ) ( )
@@ -196,6 +209,7 @@ const VercelIntegrationConnectionForm = ({
196209 < FormControl_Shadcn_ >
197210 < Switch
198211 checked = { field . value }
212+ disabled = { ! enableVercelConnectionsConfig }
199213 onCheckedChange = { ( e ) => {
200214 field . onChange ( e )
201215 form . handleSubmit ( onSubmit ) ( )
@@ -207,7 +221,6 @@ const VercelIntegrationConnectionForm = ({
207221 />
208222 </ div >
209223 </ div >
210- { /* <Button htmlType="submit">Submit</Button> */ }
211224 </ form >
212225 </ Form_Shadcn_ >
213226 )
0 commit comments