diff --git a/autogpt_platform/frontend/src/components/CustomNode.tsx b/autogpt_platform/frontend/src/components/CustomNode.tsx index 975bc87ab..9b55b6f3c 100644 --- a/autogpt_platform/frontend/src/components/CustomNode.tsx +++ b/autogpt_platform/frontend/src/components/CustomNode.tsx @@ -163,38 +163,6 @@ export function CustomNode({ if (!schema?.properties) return null; let keys = Object.entries(schema.properties); switch (nodeType) { - case BlockUIType.INPUT: - // For INPUT blocks, dont include connection handles - return keys.map(([propKey, propSchema]) => { - const isRequired = data.inputSchema.required?.includes(propKey); - const isConnected = isHandleConnected(propKey); - const isAdvanced = propSchema.advanced; - return ( - (isRequired || isAdvancedOpen || !isAdvanced) && ( -
- - {propSchema.title || beautifyString(propKey)} - -
- {!isConnected && ( - - )} -
-
- ) - ); - }); - case BlockUIType.NOTE: // For NOTE blocks, don't render any input handles const [noteKey, noteSchema] = keys[0]; @@ -213,59 +181,22 @@ export function CustomNode({ ); - case BlockUIType.OUTPUT: - // For OUTPUT blocks, only show the 'value' property - return keys.map(([propKey, propSchema]) => { - const isRequired = data.inputSchema.required?.includes(propKey); - const isConnected = isHandleConnected(propKey); - const isAdvanced = propSchema.advanced; - return ( - (isRequired || isAdvancedOpen || !isAdvanced) && ( -
- {propKey !== "value" ? ( - - {propSchema.title || beautifyString(propKey)} - - ) : ( - - )} - {!isConnected && ( - - )} -
- ) - ); - }); - default: return keys.map(([propKey, propSchema]) => { + const isConnectable = + // No input connection handles for credentials + propKey !== "credentials" && + // For INPUT blocks, no input connection handles. + !(nodeType == BlockUIType.INPUT) && + // For OUTPUT blocks, only show the 'value' (hides 'name') input connection handle + !(nodeType == BlockUIType.OUTPUT && propKey == "name"); const isRequired = data.inputSchema.required?.includes(propKey); const isConnected = isHandleConnected(propKey); const isAdvanced = propSchema.advanced; return ( (isRequired || isAdvancedOpen || isConnected || !isAdvanced) && (
- {"credentials_provider" in propSchema ? ( - - Credentials - - ) : ( + {isConnectable ? ( + ) : ( + + {propKey == "credentials" + ? "Credentials" + : propSchema.title || beautifyString(propKey)} + )} - {!isConnected && ( + {isConnected || (