From fe69d5d4057a90e0cfb9eacad5f0aa0c84b5f206 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 26 Apr 2025 16:46:50 -0600 Subject: [PATCH] Enhance Bitbucket provider and application tests by adding `enableSubmodules` field. This update includes the integration of a switch component in the UI and updates to the test files to reflect the new feature. --- apps/dokploy/__test__/drop/drop.test.test.ts | 1 + apps/dokploy/__test__/traefik/traefik.test.ts | 1 + .../generic/save-bitbucket-provider.tsx | 20 +++++++++++++++++++ .../general/generic/save-gitea-provider.tsx | 20 +++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/apps/dokploy/__test__/drop/drop.test.test.ts b/apps/dokploy/__test__/drop/drop.test.test.ts index 7dc9e560..6c0dd981 100644 --- a/apps/dokploy/__test__/drop/drop.test.test.ts +++ b/apps/dokploy/__test__/drop/drop.test.test.ts @@ -34,6 +34,7 @@ const baseApp: ApplicationNested = { giteaRepository: "", cleanCache: false, watchPaths: [], + enableSubmodules: false, applicationStatus: "done", appName: "", autoDeploy: true, diff --git a/apps/dokploy/__test__/traefik/traefik.test.ts b/apps/dokploy/__test__/traefik/traefik.test.ts index d8a14ab4..9312151a 100644 --- a/apps/dokploy/__test__/traefik/traefik.test.ts +++ b/apps/dokploy/__test__/traefik/traefik.test.ts @@ -16,6 +16,7 @@ const baseApp: ApplicationNested = { applicationStatus: "done", appName: "", autoDeploy: true, + enableSubmodules: false, serverId: "", branch: null, dockerBuildStage: "", diff --git a/apps/dokploy/components/dashboard/application/general/generic/save-bitbucket-provider.tsx b/apps/dokploy/components/dashboard/application/general/generic/save-bitbucket-provider.tsx index b506fbac..f0179d9c 100644 --- a/apps/dokploy/components/dashboard/application/general/generic/save-bitbucket-provider.tsx +++ b/apps/dokploy/components/dashboard/application/general/generic/save-bitbucket-provider.tsx @@ -31,6 +31,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { Switch } from "@/components/ui/switch"; import { Tooltip, TooltipContent, @@ -58,6 +59,7 @@ const BitbucketProviderSchema = z.object({ branch: z.string().min(1, "Branch is required"), bitbucketId: z.string().min(1, "Bitbucket Provider is required"), watchPaths: z.array(z.string()).optional(), + enableSubmodules: z.boolean().optional(), }); type BitbucketProvider = z.infer; @@ -84,6 +86,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => { bitbucketId: "", branch: "", watchPaths: [], + enableSubmodules: false, }, resolver: zodResolver(BitbucketProviderSchema), }); @@ -130,6 +133,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => { buildPath: data.bitbucketBuildPath || "/", bitbucketId: data.bitbucketId || "", watchPaths: data.watchPaths || [], + enableSubmodules: data.enableSubmodules || false, }); } }, [form.reset, data, form]); @@ -143,6 +147,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => { bitbucketId: data.bitbucketId, applicationId, watchPaths: data.watchPaths || [], + enableSubmodules: data.enableSubmodules || false, }) .then(async () => { toast.success("Service Provided Saved"); @@ -467,6 +472,21 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => { )} /> + ( + + + + + Enable Submodules + + )} + />