mirror of
https://github.com/abhinavxd/libredesk.git
synced 2025-11-01 20:44:12 +00:00
fix[UI]: General setting form tag input not propogating updates to form.
- chore: set allowed file upload size to 500 mb in zod schema.
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<form
|
||||
@submit="onSubmit"
|
||||
class="space-y-6 w-full"
|
||||
>
|
||||
<form @submit="onSubmit" class="space-y-6 w-full">
|
||||
<FormField v-slot="{ field }" name="site_name">
|
||||
<FormItem>
|
||||
<FormLabel>Site Name</FormLabel>
|
||||
@@ -126,22 +123,28 @@
|
||||
</FormItem>
|
||||
</FormField>
|
||||
|
||||
<FormField name="allowed_file_upload_extensions" v-slot="{ componentField }">
|
||||
<FormItem>
|
||||
<FormLabel>Allowed file upload extensions</FormLabel>
|
||||
<FormControl>
|
||||
<TagsInput v-model="componentField.modelValue">
|
||||
<TagsInputItem v-for="item in componentField.modelValue" :key="item" :value="item">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="jpg" />
|
||||
</TagsInput>
|
||||
</FormControl>
|
||||
<FormDescription>Use `*` to allow any file.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
</FormField>
|
||||
|
||||
<FormField name="allowed_file_upload_extensions" v-slot="{ componentField, handleChange }">
|
||||
<FormItem>
|
||||
<FormLabel>Allowed file upload extensions</FormLabel>
|
||||
<FormControl>
|
||||
<TagsInput
|
||||
:modelValue="componentField.modelValue"
|
||||
@update:modelValue="handleChange"
|
||||
>
|
||||
<TagsInputItem v-for="item in componentField.modelValue" :key="item" :value="item">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="jpg" />
|
||||
</TagsInput>
|
||||
</FormControl>
|
||||
<FormDescription>Use `*` to allow any file.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
</FormField>
|
||||
|
||||
|
||||
<Button type="submit" :isLoading="formLoading"> {{ submitLabel }} </Button>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
@@ -35,8 +35,8 @@ export const formSchema = z.object({
|
||||
.min(1, {
|
||||
message: 'Max upload file size must be at least 1 MB.'
|
||||
})
|
||||
.max(30, {
|
||||
message: 'Max upload file size cannot exceed 30 MB.'
|
||||
.max(500, {
|
||||
message: 'Max upload file size cannot exceed 500 MB.'
|
||||
}),
|
||||
allowed_file_upload_extensions: z.array(z.string()).nullable().default([]).optional()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user