diff --git a/src/components/CreateProjectForm.tsx b/src/components/CreateProjectForm.tsx index 22a056c3..cb1d3824 100644 --- a/src/components/CreateProjectForm.tsx +++ b/src/components/CreateProjectForm.tsx @@ -19,6 +19,7 @@ import { Controller, useForm } from "react-hook-form"; import { z } from "zod"; import { InputTags } from "./InputTags"; import { T } from "./ui/Typography"; +import { Checkbox } from "./ui/checkbox"; const MotionCard = motion(Card); @@ -27,6 +28,7 @@ const createProjectFormSchema = z.object({ repository: z.number().int().positive("Please select a repository"), terraformDir: z.string().min(1, "Terraform working directory is required"), labels: z.array(z.string()), + managedState: z.boolean().default(true), }); type CreateProjectFormData = z.infer; @@ -50,6 +52,7 @@ export default function CreateProjectForm({ organizationId, repositories }: Crea name: "", repository: repositories[0]?.id || 0, terraformDir: "", + managedState: true, labels: [], }, }); @@ -62,6 +65,7 @@ export default function CreateProjectForm({ organizationId, repositories }: Crea name: data.name, slug, repoId: data.repository, + managedState: data.managedState, terraformWorkingDir: data.terraformDir, labels: data.labels, }); @@ -268,6 +272,20 @@ export default function CreateProjectForm({ organizationId, repositories }: Crea
+
+ ( + + )} + /> + +
>> => { "use server"; @@ -87,7 +89,7 @@ export const createProjectAction = async ({ slug, repo_id: repoId, terraform_working_dir: terraformWorkingDir, - is_managing_state: true, + is_managing_state: managedState, is_in_main_branch: true, is_generated: true, project_status: "draft",