diff --git a/frontend/src/lib/components/Toggle.svelte b/frontend/src/lib/components/Toggle.svelte index dfc9ca3824..ff81886338 100644 --- a/frontend/src/lib/components/Toggle.svelte +++ b/frontend/src/lib/components/Toggle.svelte @@ -1,4 +1,5 @@ {#if componentSettings} @@ -99,6 +101,7 @@
@@ -114,13 +117,6 @@ {/key} {/if} - - {#if hiddenInlineScript.script.inlineScript?.language === 'frontend'} - -
Frontend cannot have inputs
-
- {/if} -
{/if} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte index 53250ebbd7..ee4bc29a03 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte @@ -43,15 +43,8 @@ /> {/if} + - ('AppViewerContext')
- { - const autoRefresh = !script.autoRefresh - if ($runnableComponents?.[id]?.autoRefresh !== autoRefresh && autoRefresh !== undefined) { - $runnableComponents[id] = { - ...$runnableComponents[id], - autoRefresh + + {#if hasScript} + { + const autoRefresh = !script.autoRefresh + if ($runnableComponents?.[id]?.autoRefresh !== autoRefresh && autoRefresh !== undefined) { + $runnableComponents[id] = { + ...$runnableComponents[id], + autoRefresh + } } - } - }} - /> - + }} + /> + + {:else} + +
Please configure the language in the inline script panel
+
+ {/if}
diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptRunConfiguration.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptRunConfiguration.svelte index 1a8552d2ee..fb629a7147 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptRunConfiguration.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptRunConfiguration.svelte @@ -2,6 +2,7 @@ import Tooltip from '$lib/components/Tooltip.svelte' import { createEventDispatcher } from 'svelte' import ScriptSettingsSection from './ScriptSettingsSection.svelte' + import Toggle from '$lib/components/Toggle.svelte' export let autoRefresh: boolean | undefined = false export let recomputeOnInputChanged: boolean | undefined = false @@ -13,22 +14,21 @@ {#if canConfigureRecomputeOnInputChanged || canConfigureRunOnStart} -
+
{#if autoRefresh !== undefined && canConfigureRunOnStart}
Run on start and app refresh - + You may want to disable this so that the background script is only triggered by changes to other values or triggered by another computation on a button (See 'Recompute Others')
- { + size="xs" + on:change={() => { dispatch('updateAutoRefresh') }} /> @@ -39,10 +39,13 @@
Recompute on any input changes
- { + dispatch('updateAutoRefresh') + }} />
{/if} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptTransformer.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptTransformer.svelte index 4b208b8b1c..b00c6807e6 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptTransformer.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/script/shared/ScriptTransformer.svelte @@ -2,9 +2,10 @@ import type { ResultAppInput } from '$lib/components/apps/inputType' import type { AppEditorContext } from '$lib/components/apps/types' import { getContext } from 'svelte' - import ScriptSettingsSection from './ScriptSettingsSection.svelte' import type { AppComponent } from '../../../component' import { Button } from '$lib/components/common' + import Tooltip from '$lib/components/Tooltip.svelte' + import { Plus, X } from 'lucide-svelte' const { selectedComponentInEditor } = getContext('AppEditorContext') @@ -14,11 +15,15 @@ $: checked = Boolean(appInput.transformer) - -
+
+
+
+ Transformer + + + {"A transformer is an optional frontend script that is executed right after the component's script whose purpose is to do lightweight transformation in the browser. It takes the previous computation's result as `result`"} + +
- +