diff --git a/space_flow/src/CustomNodes/ChatInputNode/index.tsx b/space_flow/src/CustomNodes/ChatInputNode/index.tsx index b8237c10c..3eaae790c 100644 --- a/space_flow/src/CustomNodes/ChatInputNode/index.tsx +++ b/space_flow/src/CustomNodes/ChatInputNode/index.tsx @@ -23,7 +23,7 @@ export default function ChatInputNode({ data }) { isValidConnection(data,connection)} className="-mr-1 bg-transparent border-solid border-l-8 border-l-blue-600 border-y-transparent border-y-8 border-r-0 rounded-none" > diff --git a/space_flow/src/CustomNodes/GenericNode/index.tsx b/space_flow/src/CustomNodes/GenericNode/index.tsx index fb9647d33..f532b187a 100644 --- a/space_flow/src/CustomNodes/GenericNode/index.tsx +++ b/space_flow/src/CustomNodes/GenericNode/index.tsx @@ -38,37 +38,50 @@ export default function GenericNode({ data }) {
{data.node.description}
-
Inputs:
+ <> - {Object.keys(data.node.template).map((t, idx) => ( - - ))} + {Object.keys(data.node.template) + .filter((t) => t.charAt(0) !== "_") + .map((t, idx) => ( + <> + {idx === 0 ? ( +
Inputs:
+ ) : ( + <> + )} + {data.node.template[t].show ? ( + + ) : ( + <> + )} + + ))}
Output:
diff --git a/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index 5db6fb5ee..302e89d3b 100644 --- a/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/space_flow/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -10,13 +10,16 @@ export default function ExtraSidebar() { const types = Object.keys(data).reduce((acc, curr) => { Object.keys(data[curr]).forEach((c) => { acc[c] = curr; + acc[data[curr][c].base_class] = curr; }); + console.log(acc); return acc; }, {str: 'elements', bool: 'elements'}); useEffect(() => { getAll().then((d) => { setData(d.data); + console.log(d.data); }); }, []); diff --git a/space_flow/src/utils.ts b/space_flow/src/utils.ts index 4977c4c55..8639d1f28 100644 --- a/space_flow/src/utils.ts +++ b/space_flow/src/utils.ts @@ -305,6 +305,7 @@ export function toFirstUpperCase(str: string) { } export function snakeToNormalCase(str: string) { + console.log(str); return str .split("_") .map((word, index) => { @@ -334,9 +335,9 @@ export function isValidConnection( { source, target, sourceHandle, targetHandle } ) { if ( - targetHandle === sourceHandle.split("|")[0] || - sourceHandle.split("|")[0] === "str" || - data.types[targetHandle] === sourceHandle.split("|")[0] + targetHandle.split('|')[0] === sourceHandle.split("|")[0] || + targetHandle.split('|')[1] === sourceHandle.split("|")[0] || + sourceHandle.split("|")[0] === "str" ) { let sourceNode = data.reactFlowInstance.getNode(source).data.node; if (!sourceNode) {