1
0
Fork 0
mirror of synced 2024-08-03 04:12:03 +12:00

Display single attachment in form

This commit is contained in:
Adria Navarro 2024-03-26 14:08:44 +01:00
parent 6d5c47e0cc
commit f41da36995
2 changed files with 8 additions and 1 deletions

View file

@ -66,6 +66,11 @@
maximum: schema?.constraints?.length?.maximum, maximum: schema?.constraints?.length?.maximum,
} }
}, },
[FieldType.ATTACHMENT_SINGLE]: () => {
return {
type: FieldType.ATTACHMENT_SINGLE,
}
},
} }
const fieldSchema = getFieldSchema(field) const fieldSchema = getFieldSchema(field)

View file

@ -1,6 +1,7 @@
<script> <script>
import Field from "./Field.svelte" import Field from "./Field.svelte"
import { CoreDropzone } from "@budibase/bbui" import { CoreDropzone } from "@budibase/bbui"
import { FieldType } from "@budibase/types"
import { getContext } from "svelte" import { getContext } from "svelte"
export let field export let field
@ -14,6 +15,7 @@
export let maximum = undefined export let maximum = undefined
export let span export let span
export let helpText = null export let helpText = null
export let type = FieldType.ATTACHMENT
let fieldState let fieldState
let fieldApi let fieldApi
@ -78,7 +80,7 @@
{validation} {validation}
{span} {span}
{helpText} {helpText}
type="attachment" {type}
bind:fieldState bind:fieldState
bind:fieldApi bind:fieldApi
defaultValue={[]} defaultValue={[]}