Fixed regex parsing for action variables

This commit is contained in:
frikky
2020-06-19 20:42:34 +02:00
parent 1efad4547a
commit 4a6595e56a
2 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -415,7 +415,7 @@ class AppBase:
def parse_params(action, fullexecution, parameter): def parse_params(action, fullexecution, parameter):
# Skip if it starts with $? # Skip if it starts with $?
jsonparsevalue = "$." jsonparsevalue = "$."
match = ".*([$]{1}([a-zA-Z0-9()# _-]+\.?){1,})" match = ".*([$]{1}([a-zA-Z0-9# _-]+\.?){1,})"
# Regex to find all the things # Regex to find all the things
if parameter["variant"] == "STATIC_VALUE": if parameter["variant"] == "STATIC_VALUE":
@@ -424,6 +424,7 @@ class AppBase:
#self.logger.debug(f"\n\nHandle static data with JSON: {data}\n\n") #self.logger.debug(f"\n\nHandle static data with JSON: {data}\n\n")
#self.logger.info("STATIC PARSED: %s" % actualitem) #self.logger.info("STATIC PARSED: %s" % actualitem)
if len(actualitem) > 0: if len(actualitem) > 0:
print("ACTUAL: %s", actualitem)
for replace in actualitem: for replace in actualitem:
try: try:
to_be_replaced = replace[0] to_be_replaced = replace[0]
+10 -3
View File
@@ -1455,7 +1455,7 @@ const AngularWorkflow = (props) => {
return ( return (
<div style={appViewStyle}> <div style={appViewStyle}>
<div style={variableScrollStyle}> <div style={variableScrollStyle}>
<a href="https://shuffler.io/docs/workflows#variables" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>What are WORKFLOW variables?</a> What are <a href="https://shuffler.io/docs/workflows#variables" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>WORKFLOW variables?</a>
{workflow.workflow_variables === null ? {workflow.workflow_variables === null ?
null : workflow.workflow_variables.map(variable=> { null : workflow.workflow_variables.map(variable=> {
return ( return (
@@ -1519,8 +1519,8 @@ const AngularWorkflow = (props) => {
<Button fullWidth style={{margin: "auto", marginTop: "10px",}} color="primary" variant="outlined" onClick={() => setVariablesModalOpen(true)}>New workflow variable</Button> <Button fullWidth style={{margin: "auto", marginTop: "10px",}} color="primary" variant="outlined" onClick={() => setVariablesModalOpen(true)}>New workflow variable</Button>
</div> </div>
<Divider style={{marginBottom: 20, marginTop: 20, height: 1, width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginBottom: 20, marginTop: 20, height: 1, width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
<a href="https://shuffler.io/docs/workflows#execution_variables" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>What are EXECUTION variables?</a> What are <a href="https://shuffler.io/docs/workflows#execution_variables" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>EXECUTION variables?</a>
{workflow.execution_variables === null ? {workflow.execution_variables === null || workflow.execution_variables === undefined ?
null : workflow.execution_variables.map(variable=> { null : workflow.execution_variables.map(variable=> {
return ( return (
<div> <div>
@@ -2142,7 +2142,14 @@ const AngularWorkflow = (props) => {
// appname & version // appname & version
// description // description
// ACTION select // ACTION select
//
const selectedNameChange = (event) => { const selectedNameChange = (event) => {
event.target.value = event.target.value.replace("(", "")
event.target.value = event.target.value.replace(")", "")
event.target.value = event.target.value.replace("$", "")
event.target.value = event.target.value.replace("#", "")
event.target.value = event.target.value.replace(".", "")
event.target.value = event.target.value.replace(",", "")
selectedAction.label = event.target.value selectedAction.label = event.target.value
setSelectedAction(selectedAction) setSelectedAction(selectedAction)
} }