From 0b21c36526c65bbb107d0022d1bfba00f205a150 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:26:52 +0000 Subject: [PATCH 1/2] Use blur for change event RichTextField (#12649) * Use blur for change event RichTextField * Refactor --- packages/bbui/src/Markdown/MarkdownEditor.svelte | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/bbui/src/Markdown/MarkdownEditor.svelte b/packages/bbui/src/Markdown/MarkdownEditor.svelte index 888187c8da..2f18c9d634 100644 --- a/packages/bbui/src/Markdown/MarkdownEditor.svelte +++ b/packages/bbui/src/Markdown/MarkdownEditor.svelte @@ -19,7 +19,7 @@ // Ensure the value is updated if the value prop changes outside the editor's // control $: checkValue(value) - $: mde?.codemirror.on("change", debouncedUpdate) + $: mde?.codemirror.on("blur", update) $: if (readonly || disabled) { mde?.togglePreview() } @@ -30,21 +30,10 @@ } } - const debounce = (fn, interval) => { - let timeout - return () => { - clearTimeout(timeout) - timeout = setTimeout(fn, interval) - } - } - const update = () => { latestValue = mde.value() dispatch("change", latestValue) } - - // Debounce the update function to avoid spamming it constantly - const debouncedUpdate = debounce(update, 250) {#key height} From 8a44c240213af211c7da8a7e6c41af83c55ea507 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:54:18 +0000 Subject: [PATCH 2/2] Handle object type in validation (#12619) --- .../backend/Datasources/ConfigEditor/stores/validation.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/Datasources/ConfigEditor/stores/validation.js b/packages/builder/src/components/backend/Datasources/ConfigEditor/stores/validation.js index 08331b840d..2ec9539824 100644 --- a/packages/builder/src/components/backend/Datasources/ConfigEditor/stores/validation.js +++ b/packages/builder/src/components/backend/Datasources/ConfigEditor/stores/validation.js @@ -1,4 +1,4 @@ -import { string, number } from "yup" +import { string, number, object } from "yup" const propertyValidator = type => { if (type === "number") { @@ -9,6 +9,10 @@ const propertyValidator = type => { return string().email().nullable() } + if (type === "object") { + return object().nullable() + } + return string().nullable() }