diff --git a/packages/base/public/static/xlsx_template.xlsx b/packages/base/public/static/xlsx_template.xlsx new file mode 100644 index 000000000..07e7e6313 Binary files /dev/null and b/packages/base/public/static/xlsx_template.xlsx differ diff --git a/packages/sqle/public/static/xlsx_template.xlsx b/packages/sqle/public/static/xlsx_template.xlsx new file mode 100644 index 000000000..07e7e6313 Binary files /dev/null and b/packages/sqle/public/static/xlsx_template.xlsx differ diff --git a/packages/sqle/src/locale/__tests__/fileUploadI18n.test.ts b/packages/sqle/src/locale/__tests__/fileUploadI18n.test.ts new file mode 100644 index 000000000..629499149 --- /dev/null +++ b/packages/sqle/src/locale/__tests__/fileUploadI18n.test.ts @@ -0,0 +1,230 @@ +import execWorkflowZhCN from '../zh-CN/execWorkflow'; +import execWorkflowEnUS from '../en-US/execWorkflow'; +import sqlAuditZhCN from '../zh-CN/sqlAudit'; +import sqlAuditEnUS from '../en-US/sqlAudit'; + +/** + * Recursively collect all leaf key paths from a nested object. + * E.g. { a: { b: 'v', c: 'v2' } } => ['a.b', 'a.c'] + */ +const collectKeyPaths = ( + obj: Record, + prefix = '' +): string[] => { + const keys: string[] = []; + for (const key of Object.keys(obj)) { + const fullPath = prefix ? `${prefix}.${key}` : key; + const value = obj[key]; + if (typeof value === 'object' && value !== null && !Array.isArray(value)) { + keys.push( + ...collectKeyPaths(value as Record, fullPath) + ); + } else { + keys.push(fullPath); + } + } + return keys; +}; + +/** + * Resolve a nested key path (e.g. 'create.form.sqlInfo.zipFile') on an object. + */ +const resolveKeyPath = ( + obj: Record, + path: string +): unknown => { + return path.split('.').reduce((acc: unknown, part: string) => { + if (acc && typeof acc === 'object') { + return (acc as Record)[part]; + } + return undefined; + }, obj); +}; + +describe('i18n key completeness for file upload changes', () => { + describe('execWorkflow - zh-CN and en-US key parity', () => { + const zhKeys = collectKeyPaths( + execWorkflowZhCN as unknown as Record + ); + const enKeys = collectKeyPaths( + execWorkflowEnUS as unknown as Record + ); + + it('zh-CN should not have keys missing in en-US', () => { + const missingInEn = zhKeys.filter((k) => !enKeys.includes(k)); + expect(missingInEn).toEqual([]); + }); + + it('en-US should not have keys missing in zh-CN', () => { + const missingInZh = enKeys.filter((k) => !zhKeys.includes(k)); + expect(missingInZh).toEqual([]); + }); + }); + + describe('sqlAudit - zh-CN and en-US key parity', () => { + const zhKeys = collectKeyPaths( + sqlAuditZhCN as unknown as Record + ); + const enKeys = collectKeyPaths( + sqlAuditEnUS as unknown as Record + ); + + it('zh-CN should not have keys missing in en-US', () => { + const missingInEn = zhKeys.filter((k) => !enKeys.includes(k)); + expect(missingInEn).toEqual([]); + }); + + it('en-US should not have keys missing in zh-CN', () => { + const missingInZh = enKeys.filter((k) => !zhKeys.includes(k)); + expect(missingInZh).toEqual([]); + }); + }); + + describe('execWorkflow - required file upload keys exist', () => { + const requiredKeys = [ + 'create.form.sqlInfo.sqlFileTips', + 'create.form.sqlInfo.zipFile', + 'create.form.sqlInfo.zipFileTips', + 'create.form.sqlInfo.uploadZipFile', + 'create.form.sqlInfo.xlsxTemplateTips', + 'create.form.sqlInfo.downloadTemplate', + 'create.form.sqlInfo.noSqlColumnFound' + ]; + + it.each(requiredKeys)( + 'key "%s" should exist in zh-CN', + (keyPath) => { + const value = resolveKeyPath( + execWorkflowZhCN as unknown as Record, + keyPath + ); + expect(value).toBeDefined(); + expect(typeof value).toBe('string'); + expect((value as string).length).toBeGreaterThan(0); + } + ); + + it.each(requiredKeys)( + 'key "%s" should exist in en-US', + (keyPath) => { + const value = resolveKeyPath( + execWorkflowEnUS as unknown as Record, + keyPath + ); + expect(value).toBeDefined(); + expect(typeof value).toBe('string'); + expect((value as string).length).toBeGreaterThan(0); + } + ); + }); + + describe('sqlAudit - required file upload keys exist', () => { + const requiredKeys = [ + 'create.sqlInfo.uploadTypeEnum.zipFile', + 'create.sqlInfo.uploadLabelEnum.zipFile', + 'create.sqlInfo.uploadFileTip.sqlFile', + 'create.sqlInfo.uploadFileTip.zipFile', + 'create.sqlInfo.xlsxTemplateTips', + 'create.sqlInfo.downloadTemplate', + 'create.sqlInfo.noSqlColumnFound' + ]; + + it.each(requiredKeys)( + 'key "%s" should exist in zh-CN', + (keyPath) => { + const value = resolveKeyPath( + sqlAuditZhCN as unknown as Record, + keyPath + ); + expect(value).toBeDefined(); + expect(typeof value).toBe('string'); + expect((value as string).length).toBeGreaterThan(0); + } + ); + + it.each(requiredKeys)( + 'key "%s" should exist in en-US', + (keyPath) => { + const value = resolveKeyPath( + sqlAuditEnUS as unknown as Record, + keyPath + ); + expect(value).toBeDefined(); + expect(typeof value).toBe('string'); + expect((value as string).length).toBeGreaterThan(0); + } + ); + }); + + describe('execWorkflow - file upload tip content correctness', () => { + it('zh-CN sqlFileTips should mention .sql, .txt, .java, .xlsx', () => { + const tip = (execWorkflowZhCN as Record as any).create + .form.sqlInfo.sqlFileTips; + expect(tip).toContain('.sql'); + expect(tip).toContain('.txt'); + expect(tip).toContain('.java'); + expect(tip).toContain('.xlsx'); + }); + + it('zh-CN zipFileTips should mention .zip, .rar, .7z', () => { + const tip = (execWorkflowZhCN as Record as any).create + .form.sqlInfo.zipFileTips; + expect(tip).toContain('.zip'); + expect(tip).toContain('.rar'); + expect(tip).toContain('.7z'); + }); + + it('en-US sqlFileTips should mention .sql, .txt, .java, .xlsx', () => { + const tip = (execWorkflowEnUS as Record as any).create + .form.sqlInfo.sqlFileTips; + expect(tip).toContain('.sql'); + expect(tip).toContain('.txt'); + expect(tip).toContain('.java'); + expect(tip).toContain('.xlsx'); + }); + + it('en-US zipFileTips should mention .zip, .rar, .7z', () => { + const tip = (execWorkflowEnUS as Record as any).create + .form.sqlInfo.zipFileTips; + expect(tip).toContain('.zip'); + expect(tip).toContain('.rar'); + expect(tip).toContain('.7z'); + }); + }); + + describe('sqlAudit - file upload tip content correctness', () => { + it('zh-CN uploadFileTip.sqlFile should mention .sql, .txt, .java, .xlsx', () => { + const tip = (sqlAuditZhCN as Record as any).create + .sqlInfo.uploadFileTip.sqlFile; + expect(tip).toContain('.sql'); + expect(tip).toContain('.txt'); + expect(tip).toContain('.java'); + expect(tip).toContain('.xlsx'); + }); + + it('zh-CN uploadFileTip.zipFile should mention .zip, .rar, .7z', () => { + const tip = (sqlAuditZhCN as Record as any).create + .sqlInfo.uploadFileTip.zipFile; + expect(tip).toContain('.zip'); + expect(tip).toContain('.rar'); + expect(tip).toContain('.7z'); + }); + + it('en-US uploadFileTip.sqlFile should mention .sql, .txt, .java, .xlsx', () => { + const tip = (sqlAuditEnUS as Record as any).create + .sqlInfo.uploadFileTip.sqlFile; + expect(tip).toContain('.sql'); + expect(tip).toContain('.txt'); + expect(tip).toContain('.java'); + expect(tip).toContain('.xlsx'); + }); + + it('en-US uploadFileTip.zipFile should mention .zip, .rar, .7z', () => { + const tip = (sqlAuditEnUS as Record as any).create + .sqlInfo.uploadFileTip.zipFile; + expect(tip).toContain('.zip'); + expect(tip).toContain('.rar'); + expect(tip).toContain('.7z'); + }); + }); +}); diff --git a/packages/sqle/src/locale/en-US/execWorkflow.ts b/packages/sqle/src/locale/en-US/execWorkflow.ts index 7fa06b17e..3fc9bc18a 100644 --- a/packages/sqle/src/locale/en-US/execWorkflow.ts +++ b/packages/sqle/src/locale/en-US/execWorkflow.ts @@ -80,13 +80,13 @@ export default { sql: 'SQL statement', sqlFile: 'SQL file', - sqlFileTips: 'Click to select a SQL file or drag the file to this area', + sqlFileTips: 'Click to select a file or drag the file to this area. Supports .sql, .txt, .java, .xlsx formats', mybatisFile: 'Mybatis XML file', mybatisFileTips: 'Click to select an XML file or drag the file to this area', - zipFile: 'Zip file', + zipFile: 'Compressed file', zipFileTips: - 'Click to select a zip file or drag the file to this area, currently only supports SQL auditing of .xml and .sql files in the ZIP file', + 'Click to select a compressed file or drag the file to this area. Supports .zip, .rar, .7z formats. Only .sql, .xml, .txt, .java files in the archive will be audited', addInstanceTips: 'Please add DB instance', addInstance: 'Add DB instance', @@ -94,7 +94,10 @@ export default { manualInput: 'Enter SQL statement', uploadFile: 'Upload SQL file', updateMybatisFile: 'Upload Mybatis XML file', - uploadZipFile: 'Upload ZIP file', + uploadZipFile: 'Upload compressed file', + xlsxTemplateTips: 'Please use the standard template format', + downloadTemplate: 'Download template', + noSqlColumnFound: 'No column containing SQL found, please refer to the template', audit: 'Audit', analyze: 'SQL analysis', diff --git a/packages/sqle/src/locale/en-US/sqlAudit.ts b/packages/sqle/src/locale/en-US/sqlAudit.ts index bc0e37127..ea6b15bec 100644 --- a/packages/sqle/src/locale/en-US/sqlAudit.ts +++ b/packages/sqle/src/locale/en-US/sqlAudit.ts @@ -73,25 +73,28 @@ export default { sql: 'Input SQL statement', sqlFile: 'Upload SQL file', mybatisFile: 'Upload Mybatis XML file', - zipFile: 'Upload ZIP file', + zipFile: 'Upload compressed file', git: 'Configure GIT repository' }, uploadLabelEnum: { sql: 'SQL statement', sqlFile: 'SQL file', mybatisFile: 'Mybatis XML file', - zipFile: 'ZIP file', + zipFile: 'Compressed file', gitUrl: 'GIT address', gitUrlTips: 'Please enter the HTTP(S) clone address of the git repository. if it is a private GIT repository, you must enter the account and password with read permission' }, uploadFileTip: { - sqlFile: 'Click to select a SQL file or drag the file to this area', + sqlFile: 'Click to select a file or drag the file to this area. Supports .sql, .txt, .java, .xlsx formats', mybatisFile: 'Click to select a Mybatis XML file or drag the file to this area', zipFile: - 'Click to select a ZIP file or drag the file to this area. currently, only .xml and .sql files in the ZIP file can be audited for SQL' - } + 'Click to select a compressed file or drag the file to this area. Supports .zip, .rar, .7z formats. Only .sql, .xml, .txt, .java files in the archive will be audited' + }, + xlsxTemplateTips: 'Please use the standard template format', + downloadTemplate: 'Download template', + noSqlColumnFound: 'No column containing SQL found, please refer to the template' } }, result: { diff --git a/packages/sqle/src/locale/zh-CN/execWorkflow.ts b/packages/sqle/src/locale/zh-CN/execWorkflow.ts index 336bce2c8..2b72fee0c 100644 --- a/packages/sqle/src/locale/zh-CN/execWorkflow.ts +++ b/packages/sqle/src/locale/zh-CN/execWorkflow.ts @@ -76,12 +76,12 @@ export default { sql: 'SQL语句', sqlFile: 'SQL文件', - sqlFileTips: '点击选择SQL文件或将文件拖拽到此区域', + sqlFileTips: '点击选择文件或将文件拖拽到此区域,支持 .sql, .txt, .java, .xlsx 格式', mybatisFile: 'Mybatis的XML文件', mybatisFileTips: '点击选择XML文件或将文件拖拽到此区域', - zipFile: 'zip文件', + zipFile: '压缩包', zipFileTips: - '点击选择zip文件或将文件拖拽到此区域,当前仅支持对ZIP文件中的.xml文件及.sql文件做SQL审核', + '点击选择压缩包或将文件拖拽到此区域,支持 .zip, .rar, .7z 格式,仅支持对压缩包内 .sql, .xml, .txt, .java 文件做SQL审核', addInstanceTips: '请添加数据源', addInstance: '添加数据源', @@ -89,7 +89,10 @@ export default { manualInput: '输入SQL语句', uploadFile: '上传SQL文件', updateMybatisFile: '上传Mybatis的XML文件', - uploadZipFile: '上传ZIP文件', + uploadZipFile: '上传压缩包', + xlsxTemplateTips: '请使用标准模板格式', + downloadTemplate: '下载模板', + noSqlColumnFound: '未找到包含SQL的列,请参照模板格式', audit: '审核', analyze: 'SQL分析', diff --git a/packages/sqle/src/locale/zh-CN/sqlAudit.ts b/packages/sqle/src/locale/zh-CN/sqlAudit.ts index a35845bdc..f81e02e75 100644 --- a/packages/sqle/src/locale/zh-CN/sqlAudit.ts +++ b/packages/sqle/src/locale/zh-CN/sqlAudit.ts @@ -79,14 +79,14 @@ export default { sql: '输入SQL语句', sqlFile: '上传SQL文件', mybatisFile: '上传Mybatis的XML文件', - zipFile: '上传ZIP文件', + zipFile: '上传压缩包', git: '配置GIT仓库' }, uploadLabelEnum: { sql: 'SQL语句', sqlFile: 'SQL文件', mybatisFile: 'Mybatis的XML文件', - zipFile: 'ZIP文件', + zipFile: '压缩包', gitUrl: 'GIT地址', gitProtocol: 'Git协议类型', gitUrlTips: '请输入代码仓库地址', @@ -101,11 +101,14 @@ export default { sshAuthTips: '使用SSH协议克隆仓库时,需要先配置SSH密钥。' }, uploadFileTip: { - sqlFile: '点击选择SQL文件或将文件拖拽到此区域', + sqlFile: '点击选择文件或将文件拖拽到此区域,支持 .sql, .txt, .java, .xlsx 格式', mybatisFile: '点击选择Mybatis的XML文件或将文件拖拽到此区域', zipFile: - '点击选择ZIP文件或将文件拖拽到此区域,当前仅支持对ZIP文件中的.xml文件及.sql文件做SQL审核' - } + '点击选择压缩包或将文件拖拽到此区域,支持 .zip, .rar, .7z 格式,仅支持对压缩包内 .sql, .xml, .txt, .java 文件做SQL审核' + }, + xlsxTemplateTips: '请使用标准模板格式', + downloadTemplate: '下载模板', + noSqlColumnFound: '未找到包含SQL的列,请参照模板格式' } }, result: { diff --git a/packages/sqle/src/page/SqlAudit/Create/SQLStatementForm/__tests__/SqlUploadCont.accept.test.tsx b/packages/sqle/src/page/SqlAudit/Create/SQLStatementForm/__tests__/SqlUploadCont.accept.test.tsx new file mode 100644 index 000000000..1f8b9ccb2 --- /dev/null +++ b/packages/sqle/src/page/SqlAudit/Create/SQLStatementForm/__tests__/SqlUploadCont.accept.test.tsx @@ -0,0 +1,116 @@ +import { screen } from '@testing-library/react'; +import { Form } from 'antd'; +import SqlUploadFileCont from '../components/SqlUploadCont'; +import { FormSubmitStatusContext } from '../..'; +import { UploadTypeEnum } from '../../SQLInfoForm/index.type'; +import { + ignoreConsoleErrors, + UtilsConsoleErrorStringsEnum +} from '@actiontech/shared/lib/testUtil/common'; +import { sqleSuperRender } from '../../../../../testUtils/superRender'; + +describe('SqlUploadCont accept attributes and tips', () => { + ignoreConsoleErrors([UtilsConsoleErrorStringsEnum.UNKNOWN_EVENT_HANDLER]); + + /** + * Wrapper component that creates the form instance internally + * and includes a hidden Form.Item for uploadType so that + * Form.useWatch('uploadType', form) works correctly. + */ + const TestWrapper = ({ uploadType }: { uploadType: UploadTypeEnum }) => { + const [form] = Form.useForm(); + + return ( + +
+ + + + + +
+ ); + }; + + const renderWithUploadType = (uploadType: UploadTypeEnum) => { + return sqleSuperRender(); + }; + + const acceptTestCases = [ + { + name: 'SQL file upload accept should include .sql, .txt, .java, .xlsx', + uploadType: UploadTypeEnum.sqlFile, + expectedAccept: '.sql,.txt,.java,.xlsx' + }, + { + name: 'ZIP file upload accept should include .zip, .rar, .7z', + uploadType: UploadTypeEnum.zipFile, + expectedAccept: '.zip,.rar,.7z' + } + ]; + + it.each(acceptTestCases)( + '$name', + ({ uploadType, expectedAccept }) => { + const { container } = renderWithUploadType(uploadType); + const fileInput = container.querySelector( + `input[type="file"][accept="${expectedAccept}"]` + ); + expect(fileInput).not.toBeNull(); + } + ); + + it('should display correct SQL file tips text including .xlsx', () => { + renderWithUploadType(UploadTypeEnum.sqlFile); + expect( + screen.getByText( + /支持 \.sql, \.txt, \.java, \.xlsx 格式/ + ) + ).toBeInTheDocument(); + }); + + it('should display correct ZIP file tips text', () => { + renderWithUploadType(UploadTypeEnum.zipFile); + expect( + screen.getByText( + /支持 \.zip, \.rar, \.7z 格式/ + ) + ).toBeInTheDocument(); + }); + + it('should render XLSX template tips text when upload type is sqlFile', () => { + renderWithUploadType(UploadTypeEnum.sqlFile); + expect( + screen.getByText(/请使用标准模板格式/) + ).toBeInTheDocument(); + }); + + it('should render XLSX template download link when upload type is sqlFile', () => { + const { container } = renderWithUploadType(UploadTypeEnum.sqlFile); + const downloadLink = container.querySelector( + 'a[href="/static/xlsx_template.xlsx"]' + ); + expect(downloadLink).not.toBeNull(); + expect(downloadLink?.textContent).toContain('下载模板'); + expect(downloadLink?.getAttribute('download')).toBe('xlsx_template.xlsx'); + }); + + it('should not render file inputs when uploadType is not a file-based type', () => { + // When uploadType is not registered as a Form.Item (simulating + // a non-file upload type), Form.useWatch returns undefined, + // so no EmptyBox conditions match and no file inputs render. + const NoFileWrapper = () => { + const [form] = Form.useForm(); + return ( + +
+ + +
+ ); + }; + const { container } = sqleSuperRender(); + const fileInput = container.querySelector('input[type="file"]'); + expect(fileInput).toBeNull(); + }); +}); diff --git a/packages/sqle/src/page/SqlAudit/Create/SQLStatementForm/components/SqlUploadCont/index.tsx b/packages/sqle/src/page/SqlAudit/Create/SQLStatementForm/components/SqlUploadCont/index.tsx index fee332ebd..33e126e66 100644 --- a/packages/sqle/src/page/SqlAudit/Create/SQLStatementForm/components/SqlUploadCont/index.tsx +++ b/packages/sqle/src/page/SqlAudit/Create/SQLStatementForm/components/SqlUploadCont/index.tsx @@ -96,13 +96,24 @@ const SqlUploadFileCont = ({ form }: SqlUploadFileContProps) => { getValueFromEvent={getFileFromUploadChangeEvent} > false} onRemove={removeFile.bind(null, 'sqlFile')} title={t('sqlAudit.create.sqlInfo.uploadFileTip.sqlFile')} disabled={submitLoading} /> +
+ {t('sqlAudit.create.sqlInfo.xlsxTemplateTips')} + {' '} + + {t('sqlAudit.create.sqlInfo.downloadTemplate')} + +
{/* mybatisFile */} @@ -145,7 +156,7 @@ const SqlUploadFileCont = ({ form }: SqlUploadFileContProps) => { getValueFromEvent={getFileFromUploadChangeEvent} > false} onRemove={removeFile.bind(null, 'zipFile')} title={t('sqlAudit.create.sqlInfo.uploadFileTip.zipFile')} diff --git a/packages/sqle/src/page/SqlExecWorkflow/Common/SqlStatementFormController/SqlStatementFormItem/__tests__/SqlUploadContent.accept.test.tsx b/packages/sqle/src/page/SqlExecWorkflow/Common/SqlStatementFormController/SqlStatementFormItem/__tests__/SqlUploadContent.accept.test.tsx new file mode 100644 index 000000000..2b31d24f8 --- /dev/null +++ b/packages/sqle/src/page/SqlExecWorkflow/Common/SqlStatementFormController/SqlStatementFormItem/__tests__/SqlUploadContent.accept.test.tsx @@ -0,0 +1,108 @@ +import { renderHook, screen } from '@testing-library/react'; +import { Form } from 'antd'; +import SqlUploadContent from '../components/SqlUploadContent'; +import { AuditTaskResV1SqlSourceEnum } from '@actiontech/shared/lib/api/sqle/service/common.enum'; +import { + ignoreConsoleErrors, + UtilsConsoleErrorStringsEnum +} from '@actiontech/shared/lib/testUtil/common'; +import { sqleSuperRender } from '../../../../../../testUtils/superRender'; + +describe('SqlUploadContent accept attributes and tips', () => { + ignoreConsoleErrors([UtilsConsoleErrorStringsEnum.UNKNOWN_EVENT_HANDLER]); + + const renderWithUploadType = ( + uploadType: AuditTaskResV1SqlSourceEnum + ) => { + const { result } = renderHook(() => Form.useForm()); + return sqleSuperRender( +
+ + + ); + }; + + const acceptTestCases = [ + { + name: 'SQL file upload accept should include .sql, .txt, .java, .xlsx', + uploadType: AuditTaskResV1SqlSourceEnum.sql_file, + expectedAccept: '.sql,.txt,.java,.xlsx' + }, + { + name: 'ZIP file upload accept should include .zip, .rar, .7z', + uploadType: AuditTaskResV1SqlSourceEnum.zip_file, + expectedAccept: '.zip,.rar,.7z' + } + ]; + + it.each(acceptTestCases)( + '$name', + ({ uploadType, expectedAccept }) => { + const { container } = renderWithUploadType(uploadType); + const fileInput = container.querySelector( + `input[type="file"][accept="${expectedAccept}"]` + ); + expect(fileInput).not.toBeNull(); + } + ); + + it('should display correct SQL file tips text including .xlsx', () => { + renderWithUploadType(AuditTaskResV1SqlSourceEnum.sql_file); + expect( + screen.getByText( + /支持 \.sql, \.txt, \.java, \.xlsx 格式/ + ) + ).toBeInTheDocument(); + }); + + it('should display correct ZIP file tips text', () => { + renderWithUploadType(AuditTaskResV1SqlSourceEnum.zip_file); + expect( + screen.getByText( + /支持 \.zip, \.rar, \.7z 格式/ + ) + ).toBeInTheDocument(); + }); + + it('should render XLSX template tips text when upload type is sql_file', () => { + renderWithUploadType(AuditTaskResV1SqlSourceEnum.sql_file); + expect( + screen.getByText(/请使用标准模板格式/) + ).toBeInTheDocument(); + }); + + it('should render XLSX template download link when upload type is sql_file', () => { + const { container } = renderWithUploadType( + AuditTaskResV1SqlSourceEnum.sql_file + ); + const downloadLink = container.querySelector( + 'a[href="/static/xlsx_template.xlsx"]' + ); + expect(downloadLink).not.toBeNull(); + expect(downloadLink?.textContent).toContain('下载模板'); + expect(downloadLink?.getAttribute('download')).toBe('xlsx_template.xlsx'); + }); + + it('should not render file inputs when no file-based upload type is active', () => { + // Render without specifying an upload type (defaults to undefined), + // so no LazyLoadComponent opens and no file inputs should appear. + // Avoids rendering form_data type which triggers CustomMonacoEditor + // and its Redux dependencies outside the scope of this test. + const { result } = renderHook(() => Form.useForm()); + const { container } = sqleSuperRender( +
+ + + ); + const fileInput = container.querySelector('input[type="file"]'); + expect(fileInput).toBeNull(); + }); +}); diff --git a/packages/sqle/src/page/SqlExecWorkflow/Common/SqlStatementFormController/SqlStatementFormItem/components/SqlUploadContent.tsx b/packages/sqle/src/page/SqlExecWorkflow/Common/SqlStatementFormController/SqlStatementFormItem/components/SqlUploadContent.tsx index 76818b4ca..ef58f7693 100644 --- a/packages/sqle/src/page/SqlExecWorkflow/Common/SqlStatementFormController/SqlStatementFormItem/components/SqlUploadContent.tsx +++ b/packages/sqle/src/page/SqlExecWorkflow/Common/SqlStatementFormController/SqlStatementFormItem/components/SqlUploadContent.tsx @@ -114,12 +114,23 @@ const SqlUploadContent: React.FC = ({ getValueFromEvent={getFileFromUploadChangeEvent} > false} onRemove={removeFile.bind(null, generateFieldName('sql_file'))} title={t('execWorkflow.create.form.sqlInfo.sqlFileTips')} /> +
+ {t('execWorkflow.create.form.sqlInfo.xlsxTemplateTips')} + {' '} + + {t('execWorkflow.create.form.sqlInfo.downloadTemplate')} + +
= ({ getValueFromEvent={getFileFromUploadChangeEvent} > false} onRemove={removeFile.bind(null, generateFieldName('zip_file'))} title={t('execWorkflow.create.form.sqlInfo.zipFileTips')}