fix(frontend): Fix connected property (#1371)

* fix(frontend): Fix connected property

* fix(frontend): fix connected property

* fix(frontend): fix connected property
This commit is contained in:
Faton Ramadani
2023-04-06 16:02:10 +02:00
committed by GitHub
parent 3a6b655ba8
commit 4af39f081b
@@ -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
}