fix(web): style of batch test

This commit is contained in:
JzoNg 2026-04-29 17:46:29 +08:00
parent ae2df0c35e
commit c18c953a7c
6 changed files with 15 additions and 21 deletions

View File

@ -641,7 +641,7 @@ describe('Evaluation', () => {
expect(screen.getAllByText('query').length).toBeGreaterThan(0)
expect(screen.getAllByText('Expect Results').length).toBeGreaterThan(0)
const fileInput = document.querySelector<HTMLInputElement>('input[type="file"][accept=".csv,.xlsx"]')
const fileInput = document.querySelector<HTMLInputElement>('input[type="file"][accept=".csv"]')
expect(fileInput).toBeInTheDocument()
fireEvent.change(fileInput!, {

View File

@ -55,7 +55,6 @@ const InputFieldsTab = ({
isRunning={actions.isRunning}
onUploadFile={actions.handleUploadFile}
onClearUploadedFile={actions.handleClearUploadedFile}
onDownloadTemplate={actions.handleDownloadTemplate}
onRun={actions.handleRun}
/>
</div>

View File

@ -25,7 +25,6 @@ type UploadRunPopoverProps = {
isRunning: boolean
onUploadFile: (file: File | undefined) => void
onClearUploadedFile: () => void
onDownloadTemplate: () => void
onRun: () => void
}
@ -43,7 +42,6 @@ const UploadRunPopover = ({
isRunning,
onUploadFile,
onClearUploadedFile,
onDownloadTemplate,
onRun,
}: UploadRunPopoverProps) => {
const { t } = useTranslation('evaluation')
@ -82,7 +80,7 @@ const UploadRunPopover = ({
ref={fileInputRef}
hidden
type="file"
accept=".csv,.xlsx"
accept=".csv"
onChange={handleFileChange}
/>
{currentFileName
@ -111,7 +109,7 @@ const UploadRunPopover = ({
onClick={onClearUploadedFile}
aria-label={t('batch.removeUploadedFile')}
>
<span aria-hidden="true" className="i-ri-close-line h-4 w-4" />
<span aria-hidden="true" className="i-ri-delete-bin-line h-4 w-4" />
</button>
</div>
</div>
@ -139,15 +137,15 @@ const UploadRunPopover = ({
{t('batch.uploadDropzoneSuffix')}
</div>
<div className="mt-0.5 system-xs-regular text-text-tertiary">
{t('batch.uploadDropzoneDownloadPrefix')}
{' '}
<button
type="button"
className="text-text-accent hover:underline"
onClick={onDownloadTemplate}
onClick={() => fileInputRef.current?.click()}
>
{t('batch.uploadDropzoneDownloadLink')}
{t('batch.uploadDropzoneUploadButton')}
</button>
{' '}
{t('batch.uploadHint')}
</div>
</div>
</div>

View File

@ -58,7 +58,6 @@ const PipelineBatchActions = ({
isRunning={actions.isRunning}
onUploadFile={actions.handleUploadFile}
onClearUploadedFile={actions.handleClearUploadedFile}
onDownloadTemplate={actions.handleDownloadTemplate}
onRun={actions.handleRun}
/>
</div>

View File

@ -1,6 +1,6 @@
{
"batch.description": "Execute batch evaluations and track performance history.",
"batch.downloadTemplate": "Download Excel Template",
"batch.downloadTemplate": "Download CSV Template",
"batch.emptyHistory": "No test history yet.",
"batch.example": "Example:",
"batch.fileRequired": "Upload an evaluation dataset file before running the test.",
@ -22,13 +22,12 @@
"batch.tabs.input-fields": "Input Fields",
"batch.title": "Batch Test",
"batch.uploadAndRun": "Upload & Run Test",
"batch.uploadDropzoneDownloadLink": "here",
"batch.uploadDropzoneDownloadPrefix": "Don't have the template? Download",
"batch.uploadDropzoneEmphasis": "filled",
"batch.uploadDropzonePrefix": "Drag and drop your",
"batch.uploadDropzoneSuffix": "Excel Template",
"batch.uploadDropzoneSuffix": "CSV Template",
"batch.uploadDropzoneUploadButton": "Upload file",
"batch.uploadError": "Failed to upload file.",
"batch.uploadHint": "Select a .csv or .xlsx file",
"batch.uploadHint": "Select a .csv file",
"batch.uploadTitle": "Upload test file",
"batch.uploading": "Uploading file...",
"batch.validation": "Complete the judge model, metrics, and custom mappings before running a batch test.",

View File

@ -1,6 +1,6 @@
{
"batch.description": "执行批量评测并追踪性能历史。",
"batch.downloadTemplate": "下载 Excel 模板",
"batch.downloadTemplate": "下载 CSV 模板",
"batch.emptyHistory": "还没有测试历史。",
"batch.example": "示例:",
"batch.fileRequired": "请先上传评估数据集文件,再运行测试。",
@ -22,13 +22,12 @@
"batch.tabs.input-fields": "输入字段",
"batch.title": "批量测试",
"batch.uploadAndRun": "上传并运行测试",
"batch.uploadDropzoneDownloadLink": "下载",
"batch.uploadDropzoneDownloadPrefix": "还没有模板?",
"batch.uploadDropzoneEmphasis": "已填写的",
"batch.uploadDropzonePrefix": "拖拽你的",
"batch.uploadDropzoneSuffix": "Excel 模板",
"batch.uploadDropzoneSuffix": "CSV 模板",
"batch.uploadDropzoneUploadButton": "上传文件",
"batch.uploadError": "文件上传失败。",
"batch.uploadHint": "选择 .csv 或 .xlsx 文件",
"batch.uploadHint": "选择 .csv 文件",
"batch.uploadTitle": "上传测试文件",
"batch.uploading": "文件上传中...",
"batch.validation": "运行批量测试前,请先完成判定模型、指标和自定义映射配置。",