Skip to content

Commit 24c3d16

Browse files
committed
More icon usage in connect visualize panel
1 parent 0e8f87a commit 24c3d16

3 files changed

Lines changed: 24 additions & 11 deletions

File tree

frontend/src/assets/connectors/component-logo-map.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { RedpandaUILetterIcon } from 'components/redpanda-ui/components/icons';
1818
import {
1919
Activity,
2020
Archive,
21+
Ban,
2122
BarChart3,
2223
CircleSlash,
2324
Command,
@@ -34,12 +35,14 @@ import {
3435
FolderOpen,
3536
GitBranch,
3637
Globe,
38+
Layers,
3739
Network,
3840
Package,
3941
RefreshCw,
4042
ScrollText,
4143
Server,
4244
Settings,
45+
Share2,
4346
Terminal,
4447
Type,
4548
Workflow,
@@ -135,7 +138,7 @@ export const componentLogoMap = {
135138
bloblang: RedpandaLetterLogo,
136139
bounds_check: undefined,
137140
branch: undefined,
138-
broker: undefined,
141+
broker: Share2,
139142
cache: Database,
140143
cached: Database,
141144
cassandra: CassandraLogo,
@@ -155,8 +158,8 @@ export const componentLogoMap = {
155158
decompress: FolderOpen,
156159
dedupe: undefined,
157160
discord: DiscordLogo,
158-
drop: undefined,
159-
drop_on: undefined,
161+
drop: Ban,
162+
drop_on: Ban,
160163
dynamic: undefined,
161164
elasticsearch_v8: ElasticsearchLogo,
162165
fallback: undefined,
@@ -177,8 +180,8 @@ export const componentLogoMap = {
177180
google_drive_list_labels: GoogleDriveLogo,
178181
google_drive_search: GoogleDriveLogo,
179182
grok: ElasticsearchLogo,
180-
group_by: undefined,
181-
group_by_value: undefined,
183+
group_by: Layers,
184+
group_by_value: Layers,
182185
hdfs: HadoopLogo,
183186
http: Globe,
184187
http_client: Globe,
@@ -322,6 +325,7 @@ export const componentLogoMap = {
322325
tcp_server: Server,
323326
text: Type,
324327
timeplus: Database,
328+
tracer: OpenTelemetryLogo,
325329
try: undefined,
326330
unarchive: FolderOpen,
327331
websocket: WebSocketLogo,

frontend/src/components/pages/rp-connect/onboarding/connector-logo.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import { type ComponentName, componentLogoMap } from 'assets/connectors/component-logo-map';
22
import { cn } from 'components/redpanda-ui/lib/utils';
33

4+
type LogoComponent = React.ComponentType<React.SVGProps<SVGSVGElement>>;
5+
46
export const ConnectorLogo = ({
57
name,
68
className,
79
style,
10+
fallback,
811
}: {
912
name: ComponentName;
1013
className?: string;
1114
style?: React.CSSProperties;
15+
/** Icon to render when `name` has no mapping in `componentLogoMap`. */
16+
fallback?: LogoComponent;
1217
}) => {
13-
const Component = componentLogoMap[name];
18+
const Component = (componentLogoMap[name] as LogoComponent | undefined) ?? fallback;
1419
if (!Component) {
1520
return null;
1621
}

frontend/src/components/pages/rp-connect/pipeline/pipeline-flow-nodes.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
import { BaseEdge, type EdgeProps, Handle, Position } from '@xyflow/react';
13-
import { type ComponentName, componentLogoMap } from 'assets/connectors/component-logo-map';
13+
import type { ComponentName } from 'assets/connectors/component-logo-map';
1414
import { Badge } from 'components/redpanda-ui/components/badge';
1515
import { BadgeGroup } from 'components/redpanda-ui/components/badge-group';
1616
import { Banner, BannerClose, BannerContent } from 'components/redpanda-ui/components/banner';
@@ -20,7 +20,7 @@ import { Skeleton } from 'components/redpanda-ui/components/skeleton';
2020
import { Text } from 'components/redpanda-ui/components/typography';
2121
import { cn } from 'components/redpanda-ui/lib/utils';
2222
import { BaseNode } from 'components/ui/base-node';
23-
import { BookOpenIcon, ChevronDown, ChevronUp, PlusIcon } from 'lucide-react';
23+
import { BookOpenIcon, Box, ChevronDown, ChevronUp, PlusIcon } from 'lucide-react';
2424

2525
import { ConnectorLogo } from '../onboarding/connector-logo';
2626

@@ -106,12 +106,16 @@ const TreeSectionNode = ({ data }: { data: TreeNodeData }) => (
106106

107107
const TreeGroupNode = ({ data }: { data: TreeNodeData }) => (
108108
<button
109-
className={cn('nodrag nopan flex h-7 max-w-[220px] items-center text-sm', data.collapsible && 'cursor-pointer')}
109+
className={cn(
110+
'nodrag nopan flex h-7 max-w-[220px] items-center gap-1.5 text-sm',
111+
data.collapsible && 'cursor-pointer'
112+
)}
110113
disabled={!data.collapsible}
111114
onClick={data.collapsible ? data.onToggle : undefined}
112115
type="button"
113116
>
114117
<Handle className={invisibleHandle} position={Position.Left} type="target" />
118+
<ConnectorLogo className="size-4" fallback={Box} name={data.label as ComponentName} />
115119
<Text as="span" className="min-w-0 truncate" title={data.label} variant="bodyStrongMedium">
116120
{data.label}
117121
</Text>
@@ -173,8 +177,8 @@ const TreeLeafNode = ({ data }: { data: TreeNodeData }) => {
173177
>
174178
<Handle className={invisibleHandle} position={Position.Left} type="target" />
175179
<div className="flex items-center gap-1.5">
176-
{!isPlaceholder && componentLogoMap[data.label as ComponentName] ? (
177-
<ConnectorLogo className="size-4 shrink-0" name={data.label as ComponentName} />
180+
{!isPlaceholder ? (
181+
<ConnectorLogo className="size-4" fallback={Box} name={data.label as ComponentName} />
178182
) : null}
179183
<Text
180184
as="span"

0 commit comments

Comments
 (0)