From b75c8b32e3454076fdb0a2cb2a9803520e95f91c Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 Jul 2024 13:34:15 +0200 Subject: [PATCH] Field readonly --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 6 ++++++ packages/server/src/sdk/app/rowActions.ts | 1 + packages/types/src/documents/app/automation.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 8a9d1e59ea..c6f760bd0e 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -869,6 +869,7 @@ options={value.enum} getOptionLabel={(x, idx) => value.pretty ? value.pretty[idx] : x} + disabled={value.readonly} /> {:else if value.type === "json"} onChange({ [key]: e.detail })} + readOnly={value.readonly} /> {:else if value.type === "boolean"}
@@ -884,6 +886,7 @@ text={value.title} value={inputData[key]} on:change={e => onChange({ [key]: e.detail })} + disabled={value.readonly} />
{:else if value.type === "date"} @@ -897,6 +900,7 @@ allowJS={true} updateOnChange={false} drawerLeft="260px" + disabled={value.readonly} > onChange({ [key]: e.detail })} value={inputData[key]} options={Object.keys(table?.schema || {})} + disabled={value.readonly} /> {:else if value.type === "attachment" || value.type === "signature_single"}
@@ -1021,6 +1026,7 @@ {isTrigger} value={inputData[key]} on:change={e => onChange({ [key]: e.detail })} + disabled={value.readonly} /> {:else if value.customType === "webhookUrl"} diff --git a/packages/server/src/sdk/app/rowActions.ts b/packages/server/src/sdk/app/rowActions.ts index 6a6e5670f4..1846ff4659 100644 --- a/packages/server/src/sdk/app/rowActions.ts +++ b/packages/server/src/sdk/app/rowActions.ts @@ -76,6 +76,7 @@ export async function create(tableId: string, rowAction: { name: string }) { type: AutomationIOType.STRING, customType: AutomationCustomIOType.TABLE, title: "Table", + readonly: true, }, }, required: ["tableId"], diff --git a/packages/types/src/documents/app/automation.ts b/packages/types/src/documents/app/automation.ts index 3407b1a6fd..f29a2241cd 100644 --- a/packages/types/src/documents/app/automation.ts +++ b/packages/types/src/documents/app/automation.ts @@ -153,6 +153,7 @@ interface BaseIOStructure { [key: string]: BaseIOStructure } required?: string[] + readonly?: true } export interface InputOutputBlock {