Apply valid file types to AttachmentCell.
This commit is contained in:
parent
2160f4e5e2
commit
6bb6f106d5
|
@ -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>
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue