{
// TODO: UDPDATE SET NODE TO NEW NODE FORM
- setNode(nodeId, (node) => ({
- ...node,
- data: { ...node.data, selected: type },
- }));
+ setNode(nodeId, (node) => {
+ const newNode = cloneDeep(node);
+ (newNode.data as NodeDataType).node!.outputs![idx].selected =
+ type;
+ return newNode;
+ });
}}
>
{type}
diff --git a/src/frontend/src/customNodes/genericNode/components/componentOutputs/index.tsx b/src/frontend/src/customNodes/genericNode/components/componentOutputs/index.tsx
deleted file mode 100644
index 6cdc72839..000000000
--- a/src/frontend/src/customNodes/genericNode/components/componentOutputs/index.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { NodeDataType } from "../../../../types/flow";
-import ComponentOutput from "../ComponentOutput";
-
-export default function ComponentOutputs({ data }: { data: NodeDataType }) {
- return (
-
- {data.node?.outputs?.map((output) => (
-
- ))}
-
- );
-}
diff --git a/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx b/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx
index e1f737ad0..fe84645a6 100644
--- a/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx
+++ b/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx
@@ -55,6 +55,7 @@ import useHandleNodeClass from "../../../hooks/use-handle-node-class";
import useHandleRefreshButtonPress from "../../../hooks/use-handle-refresh-buttons";
import TooltipRenderComponent from "../tooltipRenderComponent";
import HandleTooltips from "../HandleTooltipComponent";
+import OutputComponent from "../OutputComponent";
export default function ParameterComponent({
left,
@@ -70,12 +71,9 @@ export default function ParameterComponent({
info = "",
proxy,
showNode,
- index = "",
+ index,
}: ParameterComponentType): JSX.Element {
- const ref = useRef(null);
const infoHtml = useRef(null);
- const setErrorData = useAlertStore((state) => state.setErrorData);
- const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const nodes = useFlowStore((state) => state.nodes);
const edges = useFlowStore((state) => state.edges);
const setNode = useFlowStore((state) => state.setNode);
@@ -145,40 +143,16 @@ export default function ParameterComponent({
}, [info]);
function renderTitle() {
- const output_types = title.split("|");
- const displayTitle = data.selected_output_type ?? output_types[0];
- return !left && output_types.length > 1 ? (
-
-
-
- {displayTitle}
-
-
-
-
- {output_types.map((type) => (
- {
- setNode(data.id, (node) => ({
- ...node,
- data: { ...node.data, selected_output_type: type },
- }));
- }}
- >
- {type}
-
- ))}
-
-
+ return !left ? (
+
) : (
-
- {title}
-
+ {title}
);
}
@@ -244,7 +218,6 @@ export default function ParameterComponent({
)
) : (
{" "}
- {data.node!.outputs && data.node!.outputs.length > 0 && (
-
- )}
- {data.node!.base_classes.length > 0 && (
- 0
- ? nodeColors[data.node.output_types[0]] ??
- nodeColors[types[data.node.output_types[0]]]
- : nodeColors[types[data.type]]) ?? nodeColors.unknown
- }
- title={
- data.node?.output_types && data.node.output_types.length > 0
- ? data.node.output_types.join(" | ")
- : data.type
- }
- tooltipTitle={data.node?.base_classes.join("\n")}
- id={{
- baseClasses: data.node!.base_classes,
- id: data.id,
- dataType: data.type,
- }}
- type={data.node?.base_classes.join("|")}
- left={false}
- showNode={showNode}
- />
- )}
+ {data.node!.outputs &&
+ data.node!.outputs.length > 0 &&
+ data.node!.outputs.map((output, idx) => (
+
+ ))}
>
)}
diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts
index 758b13510..bc4f65ed7 100644
--- a/src/frontend/src/types/components/index.ts
+++ b/src/frontend/src/types/components/index.ts
@@ -67,7 +67,7 @@ export type ParameterComponentType = {
info?: string;
proxy?: { field: string; id: string };
showNode?: boolean;
- index?: string;
+ index: number;
onCloseModal?: (close: boolean) => void;
};
export type InputListComponentType = {
@@ -116,6 +116,7 @@ export type outputComponentType = {
selected: string;
nodeId: string;
frozen?: boolean;
+ idx: number;
};
export type PromptAreaComponentType = {