Add rich text option to long form data type

This commit is contained in:
Andrew Kingston 2022-02-07 12:04:43 +00:00
parent 587a260c2b
commit d12cd2abdf
2 changed files with 20 additions and 2 deletions

View File

@ -7,6 +7,7 @@
Multiselect,
Label,
RichTextField,
TextArea,
} from "@budibase/bbui"
import Dropzone from "components/common/Dropzone.svelte"
import { capitalise } from "helpers"
@ -43,7 +44,11 @@
{:else if type === "link"}
<LinkedRowSelector bind:linkedRows={value} schema={meta} />
{:else if type === "longform"}
<RichTextField {label} height="200px" bind:value />
{#if meta.useRichText}
<RichTextField {label} height="150px" bind:value />
{:else}
<TextArea {label} height="150px" bind:value />
{/if}
{:else if type === "json"}
<Label>{label}</Label>
<Editor

View File

@ -367,7 +367,7 @@
{#if canBeSearched && !external}
<div>
<Label grey small>Search Indexes</Label>
<Label>Search Indexes</Label>
<Toggle
value={indexes[0] === field.name}
disabled={indexes[1] === field.name}
@ -394,6 +394,19 @@
label="Options (one per line)"
bind:values={field.constraints.inclusion}
/>
{:else if field.type === "longform"}
<div>
<Label
size="M"
tooltip="Rich text includes support for images, links, tables, lists and more"
>
Formatting
</Label>
<Toggle
bind:value={field.useRichText}
text="Enable rich text support (markdown)"
/>
</div>
{:else if field.type === "array"}
<ValuesList
label="Options (one per line)"