#16: Fixed recursion and autocomplete
This commit is contained in:
@@ -393,12 +393,19 @@ class AppBase:
|
|||||||
# FIXME: This is absolutely not perfect.
|
# FIXME: This is absolutely not perfect.
|
||||||
print("In recursion v2: ", actualitem)
|
print("In recursion v2: ", actualitem)
|
||||||
|
|
||||||
|
is_loop = True
|
||||||
newvalue = []
|
newvalue = []
|
||||||
firstitem = actualitem[0][0]
|
firstitem = actualitem[0][0]
|
||||||
seconditem = actualitem[0][1]
|
seconditem = actualitem[0][1]
|
||||||
|
|
||||||
|
# Means it's a single item -> continue
|
||||||
if seconditem == "":
|
if seconditem == "":
|
||||||
print("In first")
|
print("In first - handling %s", seconditem)
|
||||||
newvalue = basejson[int(firstitem)]
|
tmpitem = basejson[int(firstitem)]
|
||||||
|
try:
|
||||||
|
newvalue, is_loop = recurse_json(tmpitem, parsersplit[outercnt+1:])
|
||||||
|
except IndexError:
|
||||||
|
newvalue, is_loop = (tmpitem, parsersplit[outercnt+1:])
|
||||||
else:
|
else:
|
||||||
if seconditem == "max":
|
if seconditem == "max":
|
||||||
seconditem = len(basejson)
|
seconditem = len(basejson)
|
||||||
@@ -422,7 +429,7 @@ class AppBase:
|
|||||||
#exit()
|
#exit()
|
||||||
newvalue.append(ret)
|
newvalue.append(ret)
|
||||||
|
|
||||||
return newvalue, True
|
return newvalue, is_loop
|
||||||
|
|
||||||
# FIXME: Add specific loop for other indexes
|
# FIXME: Add specific loop for other indexes
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -3069,7 +3069,7 @@ const AngularWorkflow = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
parentMenuOpen={!!menuPosition}
|
parentMenuOpen={!!menuPosition}
|
||||||
style={{backgroundColor: inputColor, color: "white"}}
|
style={{backgroundColor: inputColor, color: "white", minWidth: 250,}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleItemClick([innerdata])
|
handleItemClick([innerdata])
|
||||||
}}
|
}}
|
||||||
@@ -3078,7 +3078,7 @@ const AngularWorkflow = (props) => {
|
|||||||
// FIXME: Should be recursive in here
|
// FIXME: Should be recursive in here
|
||||||
const icon = pathdata.type === "value" ? <VpnKeyIcon style={iconStyle} /> : pathdata.type === "list" ? <FormatListNumberedIcon style={iconStyle} /> : <ExpandMoreIcon style={iconStyle} />
|
const icon = pathdata.type === "value" ? <VpnKeyIcon style={iconStyle} /> : pathdata.type === "list" ? <FormatListNumberedIcon style={iconStyle} /> : <ExpandMoreIcon style={iconStyle} />
|
||||||
return (
|
return (
|
||||||
<MenuItem key={pathdata.name} style={{backgroundColor: inputColor, color: "white"}} value={pathdata} onMouseOver={() => {}}
|
<MenuItem key={pathdata.name} style={{backgroundColor: inputColor, color: "white", minWidth: 250,}} value={pathdata} onMouseOver={() => {}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleItemClick([innerdata, pathdata])
|
handleItemClick([innerdata, pathdata])
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export const GetParsedPaths = (inputdata, basekey) => {
|
|||||||
return parsedValues
|
return parsedValues
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("KEY: ", key, "VALUE: ", value, "BASEKEY: ", basekeyname)
|
//console.log("KEY: ", key, "VALUE: ", value, "BASEKEY: ", basekeyname)
|
||||||
if (typeof(value) === 'object') {
|
if (typeof(value) === 'object') {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
// Check if each item is object
|
// Check if each item is object
|
||||||
|
|||||||
Reference in New Issue
Block a user