Fixed issues in app sdk for liquid

This commit is contained in:
frikky
2021-08-11 13:42:44 +02:00
parent e8b7b2b444
commit 7f65c98f94
4 changed files with 22 additions and 7 deletions
+18 -3
View File
@@ -1512,10 +1512,22 @@ class AppBase:
return returndata, is_loop
def parse_liquid(template):
#print("Inside liquid with glob: %s" % globals())
try:
if len(template) > 250000:
print("Skipping liquid - size is %d" % len(template))
return template
if not "{{" in template or not "}}" in template:
print("Skipping liquid - missing {{ }} ")
return template
#if not "{{" in template or not "}}" in template:
# return template
#print(globals())
print("Running with \"%s\"" % template)
print("Running liquid with data of length %d" % len(template))
run = Liquid(template, {'mode': 'python'})
ret = run.render(**globals())
return ret
@@ -1533,6 +1545,9 @@ class AppBase:
print("Render error: %s" % e)
except liquid.exceptions.LiquidSyntaxError as e:
print("Syntax error: %s" % e)
except:
print("General exception for liquid")
pass
return template
@@ -1670,13 +1685,13 @@ class AppBase:
# Just here in case it breaks
# Implemented 02.08.2021
print("Pre liquid: %s" % parameter["value"])
#print("Pre liquid: %s" % parameter["value"])
try:
parameter["value"] = parse_liquid(parameter["value"])
except:
pass
print("POST liquid: %s" % parameter["value"])
#print("POST liquid: %s" % parameter["value"])
return "", parameter["value"], is_loop
def run_validation(sourcevalue, check, destinationvalue):
+1 -1
View File
@@ -22,7 +22,7 @@ require (
github.com/docker/go-units v0.4.0 // indirect
github.com/elastic/go-elasticsearch/v7 v7.13.1 // indirect
github.com/frikky/kin-openapi v0.40.0
github.com/frikky/shuffle-shared v0.0.78
github.com/frikky/shuffle-shared v0.0.81
github.com/fsouza/go-dockerclient v1.7.2
github.com/ghodss/yaml v1.0.0
github.com/go-git/go-billy/v5 v5.0.0
+1 -1
View File
@@ -16,7 +16,7 @@ services:
depends_on:
- backend
backend:
#build: ./backend
build: ./backend
image: ghcr.io/frikky/shuffle-backend:nightly
container_name: shuffle-backend
hostname: ${BACKEND_HOSTNAME}
+2 -2
View File
@@ -1067,8 +1067,8 @@ const Workflows = (props) => {
}
var parsedName = data.name
if (parsedName !== undefined && parsedName !== null && parsedName.length > 22) {
parsedName = parsedName.slice(0,23)+".."
if (parsedName !== undefined && parsedName !== null && parsedName.length > 20) {
parsedName = parsedName.slice(0,21)+".."
}
const actions = data.actions !== null ? data.actions.length : 0