From 7277056ef0ac43a2e2ae66447f4cbaacb79f37d9 Mon Sep 17 00:00:00 2001 From: Henri Courdent <122811744+hcourdent@users.noreply.github.com> Date: Fri, 28 Apr 2023 19:52:30 +0200 Subject: [PATCH] First wave of tooltips linking to docs (#1493) Co-authored-by: Ruben Fiszel --- frontend/src/lib/components/EditorBar.svelte | 7 ++ frontend/src/lib/components/ItemPicker.svelte | 4 +- frontend/src/lib/components/PageHeader.svelte | 4 +- frontend/src/lib/components/Path.svelte | 3 +- frontend/src/lib/components/SchemaForm.svelte | 2 + .../src/lib/components/ScriptBuilder.svelte | 16 +++-- .../components/apps/editor/AppEditor.svelte | 2 +- .../lib/components/common/alert/Alert.svelte | 7 +- .../common/drawer/DrawerContent.svelte | 9 ++- .../flows/content/FlowInputs.svelte | 13 ++-- .../flows/content/FlowSettings.svelte | 68 +++++++++++-------- .../(root)/(logged)/folders/+page.svelte | 1 + .../(root)/(logged)/groups/+page.svelte | 1 + .../(root)/(logged)/resources/+page.svelte | 3 +- .../(logged)/runs/[...path]/+page.svelte | 1 + .../(root)/(logged)/schedules/+page.svelte | 2 +- .../(root)/(logged)/variables/+page.svelte | 1 + .../(root)/(logged)/workers/+page.svelte | 1 + frontend/windmillhub | 1 + 19 files changed, 98 insertions(+), 48 deletions(-) create mode 160000 frontend/windmillhub diff --git a/frontend/src/lib/components/EditorBar.svelte b/frontend/src/lib/components/EditorBar.svelte index 4c4cd2db91..bfb74c47d6 100644 --- a/frontend/src/lib/components/EditorBar.svelte +++ b/frontend/src/lib/components/EditorBar.svelte @@ -129,6 +129,9 @@ } sendUserToast(`${name} inserted at cursor`) }} + tooltip="Contextual Variables are variables whose values are contextual to the Script + execution. They are are automatically set by Windmill." + documentationLink="https://docs.windmill.dev/docs/core_concepts/variables_and_secrets#contextual-variables" itemName="Contextual Variable" extraField="name" loadItems={loadContextualVariables} @@ -162,6 +165,8 @@ } sendUserToast(`${name} inserted at cursor`) }} + tooltip="Variables are dynamic values that have a key associated to them and can be retrieved during the execution of a Script or Flow." + documentationLink="https://docs.windmill.dev/docs/core_concepts/variables_and_secrets" itemName="Variable" extraField="path" loadItems={loadVariables} @@ -210,6 +215,8 @@ } sendUserToast(`${path} inserted at cursor`) }} + tooltip="Resources represent connections to third party systems. Resources are a good way to define a connection to a frequently used third party system such as a database." + documentationLink="https://docs.windmill.dev/docs/core_concepts/resources_and_types" itemName="Resource" buttons={{ 'Edit/View': (x) => resourceEditor.initEdit(x) }} extraField="description" diff --git a/frontend/src/lib/components/ItemPicker.svelte b/frontend/src/lib/components/ItemPicker.svelte index e9080c8930..3a7e5f8f3e 100644 --- a/frontend/src/lib/components/ItemPicker.svelte +++ b/frontend/src/lib/components/ItemPicker.svelte @@ -16,6 +16,8 @@ export let noItemMessage = 'There are no items in the list' /** Displayed if the search returns no items. */ export let buttons: Record void> = {} + export let tooltip: string = '' + export let documentationLink: string | undefined = undefined let loading = false let items: Item[] | undefined = [] @@ -48,7 +50,7 @@ /> - +

{title}

- {#if tooltip || documentationLink} + {#if tooltip != '' || documentationLink} {tooltip} {/if} {:else}

{title}

- {#if tooltip} + {#if tooltip != '' || documentationLink} {tooltip} {/if}
diff --git a/frontend/src/lib/components/Path.svelte b/frontend/src/lib/components/Path.svelte index 77d01f3291..708e72f9ee 100644 --- a/frontend/src/lib/components/Path.svelte +++ b/frontend/src/lib/components/Path.svelte @@ -312,7 +312,8 @@