Fixed code editor and small ui changes in workflow ui

This commit is contained in:
Frikky
2024-03-15 14:39:50 +01:00
parent b5d04bef13
commit b8e9599053
5 changed files with 644 additions and 287 deletions
+9 -13
View File
@@ -676,6 +676,8 @@ const CodeEditor = (props) => {
for (var i = 0; i < found.length; i++) {
try {
const fixedVariable = fixVariable(found[i])
// Finding if the value is in the list at all, and does initial replacement
var valuefound = false
for (var j = 0; j < actionlist.length; j++) {
if(fixedVariable.slice(1,).toLowerCase() !== actionlist[j].autocomplete.toLowerCase()){
@@ -697,12 +699,13 @@ const CodeEditor = (props) => {
} catch (e) {
input = input.replace(found[i], actionlist[j].example, -1)
}
}
//console.log("INPUT: ", fixedVariable, valuefound, input)
if (!valuefound) {
//console.log("Couldn't find value "+fixedVariable)
}
//if (!valuefound) {
// console.log("Couldn't find value "+fixedVariable)
//}
if (!valuefound && availableVariables.includes(fixedVariable)) {
var shouldbreak = false
@@ -729,8 +732,6 @@ const CodeEditor = (props) => {
console.log("ERR IN INPUT: ", e)
}
//console.log("Got output for: ", fullpath, new_input, actionlist[k].example, typeof new_input)
if (typeof new_input === "object") {
new_input = JSON.stringify(new_input)
} else {
@@ -752,10 +753,6 @@ const CodeEditor = (props) => {
input = input.replace(fixedVariable, new_input, -1)
input = input.replace(found[i], new_input, -1)
//} catch (e) {
// input = input.replace(found[i], actionlist[k].example)
//}
shouldbreak = true
break
}
@@ -1498,7 +1495,6 @@ const CodeEditor = (props) => {
backgroundColor: "rgba(40,40,40,1)",
}}
onLoad={(editor) => {
console.log("LOAD: ", editor)
highlight_variables(localcodedata)
}}
onCursorChange={(cursorPosition, editor, value) => {
@@ -1591,7 +1587,7 @@ const CodeEditor = (props) => {
minheight: 450,
overflow: "auto",
minWidth: 450,
maxWidth: 450,
maxWidth: "100%",
}}
collapsed={false}
enableClipboard={(copy) => {