Skip to content

Commit

Permalink
hide payload input
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Oct 21, 2024
1 parent 13e6a75 commit 7df8e68
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autogpt_platform/backend/backend/blocks/github/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Input(BlockSchema):
description="Repository to subscribe to",
placeholder="{owner}/{repo}",
)
payload: dict = SchemaField(description="Webhook payload", exclude=True)
payload: dict = SchemaField(hidden=True)

class Output(BlockSchema):
event: str = SchemaField(description="The event that triggered the webhook")
Expand Down
2 changes: 2 additions & 0 deletions autogpt_platform/frontend/src/components/CustomNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export function CustomNode({
return keys.map(([propKey, propSchema]) => {
const isRequired = data.inputSchema.required?.includes(propKey);
const isAdvanced = propSchema.advanced;
const isHidden = propSchema.hidden;
const isConnectable =
// No input connection handles on INPUT and WEBHOOK blocks
![BlockUIType.INPUT, BlockUIType.WEBHOOK].includes(nodeType) &&
Expand All @@ -194,6 +195,7 @@ export function CustomNode({
!(nodeType == BlockUIType.OUTPUT && propKey == "value");
const isConnected = isInputHandleConnected(propKey);
return (
!isHidden &&
(isRequired || isAdvancedOpen || isConnected || !isAdvanced) && (
<div key={propKey} data-id={`input-handle-${propKey}`}>
{isConnectable ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export type BlockIOSubSchemaMeta = {
description?: string;
placeholder?: string;
advanced?: boolean;
hidden?: boolean;
};

export type BlockIOObjectSubSchema = BlockIOSubSchemaMeta & {
Expand Down

0 comments on commit 7df8e68

Please sign in to comment.