@@ -27,6 +27,7 @@ const createProjectFormSchema = z.object({
27
27
name : z . string ( ) . min ( 1 , "Project name is required" ) ,
28
28
repository : z . number ( ) . int ( ) . positive ( "Please select a repository" ) ,
29
29
terraformDir : z . string ( ) . min ( 1 , "Terraform working directory is required" ) ,
30
+ branch : z . string ( ) . optional ( ) ,
30
31
labels : z . array ( z . string ( ) ) ,
31
32
managedState : z . boolean ( ) . default ( true ) ,
32
33
teamId : z . number ( ) . int ( ) . positive ( ) . nullable ( ) ,
@@ -83,6 +84,7 @@ export default function CreateProjectForm({ organizationId, repositories, teams,
83
84
repoId : data . repository ,
84
85
managedState : data . managedState ,
85
86
terraformWorkingDir : data . terraformDir ,
87
+ branch : data . branch || '' ,
86
88
labels : data . labels ,
87
89
is_drift_detection_enabled : data . is_drift_detection_enabled ,
88
90
drift_crontab : data . drift_crontab || '' ,
@@ -308,8 +310,8 @@ export default function CreateProjectForm({ organizationId, repositories, teams,
308
310
>
309
311
< CardHeader >
310
312
< div className = "flex flex-col" >
311
- < CardTitle className = "text-lg " > Terraform Configuration</ CardTitle >
312
- < CardDescription className = "text-sm text-muted-foreground" > Specify the working directory for Terraform</ CardDescription >
313
+ < CardTitle className = "text-lg " > Configuration</ CardTitle >
314
+ < CardDescription className = "text-sm text-muted-foreground" > Specify branch and working directory for Terraform</ CardDescription >
313
315
</ div >
314
316
</ CardHeader >
315
317
< CardContent >
@@ -322,7 +324,7 @@ export default function CreateProjectForm({ organizationId, repositories, teams,
322
324
< div className = "relative" >
323
325
< Input
324
326
id = "terraformDir"
325
- placeholder = "Enter directory path "
327
+ placeholder = "e.g. ./ "
326
328
className = { `mt-1 ${ errors . terraformDir ? 'border-destructive' : '' } ` }
327
329
{ ...field }
328
330
/>
@@ -335,6 +337,27 @@ export default function CreateProjectForm({ organizationId, repositories, teams,
335
337
</ div >
336
338
) }
337
339
/>
340
+ < Label htmlFor = "branch" > Branch</ Label >
341
+ < Controller
342
+ name = "branch"
343
+ control = { control }
344
+ render = { ( { field } ) => (
345
+ < div className = "relative" >
346
+ < Input
347
+ id = "branch"
348
+ placeholder = "if not specified, main branch will be used"
349
+ className = { `mt-1 ${ errors . branch ? 'border-destructive' : '' } ` }
350
+ { ...field }
351
+ />
352
+ { errors . branch && (
353
+ < div className = "flex items-center mt-1 text-destructive" >
354
+ < AlertCircle className = "h-4 w-4 mr-1" />
355
+ < span className = "text-sm" > { errors . branch . message } </ span >
356
+ </ div >
357
+ ) }
358
+ </ div >
359
+ ) }
360
+ />
338
361
</ div >
339
362
</ CardContent >
340
363
</ MotionCard >
0 commit comments