From 5923ae2983d588d1f1d5a5fd3550a04cda47d671 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 1 Nov 2023 16:40:23 +0000 Subject: [PATCH] Make form block view readonly --- packages/bbui/src/Markdown/MarkdownEditor.svelte | 2 +- packages/client/manifest.json | 7 +------ .../src/components/app/blocks/form/InnerFormBlock.svelte | 3 ++- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/bbui/src/Markdown/MarkdownEditor.svelte b/packages/bbui/src/Markdown/MarkdownEditor.svelte index 27035d8033..225d25a0eb 100644 --- a/packages/bbui/src/Markdown/MarkdownEditor.svelte +++ b/packages/bbui/src/Markdown/MarkdownEditor.svelte @@ -56,7 +56,7 @@ easyMDEOptions={{ initialValue: value, placeholder, - toolbar: readonly ? false : undefined, + toolbar: disabled || readonly ? false : undefined, ...easyMDEOptions, }} /> diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 7559825267..749e2cf194 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -5640,12 +5640,7 @@ "type": "boolean", "label": "Disabled", "key": "disabled", - "defaultValue": false, - "dependsOn": { - "setting": "actionType", - "value": "View", - "invert": true - } + "defaultValue": false } ] }, diff --git a/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte b/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte index f7e9a0d2ed..b2c9888c73 100644 --- a/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte +++ b/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte @@ -136,7 +136,8 @@ actionType: actionType === "Create" ? "Create" : "Update", dataSource, size, - disabled: disabled || actionType === "View", + disabled, + readonly: !disabled && actionType === "View", }} styles={{ normal: {