diff --git a/packages/bbui/src/Form/Dropzone.svelte b/packages/bbui/src/Form/Dropzone.svelte index 2a6fa1c57b..94742ea08d 100644 --- a/packages/bbui/src/Form/Dropzone.svelte +++ b/packages/bbui/src/Form/Dropzone.svelte @@ -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} /> diff --git a/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte b/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte index a27c31bbe5..4e2a6025e5 100644 --- a/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte @@ -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} diff --git a/packages/shared-core/src/constants.ts b/packages/shared-core/src/constants.ts index 312e69c896..e7c6feb20a 100644 --- a/packages/shared-core/src/constants.ts +++ b/packages/shared-core/src/constants.ts @@ -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",