Skip to content

Commit fe69d5d

Browse files
committed
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.
1 parent e2a1882 commit fe69d5d

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

apps/dokploy/__test__/drop/drop.test.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const baseApp: ApplicationNested = {
3434
giteaRepository: "",
3535
cleanCache: false,
3636
watchPaths: [],
37+
enableSubmodules: false,
3738
applicationStatus: "done",
3839
appName: "",
3940
autoDeploy: true,

apps/dokploy/__test__/traefik/traefik.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const baseApp: ApplicationNested = {
1616
applicationStatus: "done",
1717
appName: "",
1818
autoDeploy: true,
19+
enableSubmodules: false,
1920
serverId: "",
2021
branch: null,
2122
dockerBuildStage: "",

apps/dokploy/components/dashboard/application/general/generic/save-bitbucket-provider.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
SelectTrigger,
3232
SelectValue,
3333
} from "@/components/ui/select";
34+
import { Switch } from "@/components/ui/switch";
3435
import {
3536
Tooltip,
3637
TooltipContent,
@@ -58,6 +59,7 @@ const BitbucketProviderSchema = z.object({
5859
branch: z.string().min(1, "Branch is required"),
5960
bitbucketId: z.string().min(1, "Bitbucket Provider is required"),
6061
watchPaths: z.array(z.string()).optional(),
62+
enableSubmodules: z.boolean().optional(),
6163
});
6264

6365
type BitbucketProvider = z.infer<typeof BitbucketProviderSchema>;
@@ -84,6 +86,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
8486
bitbucketId: "",
8587
branch: "",
8688
watchPaths: [],
89+
enableSubmodules: false,
8790
},
8891
resolver: zodResolver(BitbucketProviderSchema),
8992
});
@@ -130,6 +133,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
130133
buildPath: data.bitbucketBuildPath || "/",
131134
bitbucketId: data.bitbucketId || "",
132135
watchPaths: data.watchPaths || [],
136+
enableSubmodules: data.enableSubmodules || false,
133137
});
134138
}
135139
}, [form.reset, data, form]);
@@ -143,6 +147,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
143147
bitbucketId: data.bitbucketId,
144148
applicationId,
145149
watchPaths: data.watchPaths || [],
150+
enableSubmodules: data.enableSubmodules || false,
146151
})
147152
.then(async () => {
148153
toast.success("Service Provided Saved");
@@ -467,6 +472,21 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
467472
</FormItem>
468473
)}
469474
/>
475+
<FormField
476+
control={form.control}
477+
name="enableSubmodules"
478+
render={({ field }) => (
479+
<FormItem className="flex items-center space-x-2">
480+
<FormControl>
481+
<Switch
482+
checked={field.value}
483+
onCheckedChange={field.onChange}
484+
/>
485+
</FormControl>
486+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
487+
</FormItem>
488+
)}
489+
/>
470490
</div>
471491
<div className="flex w-full justify-end">
472492
<Button

apps/dokploy/components/dashboard/application/general/generic/save-gitea-provider.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
SelectTrigger,
3232
SelectValue,
3333
} from "@/components/ui/select";
34+
import { Switch } from "@/components/ui/switch";
3435
import {
3536
Tooltip,
3637
TooltipContent,
@@ -74,6 +75,7 @@ const GiteaProviderSchema = z.object({
7475
branch: z.string().min(1, "Branch is required"),
7576
giteaId: z.string().min(1, "Gitea Provider is required"),
7677
watchPaths: z.array(z.string()).default([]),
78+
enableSubmodules: z.boolean().optional(),
7779
});
7880

7981
type GiteaProvider = z.infer<typeof GiteaProviderSchema>;
@@ -99,6 +101,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
99101
giteaId: "",
100102
branch: "",
101103
watchPaths: [],
104+
enableSubmodules: false,
102105
},
103106
resolver: zodResolver(GiteaProviderSchema),
104107
});
@@ -152,6 +155,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
152155
buildPath: data.giteaBuildPath || "/",
153156
giteaId: data.giteaId || "",
154157
watchPaths: data.watchPaths || [],
158+
enableSubmodules: data.enableSubmodules || false,
155159
});
156160
}
157161
}, [form.reset, data, form]);
@@ -165,6 +169,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
165169
giteaId: data.giteaId,
166170
applicationId,
167171
watchPaths: data.watchPaths,
172+
enableSubmodules: data.enableSubmodules || false,
168173
})
169174
.then(async () => {
170175
toast.success("Service Provider Saved");
@@ -498,6 +503,21 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
498503
</FormItem>
499504
)}
500505
/>
506+
<FormField
507+
control={form.control}
508+
name="enableSubmodules"
509+
render={({ field }) => (
510+
<FormItem className="flex items-center space-x-2">
511+
<FormControl>
512+
<Switch
513+
checked={field.value}
514+
onCheckedChange={field.onChange}
515+
/>
516+
</FormControl>
517+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
518+
</FormItem>
519+
)}
520+
/>
501521
</div>
502522
<div className="flex w-full justify-end">
503523
<Button

0 commit comments

Comments
 (0)