diff --git a/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/SqlMode.tsx b/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/SqlMode.tsx
index 21a205b26..8244c930e 100644
--- a/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/SqlMode.tsx
+++ b/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/SqlMode.tsx
@@ -29,10 +29,7 @@ import { BackupStrategyDictionary } from '../../../../../../Common/AuditResultLi
import { UpdateSqlBackupStrategyReqStrategyEnum } from '@actiontech/shared/lib/api/sqle/service/common.enum';
import { WarningFilled } from '@actiontech/icons';
import RollbackWorkflowEntry from './components/RollbackWorkflowEntry';
-import {
- formatterSQL,
- FormatLanguageSupport
-} from '@actiontech/shared/lib/utils/FormatterSQL';
+import { formatterSQL } from '@actiontech/shared/lib/utils/FormatterSQL';
const SqlMode: React.FC = ({
projectID,
@@ -88,13 +85,9 @@ const SqlMode: React.FC = ({
};
const formattedRollbackSql = useMemo(() => {
- const supportedLan = Object.keys(FormatLanguageSupport);
- if (props.dbType && supportedLan.includes(props.dbType)) {
- return props.rollback_sqls
- ?.map((v) => formatterSQL(v, props.dbType))
- ?.join('\n');
- }
- return props.rollback_sqls?.join('\n');
+ return props.rollback_sqls
+ ?.map((v) => formatterSQL(v, props.dbType))
+ ?.join('\n');
}, [props.rollback_sqls, props.dbType]);
return (
diff --git a/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/SqlMode.test.tsx b/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/SqlMode.test.tsx
index 7a1e3738c..30fbbd307 100644
--- a/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/SqlMode.test.tsx
+++ b/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/SqlMode.test.tsx
@@ -24,8 +24,7 @@ describe('sqle/ExecWorkflow/AuditDetail/SqlMode', () => {
params: Omit<
SqlExecuteResultCardProps,
'projectID' | 'taskId' | 'onUpdateDescription' | 'dbType'
- >,
- dbType = 'MySQL'
+ >
) => {
const someParams: Pick<
SqlExecuteResultCardProps,
@@ -35,7 +34,7 @@ describe('sqle/ExecWorkflow/AuditDetail/SqlMode', () => {
taskId,
onUpdateDescription: onUpdateDescriptionFn
};
- return superRender();
+ return superRender();
};
beforeEach(() => {
@@ -217,23 +216,4 @@ describe('sqle/ExecWorkflow/AuditDetail/SqlMode', () => {
expect(screen.getByText('关联回滚工单')).toBeInTheDocument();
expect(baseElement).toMatchSnapshot();
});
-
- it('render unsupported database type', async () => {
- const { baseElement } = customRender(
- {
- number: 1,
- exec_sql: 'exec_sql cont',
- rollback_sqls: [
- "CREATE TABLE public.example_table (\nid int4 NOT NULL DEFAULT nextval('example_table_id_seq'::regclass),\nname varchar(255) NOT NULL,\nage int4 NOT NULL,\ncreated_at timestamp DEFAULT CURRENT_TIMESTAMP);",
- '\n\nCREATE UNIQUE INDEX example_table_pkey ON public.example_table USING btree (id);'
- ],
- backup_strategy: AuditTaskSQLResV2BackupStrategyEnum.reverse_sql,
- exec_result: 'success'
- },
- ''
- );
- fireEvent.click(screen.getByText('回滚语句'));
- await act(async () => jest.advanceTimersByTime(500));
- expect(baseElement).toMatchSnapshot();
- });
});
diff --git a/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/__snapshots__/SqlMode.test.tsx.snap b/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/__snapshots__/SqlMode.test.tsx.snap
index 75cac6478..ffe36eb54 100644
--- a/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/__snapshots__/SqlMode.test.tsx.snap
+++ b/packages/sqle/src/page/SqlExecWorkflow/Detail/components/AuditExecResultPanel/TaskResultList/Common/ResultCard/__tests__/__snapshots__/SqlMode.test.tsx.snap
@@ -4908,614 +4908,3 @@ exports[`sqle/ExecWorkflow/AuditDetail/SqlMode render snap when data is empty 1`
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 所在行
-
- -
-
-
-
-
-
-
-
-
-
-
-
- 1
-
- exec_sql cont
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1
-
-
- CREATE
-
-
-
- TABLE
-
- public.example_table (
-
-
-
- 2
-
- id int4
-
- NOT
-
-
-
- NULL
-
-
-
- DEFAULT
-
- nextval(
-
- 'example_table_id_seq'
-
- ::regclass),
-
-
-
- 3
-
- name
-
- varchar
-
- (
-
- 255
-
- )
-
- NOT
-
-
-
- NULL
-
- ,
-
-
-
- 4
-
- age int4
-
- NOT
-
-
-
- NULL
-
- ,
-
-
-
- 5
-
- created_at
-
- timestamp
-
-
-
- DEFAULT
-
-
-
- CURRENT_TIMESTAMP
-
- );
-
-
-
- 6
-
-
-
-
- 7
-
-
-
-
- 8
-
-
- CREATE
-
-
-
- UNIQUE
-
- INDEX example_table_pkey
-
- ON
-
- public.example_table
-
- USING
-
- btree (id);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 审核结果
-
-
-
-
-
-
-
-
-
-
-
-
-
-