Skip to content

Commit 53c26bb

Browse files
committed
[chore]: modify table row key and remove redundant components
1 parent e5e2317 commit 53c26bb

File tree

6 files changed

+20
-139
lines changed

6 files changed

+20
-139
lines changed

packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.type.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/style.ts

Lines changed: 0 additions & 77 deletions
This file was deleted.

packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,8 +1077,7 @@ exports[`test ScanTypeSqlCollection should match snapshot 2`] = `
10771077
</tr>
10781078
<tr
10791079
class="ant-table-row ant-table-row-level-0"
1080-
data-row-key="/* ApplicationName=DBeaver 24.1.2 - SQLEditor <Console> */ select 1,SLEEP(11)
1081-
LIMIT 0, 200"
1080+
data-row-key="1"
10821081
>
10831082
<td
10841083
class="ant-table-cell ellipsis-column-large-width"
@@ -1266,8 +1265,7 @@ LIMIT
12661265
</tr>
12671266
<tr
12681267
class="ant-table-row ant-table-row-level-0"
1269-
data-row-key="/* ApplicationName=DBeaver 24.1.2 - SQLEditor <Console> */ select 1,1,1,1,1,SLEEP(11)
1270-
LIMIT 0, 200"
1268+
data-row-key="12"
12711269
>
12721270
<td
12731271
class="ant-table-cell ellipsis-column-large-width"
@@ -1479,8 +1477,7 @@ LIMIT
14791477
</tr>
14801478
<tr
14811479
class="ant-table-row ant-table-row-level-0"
1482-
data-row-key="/* ApplicationName=DBeaver 24.1.2 - SQLEditor <Console> */ SELECT SLEEP(11)
1483-
LIMIT 0, 200"
1480+
data-row-key="123"
14841481
>
14851482
<td
14861483
class="ant-table-cell ellipsis-column-large-width"
@@ -1662,7 +1659,7 @@ LIMIT
16621659
</tr>
16631660
<tr
16641661
class="ant-table-row ant-table-row-level-0"
1665-
data-row-key="Prepare"
1662+
data-row-key="1234"
16661663
>
16671664
<td
16681665
class="ant-table-cell ellipsis-column-large-width"
@@ -1823,7 +1820,7 @@ LIMIT
18231820
</tr>
18241821
<tr
18251822
class="ant-table-row ant-table-row-level-0"
1826-
data-row-key="COMMIT"
1823+
data-row-key="12345"
18271824
>
18281825
<td
18291826
class="ant-table-cell ellipsis-column-large-width"
@@ -1979,7 +1976,7 @@ LIMIT
19791976
</tr>
19801977
<tr
19811978
class="ant-table-row ant-table-row-level-0"
1982-
data-row-key="INSERT INTO \`audit_plan_sqls_v2\` (\`audit_plan_id\`,\`fingerprint_md5\`, \`fingerprint\`, \`sql_content\`, \`info\`, \`schema\`) VALUES (3, 'a62860c563df5399c2acb800673ae715', 'CREATE TABLE \`audit_files\` (\\n \`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,\\n \`created_at\` datetime DEFAULT CURRENT_TIMESTAMP,\\n \`updated_at\` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\\n \`deleted_at\` datetime DEFAULT NULL,\\n \`task_id\` int(10) unsigned DEFAULT NULL,\\n \`unique_name\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\\n \`file_host\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\\n \`file_name\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\\n PRIMARY KEY (\`id\`)"
1979+
data-row-key="123456"
19831980
>
19841981
<td
19851982
class="ant-table-cell ellipsis-column-large-width"
@@ -3230,8 +3227,7 @@ exports[`test ScanTypeSqlCollection should open report drawer and set current au
32303227
</tr>
32313228
<tr
32323229
class="ant-table-row ant-table-row-level-0"
3233-
data-row-key="/* ApplicationName=DBeaver 24.1.2 - SQLEditor <Console> */ select 1,SLEEP(11)
3234-
LIMIT 0, 200"
3230+
data-row-key="1"
32353231
>
32363232
<td
32373233
class="ant-table-cell ellipsis-column-large-width"
@@ -3419,8 +3415,7 @@ LIMIT
34193415
</tr>
34203416
<tr
34213417
class="ant-table-row ant-table-row-level-0"
3422-
data-row-key="/* ApplicationName=DBeaver 24.1.2 - SQLEditor <Console> */ select 1,1,1,1,1,SLEEP(11)
3423-
LIMIT 0, 200"
3418+
data-row-key="12"
34243419
>
34253420
<td
34263421
class="ant-table-cell ellipsis-column-large-width"
@@ -3632,8 +3627,7 @@ LIMIT
36323627
</tr>
36333628
<tr
36343629
class="ant-table-row ant-table-row-level-0"
3635-
data-row-key="/* ApplicationName=DBeaver 24.1.2 - SQLEditor <Console> */ SELECT SLEEP(11)
3636-
LIMIT 0, 200"
3630+
data-row-key="123"
36373631
>
36383632
<td
36393633
class="ant-table-cell ellipsis-column-large-width"
@@ -3815,7 +3809,7 @@ LIMIT
38153809
</tr>
38163810
<tr
38173811
class="ant-table-row ant-table-row-level-0"
3818-
data-row-key="Prepare"
3812+
data-row-key="1234"
38193813
>
38203814
<td
38213815
class="ant-table-cell ellipsis-column-large-width"
@@ -3976,7 +3970,7 @@ LIMIT
39763970
</tr>
39773971
<tr
39783972
class="ant-table-row ant-table-row-level-0"
3979-
data-row-key="COMMIT"
3973+
data-row-key="12345"
39803974
>
39813975
<td
39823976
class="ant-table-cell ellipsis-column-large-width"
@@ -4132,7 +4126,7 @@ LIMIT
41324126
</tr>
41334127
<tr
41344128
class="ant-table-row ant-table-row-level-0"
4135-
data-row-key="INSERT INTO \`audit_plan_sqls_v2\` (\`audit_plan_id\`,\`fingerprint_md5\`, \`fingerprint\`, \`sql_content\`, \`info\`, \`schema\`) VALUES (3, 'a62860c563df5399c2acb800673ae715', 'CREATE TABLE \`audit_files\` (\\n \`id\` int(10) unsigned NOT NULL AUTO_INCREMENT,\\n \`created_at\` datetime DEFAULT CURRENT_TIMESTAMP,\\n \`updated_at\` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\\n \`deleted_at\` datetime DEFAULT NULL,\\n \`task_id\` int(10) unsigned DEFAULT NULL,\\n \`unique_name\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\\n \`file_host\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\\n \`file_name\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\\n PRIMARY KEY (\`id\`)"
4129+
data-row-key="123456"
41364130
>
41374131
<td
41384132
class="ant-table-cell ellipsis-column-large-width"
@@ -4531,7 +4525,7 @@ LIMIT
45314525
class="ant-drawer-extra"
45324526
>
45334527
<a
4534-
href="/sqle/project/700300/sql-management-conf/1/analyze/undefined"
4528+
href="/sqle/project/700300/sql-management-conf/1/analyze/1"
45354529
target="blank"
45364530
>
45374531
<button

packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/indx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ const ScanTypeSqlCollection: React.FC<ScanTypeSqlCollectionProps> = ({
281281

282282
{messageContextHolder}
283283
<ActiontechTable
284-
rowKey={(record) => record.sql}
284+
rowKey="id"
285285
setting={tableSetting}
286286
errorMessage={getTableRowError && getErrorMessage(getTableRowError)}
287287
loading={getFilterMetaListLoading || getTableRowLoading}

packages/sqle/src/testUtils/mockApi/instanceAuditPlan/data.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ export const mockAuditPlanSQLMeta: IAuditPlanSQLMetaResV1 = {
723723
export const mockAuditPlanSQLData: IAuditPlanSQLDataResV1 = {
724724
rows: [
725725
{
726+
id: '1',
726727
audit_results: 'null',
727728
counter: '598',
728729
db_user: '',
@@ -735,6 +736,7 @@ export const mockAuditPlanSQLData: IAuditPlanSQLDataResV1 = {
735736
sql: '/* ApplicationName=DBeaver 24.1.2 - SQLEditor \u003cConsole\u003e */ select 1,SLEEP(11)\nLIMIT 0, 200'
736737
},
737738
{
739+
id: '12',
738740
audit_results: 'null',
739741
counter: '299',
740742
db_user: '',
@@ -747,6 +749,7 @@ export const mockAuditPlanSQLData: IAuditPlanSQLDataResV1 = {
747749
sql: '/* ApplicationName=DBeaver 24.1.2 - SQLEditor \u003cConsole\u003e */ select 1,1,1,1,1,SLEEP(11)\nLIMIT 0, 200'
748750
},
749751
{
752+
id: '123',
750753
audit_results: 'null',
751754
counter: '299',
752755
db_user: '',
@@ -759,6 +762,7 @@ export const mockAuditPlanSQLData: IAuditPlanSQLDataResV1 = {
759762
sql: '/* ApplicationName=DBeaver 24.1.2 - SQLEditor \u003cConsole\u003e */ SELECT SLEEP(11) \nLIMIT 0, 200'
760763
},
761764
{
765+
id: '1234',
762766
audit_results:
763767
'[{"level": "warn", "message": "语法错误或者解析器不支持,请人工确认SQL正确性", "rule_name": ""}]',
764768
counter: '2388',
@@ -772,6 +776,7 @@ export const mockAuditPlanSQLData: IAuditPlanSQLDataResV1 = {
772776
sql: 'Prepare'
773777
},
774778
{
779+
id: '12345',
775780
audit_results: 'null',
776781
counter: '8559',
777782
db_user: '',
@@ -784,6 +789,7 @@ export const mockAuditPlanSQLData: IAuditPlanSQLDataResV1 = {
784789
sql: 'COMMIT'
785790
},
786791
{
792+
id: '123456',
787793
audit_results: 'null',
788794
counter: '299',
789795
db_user: '',

0 commit comments

Comments
 (0)