Skip to content

Commit

Permalink
feat: add resource pool icon (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
astandrik authored Feb 25, 2025
1 parent 81c5344 commit e7ed4ae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
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 {ExternalTableIcon} from '../icons/ExternalTable';
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 @@ export interface NavigationTreeNodeProps {
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 @@ function renderIcon(type: NavigationTreeNodeType | string, collapsed: boolean) {
return <ExternalDataSourceIcon height={16} />;
case 'view':
return <ViewIcon height={16} />;
case 'resource_pool':
return <ResourcePoolIcon height={16} />;
default:
return null;
}
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 @@ import type {DropdownMenuItemMixed} from '@gravity-ui/uikit';
export type NavigationTreeNodeType =
| 'async_replication'
| 'column_table'
| 'resource_pool'
| 'database'
| 'directory'
| 'external_data_source'
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>
);
}

0 comments on commit e7ed4ae

Please sign in to comment.