AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(builder): Correctly display static links on new edges (#7851)
Krzysztof Czerwinskia1cbc101a5ba
diff --git a/rnd/autogpt_builder/src/components/CustomNode.tsx b/rnd/autogpt_builder/src/components/CustomNode.tsxindex d0e263bf63..0be79d52ca 100644--- a/rnd/autogpt_builder/src/components/CustomNode.tsx+++ b/rnd/autogpt_builder/src/components/CustomNode.tsx@@ -52,6 +52,7 @@ export type CustomNodeData = {errors?: { [key: string]: string | null };setErrors: (errors: { [key: string]: string | null }) => void;setIsAnyModalOpen?: (isOpen: boolean) => void;+ isOutputStatic?: boolean;};const CustomNode: FC<NodeProps<CustomNodeData>> = ({ data, id }) => {diff --git a/rnd/autogpt_builder/src/components/Flow.tsx b/rnd/autogpt_builder/src/components/Flow.tsxindex 4e74954c39..217944f335 100644--- a/rnd/autogpt_builder/src/components/Flow.tsx+++ b/rnd/autogpt_builder/src/components/Flow.tsx@@ -274,8 +274,7 @@ const FlowEditor: React.FC<{const edgeColor = getTypeColor(getOutputType(connection.source!, connection.sourceHandle!),);- const sourcePos = getNode(connection.source!)?.position;- console.log("sourcePos", sourcePos);+ const sourceNode = getNode(connection.source!);const newEdge: Edge<CustomEdgeData> = {id: formatEdgeID(connection),type: "custom",@@ -284,7 +283,11 @@ const FlowEditor: React.FC<{strokeWidth: 2,color: edgeColor,},- data: { edgeColor, sourcePos },+ data: {+ edgeColor,+ sourcePos: sourceNode!.position,+ isStatic: sourceNode!.data.isOutputStatic,+ },...connection,source: connection.source!,target: connection.target!,@@ -431,6 +434,7 @@ const FlowEditor: React.FC<{),);},+ isOutputStatic: nodeSchema.staticOutput,},};diff --git a/rnd/autogpt_builder/src/lib/autogpt-server-api/types.ts b/rnd/autogpt_builder/src/lib/autogpt-server-api/types.tsindex bb34a9c4a6..f767aa5833 100644--- a/rnd/autogpt_builder/src/lib/autogpt-server-api/types.ts+++ b/rnd/autogpt_builder/src/lib/autogpt-server-api/types.ts@@ -12,6 +12,7 @@ export type Block = {categories: Category[];inputSchema: BlockIORootSchema;outputSchema: BlockIORootSchema;+ staticOutput: boolean;};export type BlockIORootSchema = {