Last little workflow fixes before ui merge fix yay

This commit is contained in:
Frikky
2024-06-20 12:01:24 +02:00
parent db1138019f
commit f17d2a0d58
5 changed files with 38 additions and 26 deletions
+7 -5
View File
@@ -410,6 +410,7 @@ const Files = (props) => {
) {
toast("Failed to delete file: " + responseJson.reason);
}
setTimeout(() => {
getFiles(selectedCategory)
}, 1500);
@@ -697,13 +698,14 @@ const Files = (props) => {
//setFile(fileObject)
//const files = event.target.files[0]
uploadFiles(event.target.files);
}}
/>
<Button
style={{ marginLeft: 5, marginRight: 15, backgroundColor:isSelectedFiles?"#2F2F2F":null,borderRadius:isSelectedFiles?200:null, width:isSelectedFiles?81:null, height:isSelectedFiles?40:null, boxShadow: isSelectedFiles?'none':null, }}
variant="contained"
color="primary"
onClick={() => getFiles()}
onClick={() => getFiles(selectedCategory)}
>
<CachedIcon />
</Button>
@@ -846,7 +848,7 @@ const Files = (props) => {
/>
<ListItemText
primary="Md5"
style={{ minWidth: isSelectedFiles ? 210:250, maxWidth: isSelectedFiles?210:250, overflow: "hidden" }}
style={{ minWidth: 300, maxWidth: 300, overflow: "hidden" }}
/>
<ListItemText
primary="Status"
@@ -962,8 +964,8 @@ const Files = (props) => {
<ListItemText
primary={file.md5_sum}
style={{
minWidth: isSelectedFiles?200:300,
maxWidth: isSelectedFiles?200:300,
minWidth: 300,
maxWidth: 300,
marginLeft:isSelectedFiles? 15:null,
overflow: isSelectedFiles?"auto":"hidden",
}}
@@ -1110,7 +1112,7 @@ const Files = (props) => {
disabled={file.status !== "active"}
style = {{padding: "6px"}}
onClick={() => {
deleteFile(file);
deleteFile(file)
}}
>
<DeleteIcon
+18 -10
View File
@@ -3123,9 +3123,10 @@ const ParsedAction = (props) => {
if (workflowExecutions.length > 0) {
// Look for the ID
var found = false;
var curResult = null
for (let [key,keyval] in Object.entries(workflowExecutions)) {
if (workflowExecutions[key].results === undefined || workflowExecutions[key].results === null) {
continue;
continue
}
var foundResult = workflowExecutions[key].results.find(
@@ -3133,10 +3134,10 @@ const ParsedAction = (props) => {
)
if (foundResult === undefined || foundResult === null) {
continue;
continue
}
const oldstartnode = cy.getElementById(selectedAction.id);
const oldstartnode = cy.getElementById(selectedAction.id)
if (oldstartnode !== undefined && oldstartnode !== null) {
const foundname = oldstartnode.data("label")
if (foundname !== undefined && foundname !== null) {
@@ -3144,14 +3145,21 @@ const ParsedAction = (props) => {
}
}
setSelectedResult(foundResult);
if (setCodeModalOpen !== undefined) {
setCodeModalOpen(true);
found = true
}
// Not breaking unless necessary
curResult = foundResult
found = true
break;
if (curResult.status === "SUCCESS") {
break
}
}
if (curResult !== null) {
setSelectedResult(curResult)
if (setCodeModalOpen !== undefined) {
setCodeModalOpen(true)
}
}
if (!found) {
@@ -1581,7 +1581,8 @@ const CodeEditor = (props) => {
>
<div>
<span style={{color: "white"}}>
Expected Output
{selectedAction === undefined ? "" : selectedAction.name === "execute_python" ? "Code to run" : "Expected Output"}
</span>
</div>
@@ -1598,7 +1599,7 @@ const CodeEditor = (props) => {
border: `1px solid ${theme.palette.primary.main}`,
position: "absolute",
top: 24,
right: 65,
right: 100,
maxHeight: 35,
minWidth: 70,
}}
@@ -1609,7 +1610,7 @@ const CodeEditor = (props) => {
{executing ?
<CircularProgress style={{height: 18, width: 18, }} />
:
<span>Try it <PlayArrowIcon style={{height: 18, width: 18, marginBottom: -4, marginLeft: 5, }} /> </span>
<span>{selectedAction === undefined ? "" : selectedAction.name === "execute_python" ? "Run Python Code" : "Try it"}<PlayArrowIcon style={{height: 18, width: 18, marginBottom: -4, marginLeft: 5, }} /> </span>
}
</Button>
</Tooltip>