Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/NavigationTree/NavigationTreeNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import {FolderIcon} from '../icons/Folder';
import {FolderOpenIcon} from '../icons/FolderOpen';
import {IndexIcon} from '../icons/Index';
import {ResourcePoolIcon} from '../icons/ResourcePool';
import {TableIcon} from '../icons/Table';
import {TopicIcon} from '../icons/Topic';
import {ViewIcon} from '../icons/View';
Expand All @@ -32,7 +33,7 @@
cache?: boolean;
}

function renderIcon(type: NavigationTreeNodeType | string, collapsed: boolean) {
function renderIcon(type: NavigationTreeNodeType, collapsed: boolean) {
switch (type) {
case 'async_replication':
return <AsyncReplicationIcon height={16} />;
Expand All @@ -57,6 +58,8 @@
return <ExternalDataSourceIcon height={16} />;
case 'view':
return <ViewIcon height={16} />;
case 'resource_pool':
return <ResourcePoolIcon height={16} />;
default:
return null;
}
Expand Down Expand Up @@ -112,7 +115,7 @@
payload: {path, error},
});
});
}, [nodeState.collapsed]);

Check warning on line 118 in src/components/NavigationTree/NavigationTreeNode.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

React Hook React.useEffect has missing dependencies: 'activePath', 'cache', 'dispatch', 'fetchPath', 'nodeState.loaded', 'nodeState.loading', and 'path'. Either include them or remove the dependency array. If 'dispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback

const handleClick = React.useCallback(() => {
if (onActivate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ async function fetchPath(path: string) {
name: 'view',
type: 'view',
},
{
name: 'resource_pool',
type: 'resource_pool',
},
];
}

Expand Down
1 change: 1 addition & 0 deletions src/components/NavigationTree/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export type NavigationTreeNodeType =
| 'async_replication'
| 'column_table'
| 'resource_pool'
| 'database'
| 'directory'
| 'external_data_source'
Expand Down Expand Up @@ -50,7 +51,7 @@
'loading' | 'loaded' | 'error' | 'children'
>;

export interface NavigationTreeProps<D = any> {

Check warning on line 54 in src/components/NavigationTree/types.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected any. Specify a different type
rootState: NavigationTreeNodePartialState;
fetchPath: (path: string) => Promise<NavigationTreeDataItem[]>;
onActionsOpenToggle?: (args: {
Expand Down
14 changes: 14 additions & 0 deletions src/components/icons/ResourcePool.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

export function ResourcePoolIcon(props: React.SVGProps<SVGSVGElement>) {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
<path
d="m1.5 3.25c0-0.41421 0.33579-0.75 0.75-0.75h1.0109c0.41421 0 0.75-0.33579 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-1.2426 0-2.25 1.0074-2.25 2.25v9.5c0 1.2426 1.0074 2.25 2.25 2.25h1.0109c0.41421 0 0.75-0.3358 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-0.41421 0-0.75-0.3358-0.75-0.75v-9.5zm11.239-2.25c-0.4142 0-0.75 0.33579-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c0.4142 0 0.75 0.33579 0.75 0.75v9.5c0 0.4142-0.3358 0.75-0.75 0.75h-1.0109c-0.4142 0-0.75 0.3358-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c1.2426 0 2.25-1.0074 2.25-2.25v-9.5c0-1.2426-1.0074-2.25-2.25-2.25h-1.0109zm-1.4316 6.9054c-0.9374 0.45226-2.1226 0.63619-3.3102 0.63619-1.1876 0-2.3728-0.18393-3.3103-0.63619-0.21174-0.10215-0.42044-0.22399-0.61701-0.36633v0.46091c0 1.3714 1.7583 2.0571 3.9273 2.0571 2.169 0 3.9273-0.68571 3.9273-2.0571v-0.46091c-0.1966 0.14234-0.4053 0.26418-0.6171 0.36633zm-3.3102-0.59108c2.169 0 3.9273-0.68572 3.9273-2.0571 0-1.3714-1.7583-2.0572-3.9273-2.0572-2.169 0-3.9273 0.68572-3.9273 2.0572 0 1.3714 1.7583 2.0571 3.9273 2.0571zm3.9273 3.4286c0 1.3714-1.7583 2.0571-3.9273 2.0571-2.169 0-3.9273-0.6857-3.9273-2.0571v-0.461c0.19657 0.1423 0.40527 0.2641 0.61701 0.3663 0.93748 0.4522 2.1227 0.6362 3.3103 0.6362 1.1876 0 2.3728-0.184 3.3102-0.6362 0.2118-0.1022 0.4205-0.224 0.6171-0.3663v0.461z"
fill="currentColor"
clipRule="evenodd"
fillRule="evenodd"
/>
</svg>
);
}
Loading