Skip to content

Commit e219b84

Browse files
committed
2 parents 608d604 + 0a68d61 commit e219b84

File tree

2 files changed

+209
-187
lines changed

2 files changed

+209
-187
lines changed

dqops/src/main/frontend/src/components/Connection/TableView/SourceTables/SourceTables.tsx

+2-33
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,21 @@
1-
import React, { useEffect, useState } from 'react';
2-
import { TableLineageSourceListModel } from '../../../../api';
3-
import { DataLineageApiClient } from '../../../../services/apiClient';
4-
import { useDecodedParams } from '../../../../utils';
1+
import React from 'react';
52
import Button from '../../../Button';
63
import SvgIcon from '../../../SvgIcon';
74
import TableActionGroup from '../TableActionGroup';
85
import SourceTableDetail from './SourceTableDetail';
96
import SourceTablesTable from './SourceTablesTable';
107

118
export default function SourceTables() {
12-
const {
13-
connection,
14-
schema,
15-
table
16-
}: {
17-
connection: string;
18-
schema: string;
19-
table: string;
20-
} = useDecodedParams();
219
const [addSourceTable, setAddSourceTable] = React.useState(false);
2210
const [sourceTableEdit, setSourceTableEdit] = React.useState<{
2311
connection: string;
2412
schema: string;
2513
table: string;
2614
} | null>(null);
27-
const [tables, setTables] = useState<TableLineageSourceListModel[]>([]);
28-
const [loading, setLoading] = useState(false);
29-
const getTables = async () => {
30-
setLoading(true);
31-
DataLineageApiClient.getTableSourceTables(connection, schema, table)
32-
.then((res) => {
33-
setTables(res.data);
34-
})
35-
.finally(() => setLoading(false));
36-
};
37-
useEffect(() => {
38-
getTables();
39-
}, [connection, schema, table]);
4015

4116
const onBack = () => {
4217
setAddSourceTable(false);
4318
setSourceTableEdit(null);
44-
getTables();
4519
};
4620

4721
return (
@@ -70,12 +44,7 @@ export default function SourceTables() {
7044
<>
7145
<TableActionGroup onUpdate={onBack} isDisabled />
7246
<div className="flex mb-4 text-sm"></div>
73-
<SourceTablesTable
74-
tables={tables}
75-
loading={loading}
76-
onChange={setTables}
77-
setSourceTableEdit={setSourceTableEdit}
78-
/>
47+
<SourceTablesTable setSourceTableEdit={setSourceTableEdit} />
7948
<Button
8049
label="Add source table"
8150
color="primary"

0 commit comments

Comments
 (0)