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