From 3da446ece5fa7b1e10430c15234c3bb10fb5e68e Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 9 Jan 2023 18:46:59 +0100 Subject: [PATCH] fix infering schema for inlineeditor --- backend/windmill-api/openapi.yaml | 8 +++++++- .../editor/inlineScriptsPanel/InlineScriptEditor.svelte | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 7dbc19a683..84be3c1387 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -2986,7 +2986,7 @@ paths: - $ref: "#/components/parameters/CreatedAfter" - $ref: "#/components/parameters/Success" - $ref: "#/components/parameters/JobKinds" - + - $ref: "#/components/parameters/Suspend" responses: "200": description: All available queued jobs @@ -4419,6 +4419,12 @@ components: in: query schema: type: boolean + Suspend: + name: suspend + description: filter on suspended jobs + in: query + schema: + type: boolean After: name: after description: filter on created after (exclusive) timestamp diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte index 6d2c17c76c..93e15dd0c6 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte @@ -11,7 +11,7 @@ import Badge from '$lib/components/common/badge/Badge.svelte' import { fly } from 'svelte/transition' import Editor from '$lib/components/Editor.svelte' - import { scriptLangToEditorLang } from '$lib/utils' + import { emptySchema, scriptLangToEditorLang } from '$lib/utils' import Tooltip from '$lib/components/Tooltip.svelte' let inlineScriptEditorDrawer: InlineScriptEditorDrawer @@ -42,11 +42,11 @@ } onMount(async () => { - if (inlineScript) { + if (inlineScript && !inlineScript.schema) { inlineScript.schema = await inferInlineScriptSchema( inlineScript?.language, inlineScript?.content, - inlineScript?.schema + emptySchema() ) } })