|
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'; |
5 | 2 | import Button from '../../../Button';
|
6 | 3 | import SvgIcon from '../../../SvgIcon';
|
7 | 4 | import TableActionGroup from '../TableActionGroup';
|
8 | 5 | import SourceTableDetail from './SourceTableDetail';
|
9 | 6 | import SourceTablesTable from './SourceTablesTable';
|
10 | 7 |
|
11 | 8 | export default function SourceTables() {
|
12 |
| - const { |
13 |
| - connection, |
14 |
| - schema, |
15 |
| - table |
16 |
| - }: { |
17 |
| - connection: string; |
18 |
| - schema: string; |
19 |
| - table: string; |
20 |
| - } = useDecodedParams(); |
21 | 9 | const [addSourceTable, setAddSourceTable] = React.useState(false);
|
22 | 10 | const [sourceTableEdit, setSourceTableEdit] = React.useState<{
|
23 | 11 | connection: string;
|
24 | 12 | schema: string;
|
25 | 13 | table: string;
|
26 | 14 | } | 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]); |
40 | 15 |
|
41 | 16 | const onBack = () => {
|
42 | 17 | setAddSourceTable(false);
|
43 | 18 | setSourceTableEdit(null);
|
44 |
| - getTables(); |
45 | 19 | };
|
46 | 20 |
|
47 | 21 | return (
|
@@ -70,12 +44,7 @@ export default function SourceTables() {
|
70 | 44 | <>
|
71 | 45 | <TableActionGroup onUpdate={onBack} isDisabled />
|
72 | 46 | <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} /> |
79 | 48 | <Button
|
80 | 49 | label="Add source table"
|
81 | 50 | color="primary"
|
|
0 commit comments