chore: pr feedbacks
This commit is contained in:
parent
5788111502
commit
da979728bf
5 changed files with 14 additions and 10 deletions
|
|
@ -109,8 +109,8 @@ export const CreateRepositoryForm = ({
|
||||||
{...field}
|
{...field}
|
||||||
placeholder="Repository name"
|
placeholder="Repository name"
|
||||||
onChange={(e) => field.onChange(slugify(e.target.value))}
|
onChange={(e) => field.onChange(slugify(e.target.value))}
|
||||||
max={32}
|
maxLength={32}
|
||||||
min={2}
|
minLength={2}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>Unique identifier for the repository.</FormDescription>
|
<FormDescription>Unique identifier for the repository.</FormDescription>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import {
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "../../../../components/ui/form";
|
} from "../../../../components/ui/form";
|
||||||
import { Input } from "../../../../components/ui/input";
|
import { Input } from "../../../../components/ui/input";
|
||||||
|
import { Textarea } from "../../../../components/ui/textarea";
|
||||||
import type { RepositoryFormValues } from "../create-repository-form";
|
import type { RepositoryFormValues } from "../create-repository-form";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
@ -52,7 +53,7 @@ export const GCSRepositoryForm = ({ form }: Props) => {
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Service Account JSON</FormLabel>
|
<FormLabel>Service Account JSON</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input type="password" placeholder="Paste service account JSON key..." {...field} />
|
<Textarea placeholder="Paste service account JSON key..." {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>Service account JSON credentials for authentication.</FormDescription>
|
<FormDescription>Service account JSON credentials for authentication.</FormDescription>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,10 @@ const defaultValuesForType = {
|
||||||
export const CreateVolumeForm = ({ onSubmit, mode = "create", initialValues, formId, loading, className }: Props) => {
|
export const CreateVolumeForm = ({ onSubmit, mode = "create", initialValues, formId, loading, className }: Props) => {
|
||||||
const form = useForm<FormValues>({
|
const form = useForm<FormValues>({
|
||||||
resolver: arktypeResolver(cleanSchema as unknown as typeof formSchema),
|
resolver: arktypeResolver(cleanSchema as unknown as typeof formSchema),
|
||||||
defaultValues: initialValues,
|
defaultValues: initialValues || {
|
||||||
|
name: "",
|
||||||
|
backend: "directory",
|
||||||
|
},
|
||||||
resetOptions: {
|
resetOptions: {
|
||||||
keepDefaultValues: true,
|
keepDefaultValues: true,
|
||||||
keepDirtyValues: false,
|
keepDirtyValues: false,
|
||||||
|
|
@ -115,8 +118,8 @@ export const CreateVolumeForm = ({ onSubmit, mode = "create", initialValues, for
|
||||||
{...field}
|
{...field}
|
||||||
placeholder="Volume name"
|
placeholder="Volume name"
|
||||||
onChange={(e) => field.onChange(slugify(e.target.value))}
|
onChange={(e) => field.onChange(slugify(e.target.value))}
|
||||||
max={32}
|
maxLength={32}
|
||||||
min={1}
|
minLength={2}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>Unique identifier for the volume.</FormDescription>
|
<FormDescription>Unique identifier for the volume.</FormDescription>
|
||||||
|
|
@ -127,10 +130,11 @@ export const CreateVolumeForm = ({ onSubmit, mode = "create", initialValues, for
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="backend"
|
name="backend"
|
||||||
|
defaultValue="directory"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Backend</FormLabel>
|
<FormLabel>Backend</FormLabel>
|
||||||
<Select onValueChange={field.onChange} defaultValue={field.value} value={field.value}>
|
<Select onValueChange={field.onChange} value={field.value}>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select a backend" />
|
<SelectValue placeholder="Select a backend" />
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ export const RcloneForm = ({ form }: Props) => {
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Remote</FormLabel>
|
<FormLabel>Remote</FormLabel>
|
||||||
<Select onValueChange={(v) => field.onChange(v)} defaultValue={field.value} value={field.value}>
|
<Select onValueChange={(v) => field.onChange(v)}>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select an rclone remote" />
|
<SelectValue placeholder="Select an rclone remote" />
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ export const SMBForm = ({ form }: Props) => {
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>SMB Version</FormLabel>
|
<FormLabel>SMB Version</FormLabel>
|
||||||
<Select onValueChange={field.onChange} defaultValue={field.value || "3.0"}>
|
<Select onValueChange={field.onChange} value={field.value}>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select SMB version" />
|
<SelectValue placeholder="Select SMB version" />
|
||||||
|
|
@ -125,7 +125,6 @@ export const SMBForm = ({ form }: Props) => {
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="445"
|
placeholder="445"
|
||||||
value={field.value}
|
value={field.value}
|
||||||
defaultValue={445}
|
|
||||||
onChange={(e) => field.onChange(parseInt(e.target.value, 10) || undefined)}
|
onChange={(e) => field.onChange(parseInt(e.target.value, 10) || undefined)}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue