Workflow Action Rerun optimization

This commit is contained in:
Frikky
2025-03-25 00:54:32 +01:00
parent a2e4d37eea
commit a3b0093cf5
9 changed files with 301 additions and 55 deletions
+49 -10
View File
@@ -179,6 +179,7 @@ const ParsedAction = (props) => {
suborgWorkflows,
originalWorkflow,
runFromHere,
} = props;
let navigate = useNavigate()
@@ -233,11 +234,16 @@ const ParsedAction = (props) => {
// auth, required, optional
var changed = false
if (selectedActionParameters === undefined || selectedActionParameters === null || selectedActionParameters.length === 0) {
console.log("Returning because no params")
return
}
if (selectedApp !== undefined && selectedApp !== null && selectedApp.generated !== true) {
return
if (isAgent || isIntegration) {
} else {
return
}
}
// Fixing required fields with a shitty structure :)
@@ -346,13 +352,23 @@ const ParsedAction = (props) => {
// 3. generated fields & all else
const newparams = auth
var newparams = auth
.concat(bodyfield)
.concat(required)
.concat(generated_optional)
.concat(special_optional)
.concat(optional)
const dedupedParams = []
for (var paramKey in newparams) {
const param = newparams[paramKey]
if (dedupedParams.find(item => item.name === param.name) === undefined) {
dedupedParams.push(param)
}
}
newparams = dedupedParams
var newkeyorder = []
for (let paramkey in newparams) {
//console.log("Param: ", newparams[paramkey])
@@ -1814,6 +1830,29 @@ const ParsedAction = (props) => {
</Tooltip>
</IconButton>
<Button
color="secondary"
variant="outlined"
style={{
marginTop: "auto",
marginBottom: "auto",
height: 30,
marginLeft: 115,
textTransform: "none",
}}
disabled={autoCompleting}
onClick={() => {
if (runFromHere !== undefined) {
runFromHere(selectedAction)
} else {
toast.error("Function not available. Please contact support@shuffler.io")
}
}}
>
<PlayArrowIcon style={{marginRight: 5, }}/>
Rerun
</Button>
{(selectedAction?.generated === true && selectedAction?.app_version === "1.0.0") || (selectedAction?.app_name === "Shuffle Tools" && selectedAction?.app_version !== "1.2.0") ?
<Button
variant="contained"
@@ -1875,12 +1914,12 @@ const ParsedAction = (props) => {
toast.success("Changed version of all nodes to " + event.target.value)
}}
style={{
marginTop: 10,
position: "absolute",
top: 10, right: 10,
backgroundColor: theme.palette.surfaceColor,
backgroundColor: theme.palette.inputColor,
color: "white",
height: 35,
marginleft: 10,
borderRadius: theme.palette?.borderRadius,
}}
SelectDisplayProps={{
@@ -4120,15 +4159,12 @@ const ParsedAction = (props) => {
fullWidth
id={"rightside_field_" + count}
onChange={(e) => {
console.log("MULTI SELECT: ", multi, e.target.value)
changeActionParameter(e, count, data);
setUpdate(Math.random());
}}
style={{
backgroundColor: theme.palette.surfaceColor,
color: "white",
height: "50px",
backgroundColor: theme.palette.platformColor,
height: 40,
borderRadius: theme.palette?.borderRadius,
}}
>
@@ -4685,8 +4721,9 @@ const ParsedAction = (props) => {
</Tooltip>
: null}
<Tooltip title="Expand editor window" placement="top">
{((data.options !== undefined && data.options !== null && data.options.length > 0) || (selectedActionParameters[count].options !== undefined && selectedActionParameters[count].options !== null && selectedActionParameters[count].options.length > 0)) ? null :
<Tooltip title="Expand editor window" placement="top">
<OpenInFullIcon
style={{ color: "rgba(255,255,255,0.7)", cursor: "pointer", margin: multiline ? 5 : 0, height: 20, width: 20, }}
onMouseOver={(event) => {
@@ -4728,6 +4765,7 @@ const ParsedAction = (props) => {
}}
/>
</Tooltip>
}
</div>
@@ -4737,6 +4775,7 @@ const ParsedAction = (props) => {
showDropdownNumber === count &&
data.variant === "STATIC_VALUE" &&
jsonList.length > 0 ? (
<FormControl fullWidth style={{ marginTop: 0 }}>
<InputLabel
id="action-autocompleter"