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 f117d3f
Show file tree
Hide file tree
Showing 4 changed files with 6 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/backend/backend/data/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def SchemaField(
advanced: Optional[bool] = None,
secret: bool = False,
exclude: bool = False,
hidden: Optional[bool] = None,
**kwargs,
) -> T:
json_extra = {
Expand All @@ -121,6 +122,7 @@ def SchemaField(
"placeholder": placeholder,
"secret": secret,
"advanced": advanced,
"hidden": hidden,
}.items()
if v is not None
}
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 f117d3f

Please sign in to comment.