Compare commits

...

1 Commits

Author SHA1 Message Date
Stephen Zhou
8fd3eeb760 fix: can not upload file in single run (#32276)
Some checks are pending
autofix.ci / autofix (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
Main CI Pipeline / Check Changed Files (push) Waiting to run
Main CI Pipeline / API Tests (push) Blocked by required conditions
Main CI Pipeline / Web Tests (push) Blocked by required conditions
Main CI Pipeline / Style Check (push) Waiting to run
Main CI Pipeline / VDB Tests (push) Blocked by required conditions
Main CI Pipeline / DB Migration Test (push) Blocked by required conditions
2026-02-12 17:23:01 +08:00
3 changed files with 5 additions and 25 deletions

View File

@@ -1,11 +1,9 @@
import type {
FileEntity,
} from './types'
import { isEqual } from 'es-toolkit/predicate'
import {
createContext,
useContext,
useEffect,
useRef,
} from 'react'
import {
@@ -57,20 +55,10 @@ export const FileContextProvider = ({
onChange,
}: FileProviderProps) => {
const storeRef = useRef<FileStore | undefined>(undefined)
if (!storeRef.current)
storeRef.current = createFileStore(value, onChange)
useEffect(() => {
if (!storeRef.current)
return
if (isEqual(value, storeRef.current.getState().files))
return
storeRef.current.setState({
files: value ? [...value] : [],
})
}, [value])
return (
<FileContext.Provider value={storeRef.current}>
{children}

View File

@@ -108,7 +108,7 @@ const FormItem: FC<Props> = ({
const isIteratorItemFile = isIterator && payload.isFileItem
const singleFileValue = useMemo(() => {
if (payload.variable === '#files#')
return value?.[0] || []
return value || []
return value ? [value] : []
}, [payload.variable, value])
@@ -124,19 +124,19 @@ const FormItem: FC<Props> = ({
return (
<div className={cn(className)}>
{!isArrayLikeType && !isBooleanType && (
<div className="system-sm-semibold mb-1 flex h-6 items-center gap-1 text-text-secondary">
<div className="mb-1 flex h-6 items-center gap-1 text-text-secondary system-sm-semibold">
<div className="truncate">
{typeof payload.label === 'object' ? nodeKey : payload.label}
</div>
{payload.hide === true
? (
<span className="system-xs-regular text-text-tertiary">
<span className="text-text-tertiary system-xs-regular">
{t('panel.optional_and_hidden', { ns: 'workflow' })}
</span>
)
: (
!payload.required && (
<span className="system-xs-regular text-text-tertiary">
<span className="text-text-tertiary system-xs-regular">
{t('panel.optional', { ns: 'workflow' })}
</span>
)

View File

@@ -4102,11 +4102,6 @@
"count": 1
}
},
"app/components/explore/app-card/index.spec.tsx": {
"ts/no-explicit-any": {
"count": 1
}
},
"app/components/explore/app-card/index.tsx": {
"tailwindcss/enforce-consistent-class-order": {
"count": 1
@@ -6201,9 +6196,6 @@
}
},
"app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx": {
"tailwindcss/enforce-consistent-class-order": {
"count": 3
},
"ts/no-explicit-any": {
"count": 11
}