diff --git a/space_flow/src/App.test.tsx b/space_flow/src/App.test.tsx deleted file mode 100644 index 2a68616d9..000000000 --- a/space_flow/src/App.test.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/space_flow/src/App.tsx b/space_flow/src/App.tsx index 7426d5dd9..9b1a39a0d 100644 --- a/space_flow/src/App.tsx +++ b/space_flow/src/App.tsx @@ -86,10 +86,10 @@ export default function App() { const userNavigation = [ { name: "Your Projects", href: "/" }, - { - name: "Account settings", - href: "http://localhost:4455/.ory/kratos/public/self-service/settings/browser", - }, + // { + // name: "Account settings", + // href: "http://localhost:4455/.ory/kratos/public/self-service/settings/browser", + // }, { name: "Sign out", href: "/" }, ]; diff --git a/space_flow/src/CustomNodes/GenericNode/index.tsx b/space_flow/src/CustomNodes/GenericNode/index.tsx index 29db60ef1..b7a07e561 100644 --- a/space_flow/src/CustomNodes/GenericNode/index.tsx +++ b/space_flow/src/CustomNodes/GenericNode/index.tsx @@ -8,7 +8,7 @@ import { } from "../../utils"; import ParameterComponent from "./components/parameterComponent"; import { typesContext } from "../../contexts/typesContext"; -import { useContext, useEffect } from "react"; +import { useContext } from "react"; export default function GenericNode({ data }) { const {types} = useContext(typesContext); @@ -49,6 +49,7 @@ export default function GenericNode({ data }) { data={data} color={ + nodeColors[types[data.node.template[t].type]] ?? nodeColors[types[data.node.template[t].type]] ?? "black" } diff --git a/space_flow/src/index.tsx b/space_flow/src/index.tsx index 2272eb5ec..72d98cad6 100644 --- a/space_flow/src/index.tsx +++ b/space_flow/src/index.tsx @@ -15,8 +15,4 @@ root.render( ); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals(); diff --git a/space_flow/src/pages/FlowPage/components/connection/index.tsx b/space_flow/src/pages/FlowPage/components/connection/index.tsx index 1ad344e54..7d5b15703 100644 --- a/space_flow/src/pages/FlowPage/components/connection/index.tsx +++ b/space_flow/src/pages/FlowPage/components/connection/index.tsx @@ -24,7 +24,6 @@ const ConnectionLineComponent = ({ fromNode={}, connectionLineStyle = {} // provide a default value for connectionLineStyle }) => { -// console.log(fromNode) return ( { + if(data){ + setTypes( + Object.keys(data).reduce( + (acc, curr) => { + Object.keys(data[curr]).forEach((c) => { + acc[c] = curr; + data[curr][c].base_classes?.forEach((b) => { + acc[b] = curr; + }); + }); + // console.log(acc); + return acc; + }, + { + str: "advanced", + bool: "advanced", + chatOutput: "chat", + chatInput: "chat", + } + ) + ); + } + }, [data, setTypes]) + function onDragStart(event: React.DragEvent, data) { event.dataTransfer.effectAllowed = "move"; event.dataTransfer.setData("json", JSON.stringify(data)); diff --git a/space_flow/src/setupTests.ts b/space_flow/src/setupTests.ts index 8f2609b7b..7b0828bfa 100644 --- a/space_flow/src/setupTests.ts +++ b/space_flow/src/setupTests.ts @@ -1,5 +1 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom';