Fixed workflow variable deletion and control without state updates (speed)

This commit is contained in:
frikky
2022-01-14 23:10:03 +01:00
parent 59d90d1c28
commit e77bcac26f
8 changed files with 467 additions and 379 deletions
+5 -1
View File
@@ -2995,7 +2995,11 @@ class AppBase:
self.logger.info(f"Failed to execute: {e}") self.logger.info(f"Failed to execute: {e}")
self.logger.exception(f"Failed to execute {e}-{action['id']}") self.logger.exception(f"Failed to execute {e}-{action['id']}")
self.action_result["status"] = "FAILURE" self.action_result["status"] = "FAILURE"
self.action_result["result"] = f"General exception: {e}" #self.action_result["result"] = f"General exception: {e}"
self.action_result["result"] = json.dumps({
"success": False,
"reason": f"General exception: {e}",
})
self.action_result["completed_at"] = int(time.time()) self.action_result["completed_at"] = int(time.time())
+90 -88
View File
@@ -421,100 +421,102 @@ const ParsedAction = (props) => {
} }
// Loops parent nodes' old results to fix autocomplete // Loops parent nodes' old results to fix autocomplete
var parents = getParents(selectedAction); if (getParents !== undefined) {
if (parents.length > 1) { var parents = getParents(selectedAction);
for (var key in parents) { if (parents.length > 1) {
const item = parents[key]; for (var key in parents) {
if (item.label === "Execution Argument") { const item = parents[key];
continue; if (item.label === "Execution Argument") {
} continue;
}
var exampledata = item.example === undefined ? "" : item.example; var exampledata = item.example === undefined ? "" : item.example;
// Find previous execution and their variables // Find previous execution and their variables
//exampledata === "" && //exampledata === "" &&
if (workflowExecutions.length > 0) { if (workflowExecutions.length > 0) {
// Look for the ID // Look for the ID
const found = false; const found = false;
for (var key in workflowExecutions) { for (var key in workflowExecutions) {
if ( if (
workflowExecutions[key].results === undefined || workflowExecutions[key].results === undefined ||
workflowExecutions[key].results === null workflowExecutions[key].results === null
) { ) {
continue; continue;
} }
var foundResult = workflowExecutions[key].results.find( var foundResult = workflowExecutions[key].results.find(
(result) => result.action.id === item.id (result) => result.action.id === item.id
); );
if (foundResult === undefined) { if (foundResult === undefined) {
continue; continue;
} }
foundResult.result = foundResult.result.trim(); foundResult.result = foundResult.result.trim();
foundResult.result = foundResult.result foundResult.result = foundResult.result
.split(" None") .split(" None")
.join(' "None"'); .join(' "None"');
foundResult.result = foundResult.result foundResult.result = foundResult.result
.split(" False") .split(" False")
.join(" false"); .join(" false");
foundResult.result = foundResult.result foundResult.result = foundResult.result
.split(" True") .split(" True")
.join(" true"); .join(" true");
var jsonvalid = true; var jsonvalid = true;
try { try {
const tmp = String(JSON.parse(foundResult.result)); const tmp = String(JSON.parse(foundResult.result));
if ( if (
!foundResult.result.includes("{") && !foundResult.result.includes("{") &&
!foundResult.result.includes("[") !foundResult.result.includes("[")
) { ) {
jsonvalid = false; jsonvalid = false;
} }
} catch (e) { } catch (e) {
try { try {
foundResult.result = foundResult.result foundResult.result = foundResult.result
.split("'") .split("'")
.join('"'); .join('"');
const tmp = String(JSON.parse(foundResult.result)); const tmp = String(JSON.parse(foundResult.result));
if ( if (
!foundResult.result.includes("{") && !foundResult.result.includes("{") &&
!foundResult.result.includes("[") !foundResult.result.includes("[")
) { ) {
jsonvalid = false; jsonvalid = false;
} }
} catch (e) { } catch (e) {
jsonvalid = false; jsonvalid = false;
} }
} }
// Finds the FIRST json only // Finds the FIRST json only
if (jsonvalid) { if (jsonvalid) {
exampledata = JSON.parse(foundResult.result); exampledata = JSON.parse(foundResult.result);
break; break;
} }
//else { //else {
// console.log("Invalid JSON: ", foundResult.result) // console.log("Invalid JSON: ", foundResult.result)
//} //}
} }
} }
// 1. Take // 1. Take
const itemlabelComplete = const itemlabelComplete =
item.label === null || item.label === undefined item.label === null || item.label === undefined
? "" ? ""
: item.label.split(" ").join("_"); : item.label.split(" ").join("_");
const actionvalue = { const actionvalue = {
type: "action", type: "action",
id: item.id, id: item.id,
name: item.label, name: item.label,
autocomplete: itemlabelComplete, autocomplete: itemlabelComplete,
example: exampledata, example: exampledata,
}; };
actionlist.push(actionvalue); actionlist.push(actionvalue);
} }
} }
setActionlist(actionlist); setActionlist(actionlist);
}
} }
}); });
@@ -897,7 +899,7 @@ const ParsedAction = (props) => {
selectedActionParameters[count].variant = data; selectedActionParameters[count].variant = data;
selectedActionParameters[count].value = ""; selectedActionParameters[count].value = "";
if (data === "ACTION_RESULT") { if (data === "ACTION_RESULT" && getParents !== undefined) {
var parents = getParents(selectedAction); var parents = getParents(selectedAction);
if (parents.length > 0) { if (parents.length > 0) {
selectedActionParameters[count].action_field = parents[0].label; selectedActionParameters[count].action_field = parents[0].label;
+348 -280
View File
@@ -259,6 +259,7 @@ const AngularWorkflow = (defaultprops) => {
const [history, setHistory] = React.useState([]); const [history, setHistory] = React.useState([]);
const [historyIndex, setHistoryIndex] = React.useState(history.length); const [historyIndex, setHistoryIndex] = React.useState(history.length);
const [variableInfo, setVariableInfo] = React.useState({})
const [appAuthentication, setAppAuthentication] = React.useState([]); const [appAuthentication, setAppAuthentication] = React.useState([]);
const [variablesModalOpen, setVariablesModalOpen] = React.useState(false); const [variablesModalOpen, setVariablesModalOpen] = React.useState(false);
@@ -267,11 +268,9 @@ const AngularWorkflow = (defaultprops) => {
const [authenticationModalOpen, setAuthenticationModalOpen] = const [authenticationModalOpen, setAuthenticationModalOpen] =
React.useState(false); React.useState(false);
const [conditionsModalOpen, setConditionsModalOpen] = React.useState(false); const [conditionsModalOpen, setConditionsModalOpen] = React.useState(false);
const [newVariableName, setNewVariableName] = React.useState("");
const [authenticationType, setAuthenticationType] = React.useState(""); const [authenticationType, setAuthenticationType] = React.useState("");
const [newVariableDescription, setNewVariableDescription] =
React.useState("");
const [newVariableValue, setNewVariableValue] = React.useState("");
const [workflowDone, setWorkflowDone] = React.useState(false); const [workflowDone, setWorkflowDone] = React.useState(false);
const [authLoaded, setAuthLoaded] = React.useState(false); const [authLoaded, setAuthLoaded] = React.useState(false);
const [localFirstrequest, setLocalFirstrequest] = React.useState(true); const [localFirstrequest, setLocalFirstrequest] = React.useState(true);
@@ -674,6 +673,7 @@ const AngularWorkflow = (defaultprops) => {
return response.json(); return response.json();
}) })
.then((responseJson) => { .then((responseJson) => {
console.log("RESPONSE: ", responseJson)
handleUpdateResults(responseJson, executionRequest); handleUpdateResults(responseJson, executionRequest);
}) })
.catch((error) => { .catch((error) => {
@@ -4200,18 +4200,26 @@ const AngularWorkflow = (defaultprops) => {
setAnchorEl(event.currentTarget); setAnchorEl(event.currentTarget);
}; };
const deleteVariable = (variableName) => { const deleteVariable = (variableIndex) => {
console.log("Delete:", variableName); //console.log("Delete:", variableName);
workflow.workflow_variables = workflow.workflow_variables.filter( if (workflow.workflow_variables !== undefined && workflow.workflow_variables !== null && workflow.workflow_variables.length > variableIndex) {
(data) => data.name !== variableName workflow.workflow_variables.splice(variableIndex, 1)
); }
//workflow.workflow_variables = workflow.workflow_variables.filter(
// (data) => data.name !== variableName
//);
setWorkflow(workflow); setWorkflow(workflow);
}; };
const deleteExecutionVariable = (variableName) => { const deleteExecutionVariable = (variableIndex) => {
workflow.execution_variables = workflow.execution_variables.filter( if (workflow.execution_variables !== undefined && workflow.execution_variables !== null && workflow.execution_variables.length > variableIndex) {
(data) => data.name !== variableName workflow.execution_variables.splice(variableIndex, 1)
); }
//workflow.execution_variables = workflow.execution_variables.filter(
// (data) => data.name !== variableName
//);
setWorkflow(workflow); setWorkflow(workflow);
}; };
@@ -4261,9 +4269,12 @@ const AngularWorkflow = (defaultprops) => {
overflow: "hidden", overflow: "hidden",
}} }}
onClick={() => { onClick={() => {
setNewVariableName(variable.name); setVariableInfo({
setNewVariableDescription(variable.description); "name": variable.name,
setNewVariableValue(variable.value); "description": variable.description,
"value": variable.value,
"index": index,
})
setVariablesModalOpen(true); setVariablesModalOpen(true);
}} }}
> >
@@ -4301,9 +4312,12 @@ const AngularWorkflow = (defaultprops) => {
}} }}
onClick={() => { onClick={() => {
setOpen(false); setOpen(false);
setNewVariableName(variable.name); setVariableInfo({
setNewVariableDescription(variable.description); "name": variable.name,
setNewVariableValue(variable.value); "description": variable.description,
"value": variable.value,
"index": index,
})
setVariablesModalOpen(true); setVariablesModalOpen(true);
}} }}
key={"Edit"} key={"Edit"}
@@ -4316,7 +4330,7 @@ const AngularWorkflow = (defaultprops) => {
color: "white", color: "white",
}} }}
onClick={() => { onClick={() => {
deleteVariable(variable.name); deleteVariable(index);
setOpen(false); setOpen(false);
}} }}
key={"Delete"} key={"Delete"}
@@ -4365,7 +4379,7 @@ const AngularWorkflow = (defaultprops) => {
{workflow.execution_variables === null || {workflow.execution_variables === null ||
workflow.execution_variables === undefined workflow.execution_variables === undefined
? null ? null
: workflow.execution_variables.map((variable) => { : workflow.execution_variables.map((variable, index) => {
return ( return (
<div> <div>
<Paper square style={paperVariableStyle} onClick={() => {}}> <Paper square style={paperVariableStyle} onClick={() => {}}>
@@ -4388,7 +4402,13 @@ const AngularWorkflow = (defaultprops) => {
overflow: "hidden", overflow: "hidden",
}} }}
onClick={() => { onClick={() => {
setNewVariableName(variable.name); //setNewVariableName(variable.name);
setVariableInfo({
"name": variable.name,
"description": variable.description,
"value": variable.value,
"index": index,
})
setExecutionVariablesModalOpen(true); setExecutionVariablesModalOpen(true);
}} }}
> >
@@ -4426,7 +4446,13 @@ const AngularWorkflow = (defaultprops) => {
}} }}
onClick={() => { onClick={() => {
setOpen(false); setOpen(false);
setNewVariableName(variable.name); //setNewVariableName(variable.name);
setVariableInfo({
"name": variable.name,
"description": variable.description,
"value": variable.value,
"index": index,
})
setExecutionVariablesModalOpen(true); setExecutionVariablesModalOpen(true);
}} }}
key={"Edit"} key={"Edit"}
@@ -4439,7 +4465,7 @@ const AngularWorkflow = (defaultprops) => {
color: "white", color: "white",
}} }}
onClick={() => { onClick={() => {
deleteExecutionVariable(variable.name); deleteExecutionVariable(index);
setOpen(false); setOpen(false);
}} }}
key={"Delete"} key={"Delete"}
@@ -5548,7 +5574,6 @@ const AngularWorkflow = (defaultprops) => {
// Remove on the end as we don't want to remove everything // Remove on the end as we don't want to remove everything
results = results.filter((data) => data.id !== action.id); results = results.filter((data) => data.id !== action.id);
results = results.filter((data) => data.type === "ACTION" || data.app_name === "Shuffle Workflow" || data.app_name === "User Input"); results = results.filter((data) => data.type === "ACTION" || data.app_name === "Shuffle Workflow" || data.app_name === "User Input");
console.log("RESULTS:", results)
results.push({ label: "Execution Argument", type: "INTERNAL" }); results.push({ label: "Execution Argument", type: "INTERNAL" });
return results; return results;
}; };
@@ -11904,266 +11929,309 @@ const AngularWorkflow = (defaultprops) => {
</div> </div>
); );
const executionVariableModal = executionVariablesModalOpen ? ( const ExecutionVariableModal = (props) => {
<Dialog const { variableInfo } = props
open={executionVariablesModalOpen}
onClose={() => {
setNewVariableName("");
setExecutionVariablesModalOpen(false);
}}
PaperProps={{
style: {
backgroundColor: surfaceColor,
color: "white",
},
}}
>
<FormControl>
<DialogTitle>
<span style={{ color: "white" }}>Execution Variable</span>
</DialogTitle>
<DialogContent>
Execution Variables are TEMPORARY variables that you can ony be set
and used during execution. Learn more{" "}
<a
rel="noopener noreferrer"
href="https://shuffler.io/docs/workflows#execution_variables"
target="_blank"
style={{ textDecoration: "none", color: "#f85a3e" }}
>
here
</a>
<TextField
onBlur={(event) => setNewVariableName(event.target.value)}
color="primary"
placeholder="Name"
style={{ marginTop: 25 }}
InputProps={{
style: {
color: "white",
},
}}
margin="dense"
fullWidth
defaultValue={newVariableName}
/>
</DialogContent>
<DialogActions>
<Button
style={{ borderRadius: "0px" }}
onClick={() => {
setNewVariableName("");
setExecutionVariablesModalOpen(false);
}}
color="primary"
>
Cancel
</Button>
<Button
style={{ borderRadius: "0px" }}
disabled={newVariableName.length === 0}
onClick={() => {
console.log("VARIABLES! ", newVariableName);
if (
workflow.execution_variables === undefined ||
workflow.execution_variables === null
) {
workflow.execution_variables = [];
}
// try to find one with the same name const [newVariableName, setNewVariableName] = React.useState(variableInfo.name !== undefined ? variableInfo.name : "");
const found = workflow.execution_variables.findIndex( const [newVariableDescription, setNewVariableDescription] = React.useState(variableInfo.description !== undefined ? variableInfo.description : "");
(data) => data.name === newVariableName const [newVariableValue, setNewVariableValue] = React.useState(variableInfo.value !== undefined ? variableInfo.value : "");
);
//console.log(found)
if (found !== -1) {
if (newVariableName.length > 0) {
workflow.execution_variables[found].name = newVariableName;
}
} else {
workflow.execution_variables.push({
name: newVariableName,
description: "An execution variable",
value: "",
id: uuidv4(),
});
}
setExecutionVariablesModalOpen(false); if (!executionVariablesModalOpen) {
setNewVariableName(""); return null
setWorkflow(workflow); }
}}
color="primary"
>
Submit
</Button>
</DialogActions>
{workflowExecutions.length > 0 ? (
<DialogContent>
<Divider
style={{
backgroundColor: "white",
marginTop: 15,
marginBottom: 15,
}}
/>
<b style={{ marginBottom: 10 }}>Values from last 3 executions</b>
{workflowExecutions.slice(0, 3).map((execution, index) => {
if (
execution.execution_variables === undefined ||
execution.execution_variables === null ||
execution.execution_variables === 0
) {
return null;
}
const variable = execution.execution_variables.find( return (
(data) => data.name === newVariableName <Dialog
); open={executionVariablesModalOpen}
if (variable === undefined || variable.value === undefined) { onClose={() => {
return null; setNewVariableName("");
} setExecutionVariablesModalOpen(false);
}}
PaperProps={{
style: {
backgroundColor: surfaceColor,
color: "white",
},
}}
>
<FormControl>
<DialogTitle>
<span style={{ color: "white" }}>Execution Variable</span>
</DialogTitle>
<DialogContent>
Execution Variables are TEMPORARY variables that you can ony be set
and used during execution. Learn more{" "}
<a
rel="noopener noreferrer"
href="https://shuffler.io/docs/workflows#execution_variables"
target="_blank"
style={{ textDecoration: "none", color: "#f85a3e" }}
>
here
</a>
<TextField
onBlur={(event) => setNewVariableName(event.target.value)}
color="primary"
placeholder="Name"
style={{ marginTop: 25 }}
InputProps={{
style: {
color: "white",
},
}}
margin="dense"
fullWidth
defaultValue={newVariableName}
/>
</DialogContent>
<DialogActions>
<Button
style={{ borderRadius: "0px" }}
onClick={() => {
setNewVariableName("");
setExecutionVariablesModalOpen(false);
}}
color="primary"
>
Cancel
</Button>
<Button
style={{ borderRadius: "0px" }}
disabled={newVariableName.length === 0}
onClick={() => {
console.log("VARIABLES! ", newVariableName);
if (
workflow.execution_variables === undefined ||
workflow.execution_variables === null
) {
workflow.execution_variables = [];
}
return ( // try to find one with the same name
<div> const found = workflow.execution_variables.findIndex(
{index + 1}: {variable.value} (data) => data.name === newVariableName
</div> );
); //console.log(found)
})} if (found !== -1) {
</DialogContent> if (newVariableName.length > 0) {
) : null} workflow.execution_variables[found].name = newVariableName;
</FormControl> }
</Dialog> } else {
) : null; workflow.execution_variables.push({
name: newVariableName,
description: "An execution variable",
value: "",
id: uuidv4(),
});
}
const variablesModal = variablesModalOpen ? ( setExecutionVariablesModalOpen(false);
<Dialog setNewVariableName("");
open={variablesModalOpen} setWorkflow(workflow);
onClose={() => { }}
setNewVariableName(""); color="primary"
setNewVariableDescription(""); >
setNewVariableValue(""); Submit
setVariablesModalOpen(false); </Button>
}} </DialogActions>
PaperProps={{ {workflowExecutions.length > 0 ? (
style: { <DialogContent>
backgroundColor: surfaceColor, <Divider
color: "white", style={{
}, backgroundColor: "white",
}} marginTop: 15,
> marginBottom: 15,
<FormControl> }}
<DialogTitle> />
<span style={{ color: "white" }}>Workflow Variable</span> <b style={{ marginBottom: 10 }}>Values from last 3 executions</b>
</DialogTitle> {workflowExecutions.slice(0, 3).map((execution, index) => {
<DialogContent> if (
<TextField execution.execution_variables === undefined ||
onBlur={(event) => setNewVariableName(event.target.value)} execution.execution_variables === null ||
color="primary" execution.execution_variables === 0
placeholder="Name" ) {
InputProps={{ return null;
style: { }
color: "white",
},
}}
margin="dense"
fullWidth
defaultValue={newVariableName}
/>
<TextField
onBlur={(event) => setNewVariableDescription(event.target.value)}
color="primary"
placeholder="Description"
margin="dense"
fullWidth
InputProps={{
style: {
color: "white",
},
}}
defaultValue={newVariableDescription}
/>
<TextField
onChange={(event) => setNewVariableValue(event.target.value)}
rows="6"
multiline
color="primary"
placeholder="Value"
margin="dense"
InputProps={{
style: {
color: "white",
},
}}
fullWidth
defaultValue={newVariableValue}
/>
</DialogContent>
<DialogActions>
<Button
style={{ borderRadius: "0px" }}
onClick={() => {
setNewVariableName("");
setNewVariableDescription("");
setNewVariableValue("");
setVariablesModalOpen(false);
}}
color="primary"
>
Cancel
</Button>
<Button
style={{ borderRadius: "0px" }}
disabled={
newVariableName.length === 0 || newVariableValue.length === 0
}
variant={"contained"}
onClick={() => {
if (
workflow.workflow_variables === undefined ||
workflow.workflow_variables === null
) {
workflow.workflow_variables = [];
}
// try to find one with the same name const variable = execution.execution_variables.find(
const found = workflow.workflow_variables.findIndex( (data) => data.name === newVariableName
(data) => data.name === newVariableName );
); if (variable === undefined || variable.value === undefined) {
if (found !== -1) { return null;
if (newVariableName.length > 0) { }
workflow.workflow_variables[found].name = newVariableName;
}
if (newVariableDescription.length > 0) {
workflow.workflow_variables[found].description =
newVariableDescription;
}
if (newVariableValue.length > 0) {
workflow.workflow_variables[found].value = newVariableValue;
}
} else {
workflow.workflow_variables.push({
name: newVariableName,
description: newVariableDescription,
value: newVariableValue,
id: uuidv4(),
});
}
setWorkflow(workflow); return (
setVariablesModalOpen(false); <div>
setNewVariableName(""); {index + 1}: {variable.value}
setNewVariableDescription(""); </div>
setNewVariableValue(""); );
}} })}
color="primary" </DialogContent>
> ) : null}
Submit </FormControl>
</Button> </Dialog>
</DialogActions> )
</FormControl> }
</Dialog>
) : null; const VariablesModal = (props) => {
const { setVariableInfo, variableInfo } = props
const [newVariableName, setNewVariableName] = React.useState(variableInfo.name !== undefined ? variableInfo.name : "");
const [newVariableDescription, setNewVariableDescription] = React.useState(variableInfo.description !== undefined ? variableInfo.description : "");
const [newVariableValue, setNewVariableValue] = React.useState(variableInfo.value !== undefined ? variableInfo.value : "");
if (!variablesModalOpen) {
return null
}
return (
<Dialog
open={variablesModalOpen}
onClose={() => {
setNewVariableName("");
setNewVariableDescription("");
setNewVariableValue("");
setVariablesModalOpen(false);
}}
PaperProps={{
style: {
backgroundColor: surfaceColor,
color: "white",
},
}}
>
<FormControl>
<DialogTitle>
<span style={{ color: "white" }}>Workflow Variable</span>
</DialogTitle>
<DialogContent>
<TextField
onBlur={(event) => setNewVariableName(event.target.value)}
color="primary"
placeholder="Name"
InputProps={{
style: {
color: "white",
},
}}
margin="dense"
fullWidth
defaultValue={newVariableName}
/>
<TextField
onBlur={(event) => setNewVariableDescription(event.target.value)}
color="primary"
placeholder="Description"
margin="dense"
fullWidth
InputProps={{
style: {
color: "white",
},
}}
defaultValue={newVariableDescription}
/>
<TextField
onChange={(event) => setNewVariableValue(event.target.value)}
rows="6"
multiline
color="primary"
placeholder="Value"
margin="dense"
InputProps={{
style: {
color: "white",
},
}}
fullWidth
defaultValue={newVariableValue}
/>
</DialogContent>
<DialogActions>
<Button
style={{ borderRadius: "0px" }}
onClick={() => {
setNewVariableName("");
setNewVariableDescription("");
setNewVariableValue("");
setVariablesModalOpen(false);
}}
color="primary"
>
Cancel
</Button>
<Button
style={{ borderRadius: "0px" }}
disabled={
newVariableName.length === 0 || newVariableValue.length === 0
}
variant={"contained"}
onClick={() => {
var handled = false
if (
workflow.workflow_variables === undefined ||
workflow.workflow_variables === null
) {
workflow.workflow_variables = [];
} else {
if (variableInfo.index !== undefined && variableInfo.index !== null && variableInfo.index >= 0) {
if (newVariableName.length > 0) {
workflow.workflow_variables[variableInfo.index].name = newVariableName;
}
if (newVariableDescription.length > 0) {
workflow.workflow_variables[variableInfo.index].description =
newVariableDescription;
}
if (newVariableValue.length > 0) {
workflow.workflow_variables[variableInfo.index].value = newVariableValue;
}
handled = true
}
}
if (!handled) {
// try to find one with the same name
const found = workflow.workflow_variables.findIndex(
(data) => data.name === newVariableName
);
if (found !== -1) {
if (newVariableName.length > 0) {
workflow.workflow_variables[found].name = newVariableName;
}
if (newVariableDescription.length > 0) {
workflow.workflow_variables[found].description =
newVariableDescription;
}
if (newVariableValue.length > 0) {
workflow.workflow_variables[found].value = newVariableValue;
}
} else {
workflow.workflow_variables.push({
name: newVariableName,
description: newVariableDescription,
value: newVariableValue,
id: uuidv4(),
});
}
}
setVariableInfo({})
setWorkflow(workflow);
setVariablesModalOpen(false);
setNewVariableName("");
setNewVariableDescription("");
setNewVariableValue("");
}}
color="primary"
>
Submit
</Button>
</DialogActions>
</FormControl>
</Dialog>
)
}
const AuthenticationData = (props) => { const AuthenticationData = (props) => {
const selectedApp = props.app; const selectedApp = props.app;
@@ -12736,8 +12804,8 @@ const AngularWorkflow = (defaultprops) => {
isLoaded && workflowDone ? ( isLoaded && workflowDone ? (
<div> <div>
{newView} {newView}
{variablesModal} <VariablesModal variableInfo={variableInfo} setVariableInfo={setVariableInfo} />
{executionVariableModal} <ExecutionVariableModal variableInfo={variableInfo} setVariableInfo={setVariableInfo} />
{conditionsModal} {conditionsModal}
{authenticationModal} {authenticationModal}
{codePopoutModal} {codePopoutModal}
+14 -7
View File
@@ -513,6 +513,7 @@ const AppCreator = (defaultprops) => {
} }
setBasedata(data); setBasedata(data);
console.log("DATA: ", data)
if (data.info !== null && data.info !== undefined) { if (data.info !== null && data.info !== undefined) {
if (data.info.title !== undefined && data.info.title !== null) { if (data.info.title !== undefined && data.info.title !== null) {
if (data.info.title.length > 29) { if (data.info.title.length > 29) {
@@ -547,7 +548,7 @@ const AppCreator = (defaultprops) => {
data.info["x-categories"] !== undefined && data.info["x-categories"] !== undefined &&
data.info["x-categories"].length > 0 data.info["x-categories"].length > 0
) { ) {
if (typeof data.info["x-categories"] == "array") { if (typeof data.info["x-categories"] === "array") {
} else { } else {
} }
setNewWorkflowCategories(data.info["x-categories"]); setNewWorkflowCategories(data.info["x-categories"]);
@@ -559,7 +560,7 @@ const AppCreator = (defaultprops) => {
for (var key in data.tags) { for (var key in data.tags) {
if (data.tags[key].name.length > 50) { if (data.tags[key].name.length > 50) {
console.log( console.log(
"Skipping tag cus it's too long: ", "Skipping tag because it's too long: ",
data.tags[key].name.length data.tags[key].name.length
); );
continue; continue;
@@ -595,6 +596,7 @@ const AppCreator = (defaultprops) => {
"PUT", "PUT",
]; ];
var newActions = []; var newActions = [];
var wordlist = {}; var wordlist = {};
var all_categories = []; var all_categories = [];
@@ -920,7 +922,8 @@ const AppCreator = (defaultprops) => {
console.log( console.log(
"CANT HANDLE JSON TYPE (4)", "CANT HANDLE JSON TYPE (4)",
parameter.properties[propkey].type, parameter.properties[propkey].type,
parameter.properties[propkey] parameter.properties[propkey],
path
); );
newbody[parsedkey] = []; newbody[parsedkey] = [];
} }
@@ -930,7 +933,8 @@ const AppCreator = (defaultprops) => {
} else { } else {
console.log( console.log(
"CANT HANDLE PARAM: (4) ", "CANT HANDLE PARAM: (4) ",
parameter.properties parameter.properties,
path
); );
} }
} }
@@ -1421,7 +1425,7 @@ const AppCreator = (defaultprops) => {
setAuthenticationOption("Bearer auth"); setAuthenticationOption("Bearer auth");
setAuthenticationRequired(true); setAuthenticationRequired(true);
} else if (key === "ApiKeyAuth" || key === "Token") { } else if (key === "ApiKeyAuth" || key === "Token" || ((value.in === "header" || value.in === "query") && value.name !== undefined)) {
setAuthenticationOption("API key"); setAuthenticationOption("API key");
value.in = value.in.charAt(0).toUpperCase() + value.in.slice(1); value.in = value.in.charAt(0).toUpperCase() + value.in.slice(1);
@@ -1436,7 +1440,10 @@ const AppCreator = (defaultprops) => {
setAuthenticationRequired(true); setAuthenticationRequired(true);
if (value.description !== undefined && value.description !== null && value.description.length > 0) { if (value.description !== undefined && value.description !== null && value.description.length > 0) {
setRefreshUrl(value.description) // Don't want a real description - just the ones we're replacing with
if ((value.description.split(" ").length - 1) <= 2) {
setRefreshUrl(value.description)
}
} }
} else if (value.scheme === "basic") { } else if (value.scheme === "basic") {
@@ -1447,7 +1454,7 @@ const AppCreator = (defaultprops) => {
setAuthenticationOption("Oauth2"); setAuthenticationOption("Oauth2");
setAuthenticationRequired(true); setAuthenticationRequired(true);
} else if (value.type === "oauth2" || key === "Oauth2" || key === "Oauth2c" || (key !== undefined && key!== null && key.toLowerCase().includes("oauth2"))) { } else if (value.type === "oauth2" || key === "Oauth2" || key === "Oauth2c" || (key !== undefined && key !== null && key.toLowerCase().includes("oauth2"))) {
//alert.info("Can't handle Oauth2 auth yet.") //alert.info("Can't handle Oauth2 auth yet.")
setAuthenticationOption("Oauth2"); setAuthenticationOption("Oauth2");
setAuthenticationRequired(true); setAuthenticationRequired(true);
+1 -1
View File
@@ -1,5 +1,5 @@
NAME=shuffle-orborus NAME=shuffle-orborus
VERSION=0.9.48 VERSION=0.9.49
echo "Running docker build with $NAME:$VERSION" echo "Running docker build with $NAME:$VERSION"
#docker rmi frikky/shuffle:$NAME --force #docker rmi frikky/shuffle:$NAME --force
+1 -1
View File
@@ -1,5 +1,5 @@
NAME=shuffle-worker NAME=shuffle-worker
VERSION=0.9.48 VERSION=0.9.49
echo "Running docker build with $NAME:$VERSION" echo "Running docker build with $NAME:$VERSION"
#CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin . #CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin .
+1 -1
View File
@@ -10,6 +10,6 @@ require (
github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-connections v0.4.0 // indirect
github.com/gorilla/mux v1.8.0 github.com/gorilla/mux v1.8.0
github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/shuffle/shuffle-shared v0.1.73 github.com/shuffle/shuffle-shared v0.1.78
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
) )
+7
View File
@@ -79,6 +79,8 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/adrg/strutil v0.2.3 h1:WZVn3ItPBovFmP4wMHHVXUr8luRaHrbyIuLlHt32GZQ=
github.com/adrg/strutil v0.2.3/go.mod h1:+SNxbiH6t+O+5SZqIj5n/9i5yUjR+S3XXVrjEcN2mxg=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -271,6 +273,8 @@ github.com/frikky/go-elasticsearch/v8 v8.13.1 h1:GB+Wr0Yx8efG7D1jc9fGGiqjjRRngWJ
github.com/frikky/go-elasticsearch/v8 v8.13.1/go.mod h1:RPq0JXPQVVSFHTlPwj/go8BZ1hegRf+StaSpT2iGIoQ= github.com/frikky/go-elasticsearch/v8 v8.13.1/go.mod h1:RPq0JXPQVVSFHTlPwj/go8BZ1hegRf+StaSpT2iGIoQ=
github.com/frikky/kin-openapi v0.38.0 h1:V7ttwIJS8Vks4KL+mZVj1ZSqhIcQtgaG8akeqXEQgsE= github.com/frikky/kin-openapi v0.38.0 h1:V7ttwIJS8Vks4KL+mZVj1ZSqhIcQtgaG8akeqXEQgsE=
github.com/frikky/kin-openapi v0.38.0/go.mod h1:Fr28TtCHL4K0kIqtqui8HWxN1LG5uAh3z/tDfFyiA1s= github.com/frikky/kin-openapi v0.38.0/go.mod h1:Fr28TtCHL4K0kIqtqui8HWxN1LG5uAh3z/tDfFyiA1s=
github.com/frikky/kin-openapi v0.41.0 h1:oMmjo+ekGS971lb3KLeZZOqRDZOwWi3+g/OiSWP08+s=
github.com/frikky/kin-openapi v0.41.0/go.mod h1:ev9OZAw7Bv5p0w93j91++6a1ElPzGcCofst+kmrWsj4=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA=
@@ -554,6 +558,7 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -586,6 +591,8 @@ github.com/shuffle/shuffle-shared v0.1.72 h1:7KHpvml+96sMOINEw3PmSAN6WS22ovXGj6W
github.com/shuffle/shuffle-shared v0.1.72/go.mod h1:2ndjLm4ZOvY6arGFwOgGnkQ457Ke7gka9HDF/EkdIxQ= github.com/shuffle/shuffle-shared v0.1.72/go.mod h1:2ndjLm4ZOvY6arGFwOgGnkQ457Ke7gka9HDF/EkdIxQ=
github.com/shuffle/shuffle-shared v0.1.73 h1:1rMOXAvxm/nDemwN/L8qWacswVMvdi6NjLfTTmptP4I= github.com/shuffle/shuffle-shared v0.1.73 h1:1rMOXAvxm/nDemwN/L8qWacswVMvdi6NjLfTTmptP4I=
github.com/shuffle/shuffle-shared v0.1.73/go.mod h1:2ndjLm4ZOvY6arGFwOgGnkQ457Ke7gka9HDF/EkdIxQ= github.com/shuffle/shuffle-shared v0.1.73/go.mod h1:2ndjLm4ZOvY6arGFwOgGnkQ457Ke7gka9HDF/EkdIxQ=
github.com/shuffle/shuffle-shared v0.1.78 h1://YsgQ85Ep40AA3pLUXb+85BUrNz5sqGqh0e3twKRy4=
github.com/shuffle/shuffle-shared v0.1.78/go.mod h1:cW8LBv8P24rCPyJqGV6czxqrpnrv/R1d97EOqNgIvSk=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=