diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/component-ui.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/component-ui.tsx index e90a70f3f0..3cdf63ae7b 100644 --- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/component-ui.tsx +++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/component-ui.tsx @@ -33,7 +33,7 @@ const ComponentUI: FC = ({ type: InputVarType.textInput, output_variable_name: varName, placeholder: { - type: 'const', + type: 'constant', selector: [], value: '', }, diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/input-field.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/input-field.tsx index 3597fbcaa3..e6da8e27a4 100644 --- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/input-field.tsx +++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/input-field.tsx @@ -22,7 +22,7 @@ type Props = { const defaultPayload: FormInputItem = { type: InputVarType.paragraph, output_variable_name: '', - placeholder: { type: 'const', selector: [], value: '' }, + placeholder: { type: 'constant', selector: [], value: '' }, } const InputField: React.FC = ({ nodeId, @@ -41,12 +41,12 @@ const InputField: React.FC = ({ return (value: any) => { const nextValue = produce(tempPayload, (draft) => { if (!draft.placeholder) - draft.placeholder = { type: 'const', selector: [], value: '' } + draft.placeholder = { type: 'constant', selector: [], value: '' } draft.placeholder[key] = value if(key === 'selector') draft.placeholder.type = 'variable' else if(key === 'value') - draft.placeholder.type = 'const' + draft.placeholder.type = 'constant' }) setTempPayload(nextValue) } @@ -75,7 +75,7 @@ const InputField: React.FC = ({ { - handlePlaceholderChange('type')(isVariable ? 'variable' : 'const') + handlePlaceholderChange('type')(isVariable ? 'variable' : 'constant') }} nodeId={nodeId} valueSelector={placeholderConfig?.selector} diff --git a/web/app/components/workflow-app/hooks/use-workflow-run.ts b/web/app/components/workflow-app/hooks/use-workflow-run.ts index aba8c64f9d..8097d1402e 100644 --- a/web/app/components/workflow-app/hooks/use-workflow-run.ts +++ b/web/app/components/workflow-app/hooks/use-workflow-run.ts @@ -773,11 +773,11 @@ export const useWorkflowRun = () => { onTTSChunk: (messageId: string, audio: string) => { if (!audio || audio === '') return - player.playAudioWithAudio(audio, true) + player?.playAudioWithAudio(audio, true) AudioPlayerManager.getInstance().resetMsgId(messageId) }, onTTSEnd: (messageId: string, audio: string) => { - player.playAudioWithAudio(audio, false) + player?.playAudioWithAudio(audio, false) }, onWorkflowSuspended: (params) => { handleWorkflowSuspended() diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx index 502398a756..7bebfe7676 100644 --- a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx +++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx @@ -99,6 +99,7 @@ const MethodSelector: FC = ({ id: uuid4(), type: DeliveryMethodType.Email, enabled: false, + config: null, }) }} > diff --git a/web/app/components/workflow/nodes/human-input/default.ts b/web/app/components/workflow/nodes/human-input/default.ts index 402da119dc..5d3fb48e8a 100644 --- a/web/app/components/workflow/nodes/human-input/default.ts +++ b/web/app/components/workflow/nodes/human-input/default.ts @@ -1,6 +1,6 @@ import type { NodeDefault } from '../../types' import type { HumanInputNodeType } from './types' -import { DeliveryMethodType, UserActionButtonType } from './types' +// import { DeliveryMethodType, UserActionButtonType } from './types' import { genNodeMetaData } from '@/app/components/workflow/utils' import { BlockEnum } from '@/app/components/workflow/types' import { BlockClassificationEnum } from '@/app/components/workflow/block-selector/types' @@ -16,40 +16,8 @@ const metaData = genNodeMetaData({ const nodeDefault: NodeDefault = { metaData, defaultValue: { - delivery_methods: [ - { - id: 'webapp-method', - type: DeliveryMethodType.WebApp, - enabled: true, - }, - { - id: 'email-method', - type: DeliveryMethodType.Email, - enabled: false, - }, - ], - user_actions: [ - { - id: 'approve-action', - title: 'Post to X', - button_style: UserActionButtonType.Primary, - }, - { - id: 'regenerate-action', - title: 'regenerate', - button_style: UserActionButtonType.Default, - }, - { - id: 'thinking-action', - title: 'thinking', - button_style: UserActionButtonType.Accent, - }, - { - id: 'cancel-action', - title: 'cancel', - button_style: UserActionButtonType.Ghost, - }, - ], + delivery_methods: [], + user_actions: [], timeout: 3, timeout_unit: 'day', }, diff --git a/web/app/components/workflow/nodes/human-input/types.ts b/web/app/components/workflow/nodes/human-input/types.ts index 9eb8822155..57b2e96dee 100644 --- a/web/app/components/workflow/nodes/human-input/types.ts +++ b/web/app/components/workflow/nodes/human-input/types.ts @@ -40,11 +40,11 @@ export type DeliveryMethod = { id: string type: DeliveryMethodType enabled: boolean - config?: EmailConfig | {} + config?: EmailConfig | {} | null } export type FormInputItemPlaceholder = { - type: 'variable' | 'const', + type: 'variable' | 'constant', selector: ValueSelector value: string } diff --git a/web/app/components/workflow/nodes/human-input/use-single-run-form-params.ts b/web/app/components/workflow/nodes/human-input/use-single-run-form-params.ts index 712c9cff7b..22bf77ffe0 100644 --- a/web/app/components/workflow/nodes/human-input/use-single-run-form-params.ts +++ b/web/app/components/workflow/nodes/human-input/use-single-run-form-params.ts @@ -51,10 +51,10 @@ const useSingleRunFormParams = ({ return { type: item.type, output_variable_name: item.output_variable_name, - placeholder: item.placeholder?.type === 'const' ? item.placeholder.value : '', + placeholder: item.placeholder?.type === 'constant' ? item.placeholder.value : '', } }) - return res + return res }, [inputs.form_content, inputs.inputs]) const getDependentVars = () => { diff --git a/web/service/common.ts b/web/service/common.ts index 7a092a6a24..205586a992 100644 --- a/web/service/common.ts +++ b/web/service/common.ts @@ -137,7 +137,8 @@ export const fetchFilePreview: Fetcher<{ content: string }, { fileID: string }> } export const fetchCurrentWorkspace: Fetcher }> = ({ url, params }) => { - return post(url, { body: params }) + // return post(url, { body: params }) + return get(url, { params }) } export const updateCurrentWorkspace: Fetcher }> = ({ url, body }) => {