diff --git a/frontend-app/src/app/create-run/ConfigForm.tsx b/frontend-app/src/app/create-run/ConfigForm.tsx index 8c155a8..a78fb3a 100644 --- a/frontend-app/src/app/create-run/ConfigForm.tsx +++ b/frontend-app/src/app/create-run/ConfigForm.tsx @@ -15,6 +15,8 @@ const ConfigForm: React.FC = () => { const { selectedNode }: any = useContext(BuilderContext); console.log("SELECTED NODE", selectedNode); + const [connections, setConnections] = useState([]); // New state for connections + // console.log("NODES", nodes);/ // console.log("NODES", nodes) useEffect(() => { @@ -67,6 +69,10 @@ const ConfigForm: React.FC = () => { setName(e.target.value); setFields(null); setFieldValues(null); + + + // Fetch inputs based on selected action + let inputs = await fetch( "https://starfish-app-qfx4x.ondigitalocean.app/action/" + e.target.value, ); @@ -74,6 +80,15 @@ const ConfigForm: React.FC = () => { setFields(res.inputs); setFieldValues({}); }); + + + // Fetch connections list based on the selected action + let connectionResponse = await fetch( + "https://starfish-app-qfx4x.ondigitalocean.app/connections" + ); + connectionResponse.json().then((res) => { + setConnections(res); // Set connections + }); } const { closeDrawer: cancel, saveDrawer: save } = useDrawer(); @@ -131,6 +146,21 @@ const ConfigForm: React.FC = () => { )} ))} + + {/* Display list of connections here */} + {connections.length > 0 && ( +
+ + +
+ )} +