Apply valid file types to AttachmentCell.

This commit is contained in:
Sam Rose 2023-10-27 16:46:30 +01:00
parent 2160f4e5e2
commit 6bb6f106d5
No known key found for this signature in database
3 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,7 @@
export let fileTags = []
export let maximum = undefined
export let compact = false
export let extensions = undefined
const dispatch = createEventDispatcher()
const onChange = e => {
@ -39,6 +40,7 @@
{fileTags}
{maximum}
{compact}
{extensions}
on:change={onChange}
/>
</Field>

View File

@ -2,6 +2,7 @@
import { onMount } from "svelte"
import { getContext } from "svelte"
import { Dropzone } from "@budibase/bbui"
import { ValidFileExtensions } from "@budibase/shared-core"
export let value
export let focused = false
@ -13,6 +14,7 @@
const { API, notifications } = getContext("grid")
const imageExtensions = ["png", "tiff", "gif", "raw", "jpg", "jpeg"]
const validExtensions = ValidFileExtensions.map(ext => `.${ext}`).join(", ")
let isOpen = false
@ -96,6 +98,7 @@
{value}
compact
on:change={e => onChange(e.detail)}
extensions={validExtensions}
{processFiles}
{deleteAttachments}
{handleFileTooLarge}

View File

@ -96,7 +96,6 @@ export enum BuilderSocketEvent {
export const SocketSessionTTL = 60
export const ValidQueryNameRegex = /^[^()]*$/
export const ValidColumnNameRegex = /^[_a-zA-Z0-9\s]*$/g
export const ValidFileExtensions = [
"avif",
"css",