Apply valid file types to RowFieldControl and AttackmentField.

This commit is contained in:
Sam Rose 2023-10-27 16:53:32 +01:00
parent 6bb6f106d5
commit 5539ff9c9c
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -13,6 +13,7 @@
import { capitalise } from "helpers"
import LinkedRowSelector from "components/common/LinkedRowSelector.svelte"
import Editor from "../../integration/QueryEditor.svelte"
import { ValidFileExtensions } from "@budibase/shared-core"
export let defaultValue
export let meta
@ -20,6 +21,8 @@
export let readonly
export let error
let validExtensions = ValidFileExtensions.map(ext => `.${ext}`).join(", ")
const resolveTimeStamp = timestamp => {
if (!timestamp) {
return null
@ -59,7 +62,7 @@
bind:value
/>
{:else if type === "attachment"}
<Dropzone {label} {error} bind:value />
<Dropzone {label} {error} extensions={validExtensions} bind:value />
{:else if type === "boolean"}
<Toggle text={label} {error} bind:value />
{:else if type === "array" && meta.constraints.inclusion.length !== 0}

View File

@ -2,13 +2,14 @@
import Field from "./Field.svelte"
import { CoreDropzone } from "@budibase/bbui"
import { getContext } from "svelte"
import { ValidFileExtensions } from "@budibase/shared-core"
export let field
export let label
export let disabled = false
export let compact = false
export let validation
export let extensions
export let extensions = ValidFileExtensions.map(ext => `.${ext}`).join(", ")
export let onChange
export let maximum = undefined