Feat/attachments (#9526)

Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: JzoNg <jzongcode@gmail.com>
This commit is contained in:
zxhlyh
2024-10-21 10:32:37 +08:00
committed by GitHub
parent 4fd2743efa
commit 7a1d6fe509
445 changed files with 11759 additions and 6922 deletions

View File

@@ -127,14 +127,15 @@ const InputVarList: FC<Props> = ({
const varInput = value[variable]
const isNumber = type === FormTypeEnum.textNumber
const isSelect = type === FormTypeEnum.select
const isFile = type === FormTypeEnum.files
const isFile = type === FormTypeEnum.file
const isFileArray = type === FormTypeEnum.files
const isString = type !== FormTypeEnum.textNumber && type !== FormTypeEnum.files && type !== FormTypeEnum.select
return (
<div key={variable} className='space-y-1'>
<div className='flex items-center h-[18px] space-x-2'>
<span className='text-[13px] font-medium text-gray-900'>{label[language] || label.en_US}</span>
<span className='text-xs font-normal text-gray-500'>{paramType(type)}</span>
{required && <span className='leading-[18px] text-xs font-normal text-[#EC4A0A]'>Required</span>}
<span className='text-text-secondary code-sm-semibold'>{label[language] || label.en_US}</span>
<span className='text-text-tertiary system-xs-regular'>{paramType(type)}</span>
{required && <span className='text-util-colors-orange-dark-orange-dark-600 system-xs-regular'>Required</span>}
</div>
{isString && (
<Input
@@ -165,6 +166,18 @@ const InputVarList: FC<Props> = ({
/>
)}
{isFile && (
<VarReferencePicker
readonly={readOnly}
isShowNodeName
nodeId={nodeId}
value={varInput?.type === VarKindType.constant ? (varInput?.value || '') : (varInput?.value || [])}
onChange={handleNotMixedTypeChange(variable)}
onOpen={handleOpen(index)}
defaultVarKindType={VarKindType.variable}
filterVar={(varPayload: Var) => varPayload.type === VarType.file}
/>
)}
{isFileArray && (
<VarReferencePicker
readonly={readOnly}
isShowNodeName
@@ -176,7 +189,7 @@ const InputVarList: FC<Props> = ({
filterVar={(varPayload: Var) => varPayload.type === VarType.arrayFile}
/>
)}
{tooltip && <div className='leading-[18px] text-xs font-normal text-gray-600'>{tooltip[language] || tooltip.en_US}</div>}
{tooltip && <div className='text-text-tertiary body-xs-regular'>{tooltip[language] || tooltip.en_US}</div>}
</div>
)
})