Skip to content

Commit

Permalink
fix: Add vm toggle to google provider dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 committed Jan 21, 2025
1 parent 7b99a98 commit 6abf7a8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const createGoogleSchema = z.object({
importNamespaces: z.boolean().default(false),
importVCluster: z.boolean().default(false),
importVpc: z.boolean().default(false),
importVms: z.boolean().default(false),
});

export const GoogleDialog: React.FC<{
Expand All @@ -58,6 +59,7 @@ export const GoogleDialog: React.FC<{
importNamespaces: false,
importVCluster: false,
importVpc: false,
importVms: false,
},
mode: "onChange",
});
Expand Down Expand Up @@ -275,6 +277,25 @@ export const GoogleDialog: React.FC<{
)}
/>

<FormField
control={form.control}
name="importVms"
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
<div className="space-y-0.5">
<FormLabel>Import VMs</FormLabel>
<FormDescription>Enable importing of VMs</FormDescription>
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>

<DialogFooter>
<Button type="submit">Create</Button>
</DialogFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ import { api } from "~/trpc/react";
import { createGoogleSchema } from "./GoogleDialog";

const formSchema = createGoogleSchema.and(
z.object({
repeatSeconds: z.number(),
}),
z.object({ repeatSeconds: z.number() }),
);

export const UpdateGoogleProviderDialog: React.FC<{
Expand Down Expand Up @@ -305,6 +303,25 @@ export const UpdateGoogleProviderDialog: React.FC<{
)}
/>

<FormField
control={form.control}
name="importVms"
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
<div className="space-y-0.5">
<FormLabel>Import VMs</FormLabel>
<FormDescription>Enable importing of VMs</FormDescription>
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>

<FormField
control={form.control}
name="repeatSeconds"
Expand Down

0 comments on commit 6abf7a8

Please sign in to comment.