Skip to content

Commit 004bf3a

Browse files
committed
feat: Enable navigation to SQL order details from workbench
1 parent c073cbc commit 004bf3a

File tree

11 files changed

+380
-71
lines changed

11 files changed

+380
-71
lines changed

packages/base/src/locale/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ const initReactI18n = () => {
6161
[SupportLanguage.zhCN]: allZhCN,
6262
[SupportLanguage.enUS]: allEnUS
6363
},
64-
// #if [DEV]
65-
debug: true,
66-
// #endif
6764
lng: LocalStorageWrapper.getOrDefault(
6865
StorageKey.Language,
6966
DEFAULT_LANGUAGE

packages/base/src/locale/zh-CN/dmsCloudBeaver.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
operationTime: '操作时间',
2727
service: '数据源',
2828
operationDetail: '操作详情',
29+
relatedWorkflow: '关联工单',
2930
sessionId: '会话ID',
3031
operationIP: '操作IP',
3132
auditResult: '审核结果',

packages/base/src/page/CloudBeaver/List/__snapshots__/index.test.tsx.snap

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
599599
<col />
600600
<col />
601601
<col />
602+
<col />
602603
<col
603604
style="width: 82px;"
604605
/>
@@ -631,6 +632,12 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
631632
>
632633
操作详情
633634
</th>
635+
<th
636+
class="ant-table-cell"
637+
scope="col"
638+
>
639+
关联工单
640+
</th>
634641
<th
635642
class="ant-table-cell ellipsis-column-width"
636643
scope="col"
@@ -783,6 +790,15 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
783790
 
784791
</div>
785792
</td>
793+
<td
794+
style="padding: 0px; border: 0px; height: 0px;"
795+
>
796+
<div
797+
style="height: 0px; overflow: hidden;"
798+
>
799+
 
800+
</div>
801+
</td>
786802
</tr>
787803
<tr
788804
class="ant-table-row ant-table-row-level-0"
@@ -869,6 +885,16 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
869885
</div>
870886
</div>
871887
</td>
888+
<td
889+
class="ant-table-cell"
890+
>
891+
<a
892+
href="/sqle/project/700300/exec-workflow/1993947455816732672"
893+
target="_blank"
894+
>
895+
1993947455816732672
896+
</a>
897+
</td>
872898
<td
873899
class="ant-table-cell ellipsis-column-width"
874900
>
@@ -1175,6 +1201,16 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
11751201
</div>
11761202
</div>
11771203
</td>
1204+
<td
1205+
class="ant-table-cell"
1206+
>
1207+
<a
1208+
href="/sqle/project/700300/exec-workflow/1993947455816732674"
1209+
target="_blank"
1210+
>
1211+
1993947455816732674
1212+
</a>
1213+
</td>
11781214
<td
11791215
class="ant-table-cell ellipsis-column-width"
11801216
>
@@ -1436,6 +1472,16 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
14361472
>
14371473
success
14381474
</td>
1475+
<td
1476+
class="ant-table-cell"
1477+
>
1478+
<a
1479+
href="/sqle/project/700300/exec-workflow/1993947455816732675"
1480+
target="_blank"
1481+
>
1482+
1993947455816732675
1483+
</a>
1484+
</td>
14391485
<td
14401486
class="ant-table-cell ellipsis-column-width"
14411487
>
@@ -1666,6 +1712,11 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
16661712
>
16671713
-
16681714
</td>
1715+
<td
1716+
class="ant-table-cell"
1717+
>
1718+
-
1719+
</td>
16691720
<td
16701721
class="ant-table-cell ellipsis-column-width"
16711722
>
@@ -2308,6 +2359,7 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
23082359
<col />
23092360
<col />
23102361
<col />
2362+
<col />
23112363
<col
23122364
style="width: 82px;"
23132365
/>
@@ -2340,6 +2392,12 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
23402392
>
23412393
操作详情
23422394
</th>
2395+
<th
2396+
class="ant-table-cell"
2397+
scope="col"
2398+
>
2399+
关联工单
2400+
</th>
23432401
<th
23442402
class="ant-table-cell ellipsis-column-width"
23452403
scope="col"
@@ -2492,6 +2550,15 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
24922550
 
24932551
</div>
24942552
</td>
2553+
<td
2554+
style="padding: 0px; border: 0px; height: 0px;"
2555+
>
2556+
<div
2557+
style="height: 0px; overflow: hidden;"
2558+
>
2559+
 
2560+
</div>
2561+
</td>
24952562
</tr>
24962563
<tr
24972564
class="ant-table-row ant-table-row-level-0"
@@ -2578,6 +2645,16 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
25782645
</div>
25792646
</div>
25802647
</td>
2648+
<td
2649+
class="ant-table-cell"
2650+
>
2651+
<a
2652+
href="/sqle/project/700300/exec-workflow/1993947455816732672"
2653+
target="_blank"
2654+
>
2655+
1993947455816732672
2656+
</a>
2657+
</td>
25812658
<td
25822659
class="ant-table-cell ellipsis-column-width"
25832660
>
@@ -2884,6 +2961,16 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
28842961
</div>
28852962
</div>
28862963
</td>
2964+
<td
2965+
class="ant-table-cell"
2966+
>
2967+
<a
2968+
href="/sqle/project/700300/exec-workflow/1993947455816732674"
2969+
target="_blank"
2970+
>
2971+
1993947455816732674
2972+
</a>
2973+
</td>
28872974
<td
28882975
class="ant-table-cell ellipsis-column-width"
28892976
>
@@ -3145,6 +3232,16 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
31453232
>
31463233
success
31473234
</td>
3235+
<td
3236+
class="ant-table-cell"
3237+
>
3238+
<a
3239+
href="/sqle/project/700300/exec-workflow/1993947455816732675"
3240+
target="_blank"
3241+
>
3242+
1993947455816732675
3243+
</a>
3244+
</td>
31483245
<td
31493246
class="ant-table-cell ellipsis-column-width"
31503247
>
@@ -3375,6 +3472,11 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
33753472
>
33763473
-
33773474
</td>
3475+
<td
3476+
class="ant-table-cell"
3477+
>
3478+
-
3479+
</td>
33783480
<td
33793481
class="ant-table-cell ellipsis-column-width"
33803482
>
@@ -4017,6 +4119,7 @@ exports[`test base/CloudBeaver/List render table when request return failed 1`]
40174119
<col />
40184120
<col />
40194121
<col />
4122+
<col />
40204123
<col
40214124
style="width: 82px;"
40224125
/>
@@ -4049,6 +4152,12 @@ exports[`test base/CloudBeaver/List render table when request return failed 1`]
40494152
>
40504153
操作详情
40514154
</th>
4155+
<th
4156+
class="ant-table-cell"
4157+
scope="col"
4158+
>
4159+
关联工单
4160+
</th>
40524161
<th
40534162
class="ant-table-cell ellipsis-column-width"
40544163
scope="col"
@@ -4201,13 +4310,22 @@ exports[`test base/CloudBeaver/List render table when request return failed 1`]
42014310
 
42024311
</div>
42034312
</td>
4313+
<td
4314+
style="padding: 0px; border: 0px; height: 0px;"
4315+
>
4316+
<div
4317+
style="height: 0px; overflow: hidden;"
4318+
>
4319+
 
4320+
</div>
4321+
</td>
42044322
</tr>
42054323
<tr
42064324
class="ant-table-placeholder"
42074325
>
42084326
<td
42094327
class="ant-table-cell"
4210-
colspan="11"
4328+
colspan="12"
42114329
>
42124330
<div
42134331
class="ant-table-expanded-row-fixed"

packages/base/src/page/CloudBeaver/List/column.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@ import {
55
import { IListCBOperationLogsParams } from '@actiontech/shared/lib/api/base/service/CBOperationLogs/index.d';
66
import { ICBOperationLog } from '@actiontech/shared/lib/api/base/service/common';
77
import { t } from '../../../locale';
8-
import { formatTime } from '@actiontech/dms-kit';
8+
import { formatTime, ROUTE_PATHS } from '@actiontech/dms-kit';
99
import ResultIconRender from 'sqle/src/components/AuditResultMessage/ResultIconRender';
1010
import { OperationOperationTypeEnum } from '@actiontech/shared/lib/api/base/service/common.enum';
1111
import { CustomAvatar } from '@actiontech/dms-kit';
12-
import { SQLRenderer, BasicTypographyEllipsis } from '@actiontech/shared';
12+
import {
13+
SQLRenderer,
14+
BasicTypographyEllipsis,
15+
TypedLink
16+
} from '@actiontech/shared';
1317
export type CBOperationListFilterParamType = PageInfoWithoutIndexAndSize<
1418
IListCBOperationLogsParams & {
1519
page_index: number;
1620
},
1721
'project_uid'
1822
>;
1923
export const CBOperationListColumns = (
24+
projectID: string,
2025
onOpenDrawer: (record: ICBOperationLog) => void
2126
): ActiontechTableColumn<ICBOperationLog, CBOperationListFilterParamType> => {
2227
return [
@@ -67,6 +72,27 @@ export const CBOperationListColumns = (
6772
return operation?.operation_detail ?? '-';
6873
}
6974
},
75+
{
76+
dataIndex: 'workflow_id',
77+
title: t('dmsCloudBeaver.operationList.column.relatedWorkflow'),
78+
render: (value: ICBOperationLog['workflow_id']) => {
79+
if (!value) {
80+
return '-';
81+
}
82+
return (
83+
<TypedLink
84+
target="_blank"
85+
to={ROUTE_PATHS.SQLE.SQL_EXEC_WORKFLOW.detail}
86+
params={{
87+
projectID,
88+
workflowId: value
89+
}}
90+
>
91+
{value}
92+
</TypedLink>
93+
);
94+
}
95+
},
7096
{
7197
dataIndex: 'session_id',
7298
title: t('dmsCloudBeaver.operationList.column.sessionId'),

packages/base/src/page/CloudBeaver/List/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ const CBOperationLogsList: React.FC<CBOperationLogsListProps> = ({
179179
dispatch(updateCBSqlOperationRecord({ cbSqlOperationRecord }));
180180
};
181181

182-
return CBOperationListColumns(onOpenDrawer);
183-
}, [dispatch]);
182+
return CBOperationListColumns(projectID, onOpenDrawer);
183+
}, [dispatch, projectID]);
184184

185185
const { filterButtonMeta, filterContainerMeta, updateAllSelectedFilterItem } =
186186
useTableFilterContainer(columns, updateTableFilterInfo);

0 commit comments

Comments
 (0)