From 65418b39c4775f2f428bcff5a81cdc4953d855e5 Mon Sep 17 00:00:00 2001 From: frikky Date: Fri, 11 Feb 2022 00:23:34 +0100 Subject: [PATCH] Fixed issue with actionlist autocompletion --- backend/go-app/main.go | 2 +- frontend/src/components/ParsedAction.jsx | 10 ++++++++-- frontend/src/components/ShuffleCodeEditor.jsx | 9 ++++++++- frontend/src/views/AngularWorkflow.jsx | 3 ++- frontend/src/views/Docs.jsx | 10 ++++++++-- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 92c67f19..fa75b583 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -3939,7 +3939,7 @@ func runInitEs(ctx context.Context) { } for _, schedule := range schedules { - if schedule.Environment == "cloud" { + if strings.toToLower(schedule.Environment) == "cloud" { log.Printf("Skipping cloud schedule") continue } diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx index 0b5c31ab..78b531a6 100644 --- a/frontend/src/components/ParsedAction.jsx +++ b/frontend/src/components/ParsedAction.jsx @@ -488,7 +488,7 @@ const ParsedAction = (props) => { continue; } - var exampledata = item.example === undefined ? "" : item.example; + var exampledata = item.example === undefined || item.example === null ? "" : item.example; // Find previous execution and their variables //exampledata === "" && if (workflowExecutions.length > 0) { @@ -505,10 +505,14 @@ const ParsedAction = (props) => { var foundResult = workflowExecutions[key].results.find( (result) => result.action.id === item.id ); - if (foundResult === undefined) { + if (foundResult === undefined || foundResult === null) { continue; } + if (foundResult.result !== undefined && foundResult.result !== null) { + foundResult = foundResult.result + } + const valid = validateJson(foundResult) if (valid.valid) { exampledata = valid.result; @@ -524,6 +528,7 @@ const ParsedAction = (props) => { item.label === null || item.label === undefined ? "" : item.label.split(" ").join("_"); + const actionvalue = { type: "action", id: item.id, @@ -535,6 +540,7 @@ const ParsedAction = (props) => { } } + console.log("ACTIONLIST: ", actionlist) setActionlist(actionlist); } } diff --git a/frontend/src/components/ShuffleCodeEditor.jsx b/frontend/src/components/ShuffleCodeEditor.jsx index 4a416cf9..911b0ad3 100644 --- a/frontend/src/components/ShuffleCodeEditor.jsx +++ b/frontend/src/components/ShuffleCodeEditor.jsx @@ -19,6 +19,7 @@ import { import { useTheme } from '@material-ui/core/styles'; import { validateJson } from "../views/Workflows.jsx"; import ReactJson from "react-json-view"; +import PaperComponent from "../components/PaperComponent.jsx" import CodeMirror from '@uiw/react-codemirror'; import 'codemirror/keymap/sublime'; @@ -84,10 +85,14 @@ const CodeEditor = (props) => { { - //setExpansionModalOpen(false) + console.log("In closer") + changeActionParameterCodeMirror({target: {value: ""}}, fieldCount, localcodedata) }} + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" PaperProps={{ style: { backgroundColor: theme.palette.surfaceColor, @@ -106,7 +111,9 @@ const CodeEditor = (props) => { >
{ } } - var newapps = JSON.parse(JSON.stringify(apps)) + //var newapps = JSON.parse(JSON.stringify(apps)) + var newapps = apps const curapp = newapps.find( (a) => a.name === curaction.app_name && diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx index d595b75a..d6c98b9e 100644 --- a/frontend/src/views/Docs.jsx +++ b/frontend/src/views/Docs.jsx @@ -102,7 +102,7 @@ const Docs = (defaultprops) => { maxHeight: "83vh", overflowX: "hidden", overflowY: "auto", - zIndex: 10003, + zIndex: 1000, }; const fetchDocList = () => { @@ -141,6 +141,11 @@ const Docs = (defaultprops) => { setData(responseJson.reason); document.title = "Shuffle " + docId + " documentation"; + if (responseJson.reason !== undefined && responseJson.reason !== null && responseJson.reason.includes("404: Not Found")) { + navigate("/docs") + return + } + if (responseJson.meta !== undefined) { setSelectedMeta(responseJson.meta); } @@ -517,7 +522,8 @@ const Docs = (defaultprops) => { const newname = item.charAt(0).toUpperCase() + item.substring(1).split("_").join(" ").split("-").join(" "); - const itemMatching = + + const itemMatching = props.match.params.key === undefined ? false : props.match.params.key.toLowerCase() === item.toLowerCase(); //const [tocLines, setTocLines] = React.useState([]); return (