#249: Basic fix for sensitive data export
This commit is contained in:
@@ -540,7 +540,7 @@ const AngularWorkflow = (props) => {
|
||||
currentnode.removeClass('awaiting-data-highlight')
|
||||
currentnode.addClass('success-highlight')
|
||||
|
||||
if (!visited.includes(item.action.label)) {
|
||||
if (visited !== undefined && visited !== null && !visited.includes(item.action.label)) {
|
||||
if (executionRunning) {
|
||||
//alert.show("Success in node "+item.action.label)
|
||||
//+" with result "+item.result)
|
||||
@@ -1382,7 +1382,7 @@ const AngularWorkflow = (props) => {
|
||||
//throw BreakException
|
||||
return false
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1766,13 +1766,13 @@ const AngularWorkflow = (props) => {
|
||||
const stopSchedule = (trigger, triggerindex) => {
|
||||
alert.info("Stopping schedule")
|
||||
fetch(globalUrl+"/api/v1/workflows/"+props.match.params.key+"/schedule/"+trigger.id, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
credentials: "include",
|
||||
})
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
credentials: "include",
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.status !== 200) {
|
||||
console.log("Status not 200 for stream results :O!")
|
||||
@@ -1783,21 +1783,16 @@ const AngularWorkflow = (props) => {
|
||||
.then((responseJson) => {
|
||||
// No matter what, it's being stopped.
|
||||
if (!responseJson.success) {
|
||||
alert.error("Failed to stop schedule: " + responseJson.reason)
|
||||
|
||||
workflow.triggers[triggerindex].status = "stopped"
|
||||
trigger.status = "stopped"
|
||||
setSelectedTrigger(trigger)
|
||||
setWorkflow(workflow)
|
||||
saveWorkflow(workflow)
|
||||
alert.WARNING("Failed to stop schedule: " + responseJson.reason)
|
||||
} else {
|
||||
alert.success("Successfully stopped schedule")
|
||||
workflow.triggers[triggerindex].status = "stopped"
|
||||
trigger.status = "stopped"
|
||||
setSelectedTrigger(trigger)
|
||||
setWorkflow(workflow)
|
||||
saveWorkflow(workflow)
|
||||
}
|
||||
|
||||
workflow.triggers[triggerindex].status = "stopped"
|
||||
trigger.status = "stopped"
|
||||
setSelectedTrigger(trigger)
|
||||
setWorkflow(workflow)
|
||||
saveWorkflow(workflow)
|
||||
})
|
||||
.catch(error => {
|
||||
alert.error(error.toString())
|
||||
@@ -2535,7 +2530,8 @@ const AngularWorkflow = (props) => {
|
||||
newAppname = newAppname.slice(0, maxlen)+".."
|
||||
}
|
||||
|
||||
const image = "url("+app.large_image+")"
|
||||
//const image = "url("+app.large_image+")"
|
||||
const image = app.large_image
|
||||
const newAppStyle = JSON.parse(JSON.stringify(paperAppStyle))
|
||||
const pixelSize = !hover ? "2px" : "4px"
|
||||
newAppStyle.borderLeft = app.is_valid ? `${pixelSize} solid green` : `${pixelSize} solid orange`
|
||||
@@ -2555,7 +2551,7 @@ const AngularWorkflow = (props) => {
|
||||
<Paper square style={newAppStyle} onMouseOver={() => {setHover(true)}} onMouseOut={() => {setHover(false)}}>
|
||||
<Grid container style={{margin: "10px 10px 10px 15px", flex: "10"}}>
|
||||
<Grid item>
|
||||
<div style={{borderRadius: borderRadius, height: 80, width: 80, backgroundImage: image, backgroundSize: "cover", backgroundRepeat: "no-repeat"}} />
|
||||
<img alt={newAppname} src={image} style={{borderRadius: borderRadius, height: 80, width: 80,}} />
|
||||
</Grid>
|
||||
<Grid style={{display: "flex", flexDirection: "column", marginLeft: "20px", minWidth: 185, maxWidth: 185, overflow: "hidden", maxHeight: 80, }}>
|
||||
<Grid item style={{flex: 1}}>
|
||||
@@ -5530,6 +5526,7 @@ const AngularWorkflow = (props) => {
|
||||
if (trigger.id === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
alert.info("Stopping webhook")
|
||||
|
||||
fetch(globalUrl+"/api/v1/hooks/"+trigger.id+"/delete", {
|
||||
@@ -5548,18 +5545,23 @@ const AngularWorkflow = (props) => {
|
||||
return response.json()
|
||||
})
|
||||
.then((responseJson) => {
|
||||
workflow.triggers[triggerindex].status = "stopped"
|
||||
trigger.status = "stopped"
|
||||
setWorkflow(workflow)
|
||||
setSelectedTrigger(trigger)
|
||||
if (workflow.triggers[triggerindex] !== undefined) {
|
||||
workflow.triggers[triggerindex].status = "stopped"
|
||||
}
|
||||
|
||||
if (responseJson.success) {
|
||||
//alert.success("Successfully stopped webhook")
|
||||
// Set the status
|
||||
saveWorkflow(workflow)
|
||||
} else {
|
||||
alert.error("Failed stopping webhook: "+responseJson.reason)
|
||||
if (responseJson.reason !== undefined) {
|
||||
alert.error("Failed stopping webhook: "+responseJson.reason)
|
||||
}
|
||||
}
|
||||
|
||||
trigger.status = "stopped"
|
||||
setWorkflow(workflow)
|
||||
setSelectedTrigger(trigger)
|
||||
})
|
||||
.catch(error => {
|
||||
alert.error(error.toString())
|
||||
@@ -6937,7 +6939,7 @@ const AngularWorkflow = (props) => {
|
||||
: null
|
||||
|
||||
const variablesModal = variablesModalOpen ?
|
||||
<Dialog modal
|
||||
<Dialog
|
||||
open={variablesModalOpen}
|
||||
onClose={() => {
|
||||
setNewVariableName("")
|
||||
|
||||
@@ -2150,7 +2150,7 @@ const AppCreator = (props) => {
|
||||
</h2>
|
||||
</Link>
|
||||
<h2>
|
||||
{name} ({actions === null || actions === undefined ? 0 : actions.length})
|
||||
{name} {actions === null || actions === undefined || actions.length === 0 ? null : <span>({actions.length})</span>}
|
||||
</h2>
|
||||
</Breadcrumbs>
|
||||
<Paper style={boxStyle}>
|
||||
|
||||
@@ -145,6 +145,7 @@ const Apps = (props) => {
|
||||
const [isDropzone, setIsDropzone] = React.useState(false);
|
||||
const upload = React.useRef(null);
|
||||
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io" ? true : false
|
||||
const borderRadius = 3
|
||||
|
||||
const { start, stop } = useInterval({
|
||||
duration: 5000,
|
||||
@@ -330,9 +331,9 @@ const Apps = (props) => {
|
||||
//<div style={{backgroundColor: theme.palette.inputColor, height: 100, width: 100, borderRadius: 3, verticalAlign: "middle", textAlign: "center", display: "table-cell"}}>
|
||||
// <div style={{width: "100px", height: "100px", border: "1px solid black", verticalAlign: "middle", textAlign: "center", display: "table-cell"}}>
|
||||
var imageline = data.large_image.length === 0 ?
|
||||
<img alt={data.title} style={{width: 100, height: 100, backgroundColor: theme.palette.inputColor,}} />
|
||||
<img alt={data.title} style={{borderRadius: borderRadius, width: 100, height: 100, backgroundColor: theme.palette.inputColor,}} />
|
||||
:
|
||||
<img alt={data.title} src={data.large_image} style={{maxWidth: 100, maxHeight: "100%", display: "block", margin: "0 auto"}} onLoad={(event) => {
|
||||
<img alt={data.title} src={data.large_image} style={{borderRadius: borderRadius, maxWidth: 100, minWidth: 100, maxHeight: "100%", display: "block", margin: "0 auto"}} onLoad={(event) => {
|
||||
//console.log("IMG LOADED!: ", event.target)
|
||||
}} />
|
||||
|
||||
@@ -535,9 +536,9 @@ const Apps = (props) => {
|
||||
: null
|
||||
|
||||
var imageline = selectedApp.large_image === undefined || selectedApp.large_image.length === 0 ?
|
||||
<img alt={selectedApp.title} style={{width: 100, height: 100, backgroundColor: theme.palette.inputColor,}} />
|
||||
<img alt={selectedApp.title} style={{borderRadius: borderRadius, width: 100, height: 100, backgroundColor: theme.palette.inputColor,}} />
|
||||
:
|
||||
<img alt={selectedApp.title} src={selectedApp.large_image} style={{maxHeight: 100, maxWidth: 100, backgroundColor: theme.palette.inputColor}} />
|
||||
<img alt={selectedApp.title} src={selectedApp.large_image} style={{borderRadius: borderRadius, maxWidth: 100, height: "auto", backgroundColor: theme.palette.inputColor}} />
|
||||
|
||||
const GetAppExample = () => {
|
||||
if (selectedAction.returns === undefined) {
|
||||
|
||||
@@ -395,23 +395,44 @@ const Workflows = (props) => {
|
||||
let exportFileDefaultName = data.name+'.json';
|
||||
|
||||
data["owner"] = ""
|
||||
for (var key in data.triggers) {
|
||||
const trigger = data.triggers[key]
|
||||
if (trigger.app_name === "Shuffle Workflow") {
|
||||
if (trigger.parameters.length > 2) {
|
||||
trigger.parameters[2].value = ""
|
||||
if (data.triggers !== null && data.triggers !== undefined) {
|
||||
for (var key in data.triggers) {
|
||||
const trigger = data.triggers[key]
|
||||
if (trigger.app_name === "Shuffle Workflow") {
|
||||
if (trigger.parameters.length > 2) {
|
||||
trigger.parameters[2].value = ""
|
||||
}
|
||||
}
|
||||
|
||||
if (trigger.status == "running") {
|
||||
trigger.status = "stopped"
|
||||
}
|
||||
}
|
||||
|
||||
if (trigger.status == "running") {
|
||||
trigger.status = "stopped"
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in data.actions) {
|
||||
data.actions[key].authentication_id = ""
|
||||
if (data.actions !== null && data.actions !== undefined) {
|
||||
for (var key in data.actions) {
|
||||
data.actions[key].authentication_id = ""
|
||||
|
||||
for (var subkey in data.actions[key].parameters) {
|
||||
const param = data.actions[key].parameters[subkey]
|
||||
if (param.name.includes("key") || param.name.includes("user") || param.name.includes("pass") || param.name.includes("api") || param.name.includes("auth") || param.name.includes("secret")) {
|
||||
param.value = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.workflow_variables !== null && data.workflow_variables !== undefined) {
|
||||
for (var key in data.workflow_variables) {
|
||||
const param = data.workflow_variables[key]
|
||||
if (param.name.includes("key") || param.name.includes("user") || param.name.includes("pass") || param.name.includes("api") || param.name.includes("auth") || param.name.includes("secret")) {
|
||||
param.value = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//console.log(data)
|
||||
//return
|
||||
|
||||
data["org"] = []
|
||||
|
||||
Reference in New Issue
Block a user