refactor: enhance type definitions and update import paths in form input and trigger components

This commit is contained in:
zhsama 2025-09-28 15:42:38 +08:00
parent b100ce15cd
commit 6795015d00
4 changed files with 10 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import { useFetchDynamicOptions } from '@/service/use-plugins'
import { useTriggerPluginDynamicOptions } from '@/service/use-triggers'
import type { ToolWithProvider, ValueSelector, Var } from '@/app/components/workflow/types'
import type { TriggerWithProvider } from '@/app/components/workflow/block-selector/types'
import type { Tool } from '@/app/components/tools/types'
import FormInputTypeSwitch from './form-input-type-switch'
import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list'
@ -26,6 +27,8 @@ import cn from '@/utils/classnames'
import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/react'
import { ChevronDownIcon } from '@heroicons/react/20/solid'
import { RiCheckLine, RiLoader4Line } from '@remixicon/react'
import type { Trigger } from '@/app/components/tools/types'
type Props = {
readOnly: boolean
nodeId: string
@ -33,8 +36,8 @@ type Props = {
value: ResourceVarInputs
onChange: (value: any) => void
inPanel?: boolean
currentTool?: Tool
currentProvider?: ToolWithProvider
currentTool?: Tool | Trigger
currentProvider?: ToolWithProvider | TriggerWithProvider
showManageInputField?: boolean
onManageInputField?: () => void
extraParams?: Record<string, any>

View File

@ -22,6 +22,7 @@ import { getNodeInfoById, isConversationVar, isENV, isRagVariableVar, isSystemVa
import ConstantField from './constant-field'
import cn from '@/utils/classnames'
import type { CommonNodeType, Node, NodeOutPutVar, ToolWithProvider, ValueSelector, Var } from '@/app/components/workflow/types'
import type { TriggerWithProvider } from '@/app/components/workflow/block-selector/types'
import type { CredentialFormSchemaSelect } from '@/app/components/header/account-setting/model-provider-page/declarations'
import { type CredentialFormSchema, type FormOption, FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
import { BlockEnum } from '@/app/components/workflow/types'
@ -79,7 +80,7 @@ type Props = {
popupFor?: 'assigned' | 'toAssigned'
zIndex?: number
currentTool?: Tool
currentProvider?: ToolWithProvider
currentProvider?: ToolWithProvider | TriggerWithProvider
preferSchemaType?: boolean
}

View File

@ -2,9 +2,9 @@
import type { CredentialFormSchema } from '@/app/components/header/account-setting/model-provider-page/declarations'
import type { Trigger } from '@/app/components/tools/types'
import type { FC } from 'react'
import type { PluginTriggerVarInputs } from '../../types'
import type { PluginTriggerVarInputs } from '@/app/components/workflow/nodes/trigger-plugin/types'
import TriggerFormItem from './item'
import type { TriggerWithProvider } from '../../../../block-selector/types'
import type { TriggerWithProvider } from '@/app/components/workflow/block-selector/types'
type Props = {
readOnly: boolean

View File

@ -89,7 +89,7 @@ const TriggerFormItem: FC<Props> = ({
value={value}
onChange={onChange}
inPanel={inPanel}
currentResource={currentTrigger}
currentTool={currentTrigger}
currentProvider={currentProvider}
providerType='trigger'
extraParams={extraParams}