diff --git a/web/app/components/workflow/nodes/trigger-webhook/__tests__/default.test.ts b/web/app/components/workflow/nodes/trigger-webhook/__tests__/default.test.ts index a16227f766..649b1a5286 100644 --- a/web/app/components/workflow/nodes/trigger-webhook/__tests__/default.test.ts +++ b/web/app/components/workflow/nodes/trigger-webhook/__tests__/default.test.ts @@ -6,6 +6,7 @@ */ import nodeDefault from '../default' +import type { WebhookTriggerNodeType } from '../types' // Simple mock translation function const mockT = (key: string, params?: any) => { @@ -32,13 +33,11 @@ describe('Webhook Trigger Node Default', () => { expect(Array.isArray(defaultValue.headers)).toBe(true) expect(Array.isArray(defaultValue.params)).toBe(true) expect(Array.isArray(defaultValue.body)).toBe(true) - expect(Array.isArray(defaultValue.default_value)).toBe(true) // Initial arrays should be empty expect(defaultValue.headers).toHaveLength(0) expect(defaultValue.params).toHaveLength(0) expect(defaultValue.body).toHaveLength(0) - expect(defaultValue.default_value).toHaveLength(0) }) it('should have empty prev nodes', () => { @@ -55,7 +54,7 @@ describe('Webhook Trigger Node Default', () => { describe('Validation - checkValid', () => { it('should validate successfully with default configuration', () => { - const payload = nodeDefault.defaultValue + const payload = nodeDefault.defaultValue as WebhookTriggerNodeType const result = nodeDefault.checkValid(payload, mockT) expect(result.isValid).toBe(true) @@ -67,7 +66,7 @@ describe('Webhook Trigger Node Default', () => { ...nodeDefault.defaultValue, status_code: 404, response_body: '{"error": "Not found"}', - } + } as WebhookTriggerNodeType const result = nodeDefault.checkValid(payload, mockT) expect(result.isValid).toBe(true) @@ -77,7 +76,7 @@ describe('Webhook Trigger Node Default', () => { const payload = { ...nodeDefault.defaultValue, async_mode: false, - } + } as WebhookTriggerNodeType const result = nodeDefault.checkValid(payload, mockT) expect(result.isValid).toBe(true) diff --git a/web/app/components/workflow/nodes/trigger-webhook/components/generic-table.tsx b/web/app/components/workflow/nodes/trigger-webhook/components/generic-table.tsx index 31a29121ac..1abc431ced 100644 --- a/web/app/components/workflow/nodes/trigger-webhook/components/generic-table.tsx +++ b/web/app/components/workflow/nodes/trigger-webhook/components/generic-table.tsx @@ -224,7 +224,7 @@ const GenericTable: FC = ({ )}
- {displayRows.map(({ row, dataIndex, isVirtual }, renderIndex) => { + {displayRows.map(({ row, dataIndex, isVirtual: _isVirtual }, renderIndex) => { const rowKey = `row-${renderIndex}` // Check if primary identifier column has content diff --git a/web/app/components/workflow/nodes/trigger-webhook/default.ts b/web/app/components/workflow/nodes/trigger-webhook/default.ts index 17a1d945eb..2b254de943 100644 --- a/web/app/components/workflow/nodes/trigger-webhook/default.ts +++ b/web/app/components/workflow/nodes/trigger-webhook/default.ts @@ -2,7 +2,6 @@ import { BlockEnum } from '../../types' import type { NodeDefault } from '../../types' import type { WebhookTriggerNodeType } from './types' import { ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/blocks' -import type { DefaultValueForm } from '@/app/components/workflow/nodes/_base/components/error-handle/types' const nodeDefault: NodeDefault = { defaultValue: { @@ -15,7 +14,6 @@ const nodeDefault: NodeDefault = { async_mode: true, status_code: 200, response_body: '', - default_value: [] as DefaultValueForm[], }, getAvailablePrevNodes(_isChatMode: boolean) { return [] diff --git a/web/app/components/workflow/nodes/trigger-webhook/types.ts b/web/app/components/workflow/nodes/trigger-webhook/types.ts index a236dc20de..8d27622bc5 100644 --- a/web/app/components/workflow/nodes/trigger-webhook/types.ts +++ b/web/app/components/workflow/nodes/trigger-webhook/types.ts @@ -1,6 +1,4 @@ import type { CommonNodeType, InputVar } from '@/app/components/workflow/types' -import type { DefaultValueForm } from '@/app/components/workflow/nodes/_base/components/error-handle/types' -import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types' export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' @@ -28,8 +26,5 @@ export type WebhookTriggerNodeType = CommonNodeType & { async_mode: boolean status_code: number response_body: string - http_methods?: HttpMethod[] - error_strategy?: ErrorHandleTypeEnum - default_value?: DefaultValueForm[] variables: InputVar[] } diff --git a/web/app/components/workflow/nodes/trigger-webhook/use-config.ts b/web/app/components/workflow/nodes/trigger-webhook/use-config.ts index 82f44f7ea7..7c217d2c17 100644 --- a/web/app/components/workflow/nodes/trigger-webhook/use-config.ts +++ b/web/app/components/workflow/nodes/trigger-webhook/use-config.ts @@ -5,8 +5,6 @@ import type { HttpMethod, WebhookHeader, WebhookParameter, WebhookTriggerNodeTyp import { useNodesReadOnly } from '@/app/components/workflow/hooks' import useNodeCrud from '@/app/components/workflow/nodes/_base/hooks/use-node-crud' import { useStore as useAppStore } from '@/app/components/app/store' -import type { DefaultValueForm } from '@/app/components/workflow/nodes/_base/components/error-handle/types' -import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types' import { fetchWebhookUrl } from '@/service/apps' import type { InputVar } from '@/app/components/workflow/types' import { InputVarType } from '@/app/components/workflow/types' @@ -124,18 +122,6 @@ const useConfig = (id: string, payload: WebhookTriggerNodeType) => { })) }, [inputs, setInputs]) - const handleErrorStrategyChange = useCallback((errorStrategy: ErrorHandleTypeEnum) => { - setInputs(produce(inputs, (draft) => { - draft.error_strategy = errorStrategy - })) - }, [inputs, setInputs]) - - const handleDefaultValueChange = useCallback((defaultValue: DefaultValueForm[]) => { - setInputs(produce(inputs, (draft) => { - draft.default_value = defaultValue - })) - }, [inputs, setInputs]) - const generateWebhookUrl = useCallback(async () => { // Idempotency: if we already have a URL, just return it. if (inputs.webhook_url && inputs.webhook_url.length > 0) @@ -177,8 +163,6 @@ const useConfig = (id: string, payload: WebhookTriggerNodeType) => { handleAsyncModeChange, handleStatusCodeChange, handleResponseBodyChange, - handleErrorStrategyChange, - handleDefaultValueChange, generateWebhookUrl, } } diff --git a/web/app/components/workflow/utils/workflow.ts b/web/app/components/workflow/utils/workflow.ts index a93ce7ce12..5f95013673 100644 --- a/web/app/components/workflow/utils/workflow.ts +++ b/web/app/components/workflow/utils/workflow.ts @@ -350,5 +350,5 @@ export const getParallelInfo = (nodes: Node[], edges: Edge[], parentNodeId?: str } export const hasErrorHandleNode = (nodeType?: BlockEnum) => { - return nodeType === BlockEnum.LLM || nodeType === BlockEnum.Tool || nodeType === BlockEnum.HttpRequest || nodeType === BlockEnum.Code || nodeType === BlockEnum.TriggerWebhook + return nodeType === BlockEnum.LLM || nodeType === BlockEnum.Tool || nodeType === BlockEnum.HttpRequest || nodeType === BlockEnum.Code }