1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Field readonly

This commit is contained in:
Adria Navarro 2024-07-18 13:34:15 +02:00
parent 1843233168
commit b75c8b32e3
3 changed files with 8 additions and 0 deletions

View file

@ -869,6 +869,7 @@
options={value.enum} options={value.enum}
getOptionLabel={(x, idx) => getOptionLabel={(x, idx) =>
value.pretty ? value.pretty[idx] : x} value.pretty ? value.pretty[idx] : x}
disabled={value.readonly}
/> />
{:else if value.type === "json"} {:else if value.type === "json"}
<Editor <Editor
@ -877,6 +878,7 @@
mode="json" mode="json"
value={inputData[key]?.value} value={inputData[key]?.value}
on:change={e => onChange({ [key]: e.detail })} on:change={e => onChange({ [key]: e.detail })}
readOnly={value.readonly}
/> />
{:else if value.type === "boolean"} {:else if value.type === "boolean"}
<div style="margin-top: 10px"> <div style="margin-top: 10px">
@ -884,6 +886,7 @@
text={value.title} text={value.title}
value={inputData[key]} value={inputData[key]}
on:change={e => onChange({ [key]: e.detail })} on:change={e => onChange({ [key]: e.detail })}
disabled={value.readonly}
/> />
</div> </div>
{:else if value.type === "date"} {:else if value.type === "date"}
@ -897,6 +900,7 @@
allowJS={true} allowJS={true}
updateOnChange={false} updateOnChange={false}
drawerLeft="260px" drawerLeft="260px"
disabled={value.readonly}
> >
<DatePicker <DatePicker
value={inputData[key]} value={inputData[key]}
@ -908,6 +912,7 @@
on:change={e => onChange({ [key]: e.detail })} on:change={e => onChange({ [key]: e.detail })}
value={inputData[key]} value={inputData[key]}
options={Object.keys(table?.schema || {})} options={Object.keys(table?.schema || {})}
disabled={value.readonly}
/> />
{:else if value.type === "attachment" || value.type === "signature_single"} {:else if value.type === "attachment" || value.type === "signature_single"}
<div class="attachment-field-wrapper"> <div class="attachment-field-wrapper">
@ -1021,6 +1026,7 @@
{isTrigger} {isTrigger}
value={inputData[key]} value={inputData[key]}
on:change={e => onChange({ [key]: e.detail })} on:change={e => onChange({ [key]: e.detail })}
disabled={value.readonly}
/> />
{:else if value.customType === "webhookUrl"} {:else if value.customType === "webhookUrl"}
<WebhookDisplay value={inputData[key]} /> <WebhookDisplay value={inputData[key]} />

View file

@ -76,6 +76,7 @@ export async function create(tableId: string, rowAction: { name: string }) {
type: AutomationIOType.STRING, type: AutomationIOType.STRING,
customType: AutomationCustomIOType.TABLE, customType: AutomationCustomIOType.TABLE,
title: "Table", title: "Table",
readonly: true,
}, },
}, },
required: ["tableId"], required: ["tableId"],

View file

@ -153,6 +153,7 @@ interface BaseIOStructure {
[key: string]: BaseIOStructure [key: string]: BaseIOStructure
} }
required?: string[] required?: string[]
readonly?: true
} }
export interface InputOutputBlock { export interface InputOutputBlock {