From 4af39f081bf3d07aaade39e5a5a221741fe8f973 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Thu, 6 Apr 2023 16:02:10 +0200 Subject: [PATCH] fix(frontend): Fix connected property (#1371) * fix(frontend): Fix connected property * fix(frontend): fix connected property * fix(frontend): fix connected property --- frontend/src/lib/components/InputTransformForm.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/InputTransformForm.svelte b/frontend/src/lib/components/InputTransformForm.svelte index a8625fac13..d29b49ded3 100644 --- a/frontend/src/lib/components/InputTransformForm.svelte +++ b/frontend/src/lib/components/InputTransformForm.svelte @@ -40,17 +40,24 @@ schema.properties[argName].enum, schema.properties[argName].contentEncoding ) + let propertyType = getPropertyType(arg) function getPropertyType(arg: InputTransform | any): 'static' | 'javascript' { let type: 'static' | 'javascript' = arg?.type ?? 'static' - if (type == 'javascript') { + + if ( + type == 'javascript' && + isStaticTemplate(inputCat) && + (arg?.expr?.length === 0 || arg?.expr?.[0] === '`') + ) { const newValue = codeToStaticTemplate(arg.expr) if (newValue) { type = 'static' arg.value = newValue } } + return type }