From 0191dca347800a1f95ce7184db0b21e4ebb6c796 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Wed, 15 May 2024 16:09:48 +0200 Subject: [PATCH] feat(frontend): Add context section (#3745) * feat(frontend): Add context section * feat(frontend): Add missing tooltip --- frontend/src/lib/components/Tooltip.svelte | 11 +++- .../settingsPanel/ComponentPanel.svelte | 3 + .../settingsPanel/ContextVariables.svelte | 66 +++++++++++++++++++ 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 frontend/src/lib/components/apps/editor/settingsPanel/ContextVariables.svelte diff --git a/frontend/src/lib/components/Tooltip.svelte b/frontend/src/lib/components/Tooltip.svelte index 92294de81f..feee0dd3a1 100644 --- a/frontend/src/lib/components/Tooltip.svelte +++ b/frontend/src/lib/components/Tooltip.svelte @@ -10,13 +10,18 @@ export let documentationLink: string | undefined = undefined export let small = false export let markdownTooltip: string | undefined = undefined - export let customSize: string = '100%'; + export let customSize: string = '100%' const plugins = [gfmPlugin()] - +
diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte index f860ea054b..fabdbc76e9 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte @@ -39,6 +39,7 @@ import DecisionTreeGraphEditor from './DecisionTreeGraphEditor.svelte' import GridAgChartsLicenseKe from './GridAgChartsLicenseKe.svelte' import Toggle from '$lib/components/Toggle.svelte' + import ContextVariables from './ContextVariables.svelte' export let componentSettings: { item: GridItem; parent: string | undefined } | undefined = undefined @@ -289,6 +290,8 @@ {/if}
{/if} + + {#key $stateId} {#if componentSettings.item.data.componentInput?.type === 'runnable'} {#if Object.keys(componentSettings.item.data.componentInput.fields ?? {}).length > 0} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/ContextVariables.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/ContextVariables.svelte new file mode 100644 index 0000000000..5fe8b5b809 --- /dev/null +++ b/frontend/src/lib/components/apps/editor/settingsPanel/ContextVariables.svelte @@ -0,0 +1,66 @@ + + +{#if contextVariables.length > 0} +
+
+
Context
+ + Context are variables available in any expressions of config and runnable inputs that are + specific to this particular component. Hover over the variables to see their descriptions. + +
+
+ {#each contextVariables as contextVariable} + + + {contextVariable.description} + + + + {contextVariable.label} + + + {/each} +
+
+{/if}