Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/dms 829 #205

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
'packages/**/src/App.tsx',
'packages/shared/api/common/**',
'!packages/**/index.type.ts',
'!packages/**/index.enum.ts',
'!packages/sqle/src/page/AuditPlan/**'
],
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
Expand Down
4 changes: 2 additions & 2 deletions packages/base/src/hooks/useDbService/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ describe('useDbService', () => {
result.current.updateDbServiceList({
project_uid: projectID,
functional_module:
ListDBServiceTipsFunctionalModuleEnum.create_audit_plan
ListDBServiceTipsFunctionalModuleEnum.create_export_task
})
);
expect(listDbServicesSpy).toBeCalled();
expect(listDbServicesSpy).toBeCalledWith({
functional_module:
ListDBServiceTipsFunctionalModuleEnum.create_audit_plan,
ListDBServiceTipsFunctionalModuleEnum.create_export_task,
project_uid: projectID
});
expect(result.current.loading).toBeTruthy();
Expand Down
7 changes: 5 additions & 2 deletions packages/base/src/locale/zh-CN/dmsDataExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default {
export_failed: '导出失败',
expired: '已过期',
rejected: '已驳回',
canceled: '已关闭'
canceled: '已关闭',
file_deleted: '已移除'
},
batchCancel: {
messageWarn:
Expand Down Expand Up @@ -49,7 +50,8 @@ export default {
sourceTitle: '工单导出对象',
methodTitle: '导出方式',
updateInfoAction: '编辑工单信息',
submitAction: '提交工单'
submitAction: '提交工单',
submitTips: '仅支持对DQL语句创建导出工单'
},
result: {
success: '工单创建成功',
Expand Down Expand Up @@ -162,6 +164,7 @@ export default {
column: {
number: '序号',
execSql: '执行语句',
sqlType: '语句类型',
auditResult: '审核结果'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export const AuditResultForCreateOrderColumn = (
);
}
},
{
dataIndex: 'export_sql_type',
title: () => t('dmsDataExport.common.auditResult.column.sqlType'),
render: (type: string) => type || '-'
},
{
dataIndex: 'audit_sql_result',
title: () => t('dmsDataExport.common.auditResult.column.auditResult'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { IListDataExportTaskSQL } from '@actiontech/shared/lib/api/base/service/

const AuditResultTable: React.FC<AuditResultTableProps> = ({
taskID,
projectID
projectID,
updateExecuteSQLsTypeIsDQL
}) => {
const [currentAuditResultRecord, setCurrentAuditResultRecord] =
useState<IListDataExportTaskSQL>();
Expand Down Expand Up @@ -44,10 +45,12 @@ const AuditResultTable: React.FC<AuditResultTableProps> = ({
ready: typeof taskID === 'string',
refreshDeps: [pagination, taskID],
onSuccess(res) {
// updateTaskRecordTotalNum?.(taskID ?? '', res.total ?? 0);
updateExecuteSQLsTypeIsDQL?.(
!!res.list?.every((item) => item.export_sql_type === 'dql')
);
},
onError() {
// updateTaskRecordTotalNum?.(taskID ?? '', 0);
updateExecuteSQLsTypeIsDQL?.(true);
}
}
);
Expand All @@ -56,7 +59,7 @@ const AuditResultTable: React.FC<AuditResultTableProps> = ({
<>
<ActiontechTable
errorMessage={requestErrorMessage}
rowKey="number"
rowKey="uid"
columns={AuditResultForCreateOrderColumn(onClickAuditResult)}
loading={loading}
dataSource={data?.list}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IListDataExportTaskSQL } from '@actiontech/shared/lib/api/base/service/
export type AuditResultTableProps = {
taskID?: string;
projectID: string;
updateExecuteSQLsTypeIsDQL?: (val: boolean) => void;
};

export type AuditResultDrawerProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { ResponseCode } from '@actiontech/shared/lib/enum';

const AuditResultList: React.FC<AuditResultListProps> = ({
taskIDs,
projectID
projectID,
updateExecuteSQLsTypeIsDQL
}) => {
const [tasks, setTasks] = useState<IGetDataExportTask[]>([]);

Expand Down Expand Up @@ -56,7 +57,11 @@ const AuditResultList: React.FC<AuditResultListProps> = ({
/>
</SegmentedRowStyleWrapper>

<AuditResultTable taskID={currentTaskID} projectID={projectID} />
<AuditResultTable
taskID={currentTaskID}
projectID={projectID}
updateExecuteSQLsTypeIsDQL={updateExecuteSQLsTypeIsDQL}
/>
</AuditResultStyleWrapper>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type AuditResultListProps = {
taskIDs: string[];
projectID: string;
updateExecuteSQLsTypeIsDQL?: (val: boolean) => void;
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from 'sqle/src/icon/Order';
import { t } from '../../../../locale';
import { StatusStyleWrapper } from '../style';
import { IconDelete } from '@actiontech/shared/lib/Icon/common';

const taskStatusMap = () => {
return new Map<GetDataExportTaskStatusEnum, React.ReactNode>([
Expand Down Expand Up @@ -36,6 +37,13 @@ const taskStatusMap = () => {
<IconOrderStatusIsExecuting />
<span>{t('dmsDataExport.status.wait_for_export')}</span>
</>
],
[
GetDataExportTaskStatusEnum.file_deleted,
<>
<IconDelete />
<span>{t('dmsDataExport.status.file_deleted')}</span>
</>
]
]);
};
Expand Down
Loading