feat: last run frontend (#21369)

The frontend of feat: Persist Variables for Enhanced Debugging Workflow (#20699).

Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
Joel
2025-06-24 09:10:30 +08:00
committed by GitHub
parent 10b738a296
commit 1a1bfd4048
122 changed files with 5888 additions and 2061 deletions

View File

@@ -26,9 +26,11 @@ type Option = {
icon: React.JSX.Element
}
type FileUploaderInAttachmentProps = {
isDisabled?: boolean
fileConfig: FileUpload
}
const FileUploaderInAttachment = ({
isDisabled,
fileConfig,
}: FileUploaderInAttachmentProps) => {
const { t } = useTranslation()
@@ -89,16 +91,18 @@ const FileUploaderInAttachment = ({
return (
<div>
<div className='flex items-center space-x-1'>
{options.map(renderOption)}
</div>
{!isDisabled && (
<div className='flex items-center space-x-1'>
{options.map(renderOption)}
</div>
)}
<div className='mt-1 space-y-1'>
{
files.map(file => (
<FileItem
key={file.id}
file={file}
showDeleteAction
showDeleteAction={!isDisabled}
showDownloadAction={false}
onRemove={() => handleRemoveFile(file.id)}
onReUpload={() => handleReUploadFile(file.id)}
@@ -114,18 +118,20 @@ type FileUploaderInAttachmentWrapperProps = {
value?: FileEntity[]
onChange: (files: FileEntity[]) => void
fileConfig: FileUpload
isDisabled?: boolean
}
const FileUploaderInAttachmentWrapper = ({
value,
onChange,
fileConfig,
isDisabled,
}: FileUploaderInAttachmentWrapperProps) => {
return (
<FileContextProvider
value={value}
onChange={onChange}
>
<FileUploaderInAttachment fileConfig={fileConfig} />
<FileUploaderInAttachment isDisabled={isDisabled} fileConfig={fileConfig} />
</FileContextProvider>
)
}

View File

@@ -154,7 +154,7 @@ export const getProcessedFilesFromResponse = (files: FileResponse[]) => {
transferMethod: fileItem.transfer_method,
supportFileType: fileItem.type,
uploadedId: fileItem.upload_file_id || fileItem.related_id,
url: fileItem.url,
url: fileItem.url || fileItem.remote_url,
}
})
}