Skip to content

Commit b6334dc

Browse files
feat(NavigationTree): support external table and data source
1 parent 3b240c4 commit b6334dc

File tree

5 files changed

+48
-4
lines changed

5 files changed

+48
-4
lines changed

src/components/NavigationTree/NavigationTreeNode.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {TableIcon} from '../icons/Table';
1010
import {TopicIcon} from '../icons/Topic';
1111
import {IndexIcon} from '../icons/Index';
1212
import {ColumnTableIcon} from '../icons/ColumnTable';
13+
import {ExternalTableIcon} from '../icons/ExternalTable';
14+
import {ExternalDataSourceIcon} from '../icons/ExternalDataSource';
1315
import {TreeView} from '../TreeView/TreeView';
1416

1517
export interface NavigationTreeNodeProps {
@@ -41,6 +43,10 @@ function renderIcon(type: NavigationTreeNodeType | string, collapsed: boolean) {
4143
return <ColumnTableIcon height={16} />;
4244
case 'topic':
4345
return <TopicIcon height={16} />;
46+
case 'external_table':
47+
return <ExternalTableIcon height={16} />;
48+
case 'external_data_source':
49+
return <ExternalDataSourceIcon height={16} />;
4450
default:
4551
return null;
4652
}

src/components/NavigationTree/__stories__/NavigationTree.stories.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,25 @@ async function fetchPath(path: string) {
7575
expandable: true,
7676
},
7777
{
78-
name: 'table_2',
78+
name: 'column_table',
7979
type: 'column_table',
8080
},
8181
{
82-
name: 'table_3',
82+
name: 'topic',
8383
type: 'topic',
8484
},
8585
{
86-
name: 'table_4',
86+
name: 'table',
8787
type: 'table',
8888
},
89+
{
90+
name: 'external_table',
91+
type: 'external_table',
92+
},
93+
{
94+
name: 'external_data_source',
95+
type: 'external_data_source',
96+
},
8997
];
9098
}
9199

src/components/NavigationTree/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export type NavigationTreeNodeType =
77
| 'column_table'
88
| 'index_table'
99
| 'index'
10-
| 'topic';
10+
| 'topic'
11+
| 'external_table'
12+
| 'external_data_source';
1113

1214
export interface NavigationTreeDataItem {
1315
name: string;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
3+
export function ExternalDataSourceIcon(props: React.SVGProps<SVGSVGElement>) {
4+
return (
5+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
6+
<path
7+
fill-rule="evenodd"
8+
clip-rule="evenodd"
9+
d="M4.46505 1.8125C4.46505 1.38086 4.07442 1 3.63171 1C3.16296 1 2.79838 1.38086 2.79838 1.8125L2.79838 5.0625H1.96505C1.4963 5.0625 1.13171 5.44336 1.13171 5.875C1.13171 6.33203 1.4963 6.6875 1.96505 6.6875V7.5C1.96505 9.48047 3.3713 11.1055 5.29838 11.4863V14H6.96505V11.4863C7.32953 11.4133 7.67677 11.2946 8 11.1363V9.65435C8 9.23408 8.24042 8.91969 8.48107 8.71626C8.72487 8.51017 9.04002 8.35302 9.37409 8.23341C9.64121 8.13778 9.94227 8.05845 10.2678 7.99753C10.288 7.83463 10.2984 7.6686 10.2984 7.5V6.6875C10.7411 6.6875 11.1317 6.33203 11.1317 5.875C11.1317 5.44336 10.7411 5.0625 10.2984 5.0625H9.46505L9.46505 1.8125C9.46505 1.38086 9.07442 1 8.63171 1C8.16296 1 7.79838 1.38086 7.79838 1.8125L7.79838 5.0625H4.46505L4.46505 1.8125Z"
10+
/>
11+
<path d="M15 9.66406V10.3672C15 11.0264 13.5346 11.5391 11.75 11.5391C9.95089 11.5391 8.5 11.0264 8.5 10.3672V9.66406C8.5 9.01953 9.95089 8.49219 11.75 8.49219C13.5346 8.49219 15 9.01953 15 9.66406ZM14.202 11.6416C14.4922 11.5391 14.7824 11.3926 15 11.2314V12.7109C15 13.3701 13.5346 13.8828 11.75 13.8828C9.95089 13.8828 8.5 13.3701 8.5 12.7109V11.2314C8.70312 11.3926 8.9933 11.5391 9.28348 11.6416C9.93638 11.876 10.8069 12.0078 11.75 12.0078C12.6786 12.0078 13.5491 11.876 14.202 11.6416ZM9.28348 13.9854C9.93638 14.2197 10.8069 14.3516 11.75 14.3516C12.6786 14.3516 13.5491 14.2197 14.202 13.9854C14.4922 13.8828 14.7824 13.7363 15 13.5752V14.8203C15 15.4795 13.5346 15.9922 11.75 15.9922C9.95089 15.9922 8.5 15.4795 8.5 14.8203V13.5752C8.70312 13.7363 8.9933 13.8828 9.28348 13.9854Z" />
12+
</svg>
13+
);
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
3+
export function ExternalTableIcon(props: React.SVGProps<SVGSVGElement>) {
4+
return (
5+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
6+
<path
7+
fill-rule="evenodd"
8+
clip-rule="evenodd"
9+
d="M4.46505 1.8125C4.46505 1.38086 4.07442 1 3.63171 1C3.16296 1 2.79838 1.38086 2.79838 1.8125L2.79838 5.0625H1.96505C1.4963 5.0625 1.13171 5.44336 1.13171 5.875C1.13171 6.33203 1.4963 6.6875 1.96505 6.6875V7.5C1.96505 9.48047 3.3713 11.1055 5.29838 11.4863V14H7V11.4863V10.5C7 9.68257 7.66409 9 8.51786 9H10.0139C10.1978 8.53702 10.2984 8.0313 10.2984 7.5V6.6875C10.7411 6.6875 11.1317 6.33203 11.1317 5.875C11.1317 5.44336 10.7411 5.0625 10.2984 5.0625H9.46505L9.46505 1.8125C9.46505 1.38086 9.07442 1 8.63171 1C8.16296 1 7.79838 1.38086 7.79838 1.8125L7.79838 5.0625H4.46505L4.46505 1.8125Z"
10+
/>
11+
<path d="M13.9821 9.65002C14.4802 9.65002 14.8929 10.0578 14.8929 10.55V15.05C14.8929 15.5563 14.4802 15.95 13.9821 15.95H8.51786C8.00558 15.95 7.60715 15.5563 7.60715 15.05V10.55C7.60715 10.0578 8.00558 9.65002 8.51786 9.65002H13.9821ZM10.7946 12.8V11.45H8.51786V12.8H10.7946ZM8.51786 13.7V15.05H10.7946V13.7H8.51786ZM11.7054 15.05H13.9821V13.7H11.7054V15.05ZM13.9821 12.8V11.45H11.7054V12.8H13.9821Z" />
12+
</svg>
13+
);
14+
}

0 commit comments

Comments
 (0)