Apply valid file types to RowFieldControl and AttackmentField.
This commit is contained in:
parent
6bb6f106d5
commit
5539ff9c9c
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue