Skip to content

Commit

Permalink
feat(27875): add node name to the toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Dec 13, 2024
1 parent de5b220 commit 7d1538f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const NodeAdapter: FC<NodeProps<Adapter>> = ({ id, data: adapter, selected, drag

return (
<>
<ContextualToolbar id={id} dragging={dragging} onOpenPanel={onContextMenu}>
<ContextualToolbar id={id} title={adapter.id} dragging={dragging} onOpenPanel={onContextMenu}>
<ToolbarButtonGroup>
<IconButton
icon={<Icon as={deviceCapabilityIcon['READ']} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NodeBridge: FC<NodeProps<Bridge>> = ({ id, selected, data: bridge, draggin

return (
<>
<ContextualToolbar id={id} dragging={dragging} onOpenPanel={onContextMenu} />
<ContextualToolbar id={id} title={bridge.id} dragging={dragging} onOpenPanel={onContextMenu} />
<NodeWrapper
isSelected={selected}
onDoubleClick={onContextMenu}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const NodeDevice: FC<NodeProps<DeviceMetadata>> = ({ id, selected, data, draggin

return (
<>
<ContextualToolbar id={id} onOpenPanel={onContextMenu} dragging={dragging} hasNoOverview>
<ContextualToolbar id={id} title={data.protocol} onOpenPanel={onContextMenu} dragging={dragging} hasNoOverview>
<ToolbarButtonGroup>
<IconButton
icon={<PLCTagIcon />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { FC } from 'react'
import { useNavigate } from 'react-router-dom'
import { Handle, Position, NodeProps } from 'reactflow'
import { useTranslation } from 'react-i18next'
import { Icon, Image } from '@chakra-ui/react'
import { LuInspect } from 'react-icons/lu'

Check failure on line 6 in hivemq-edge/src/frontend/src/modules/Workspace/components/nodes/NodeEdge.tsx

View workflow job for this annotation

GitHub Actions / lint

'LuInspect' is defined but never used

import logo from '@/assets/edge/05-icon-industrial-hivemq-edge.svg'
import ToolbarButtonGroup from '@/components/react-flow/ToolbarButtonGroup.tsx'
Expand All @@ -10,7 +12,6 @@ import { TopicIcon } from '@/components/Icons/TopicIcon.tsx'
import NodeWrapper from '@/modules/Workspace/components/parts/NodeWrapper.tsx'
import { useContextMenu } from '@/modules/Workspace/hooks/useContextMenu.ts'
import ContextualToolbar from '@/modules/Workspace/components/nodes/ContextualToolbar.tsx'
import { useNavigate } from 'react-router-dom'

const NodeEdge: FC<NodeProps> = (props) => {
const { t } = useTranslation()
Expand All @@ -19,7 +20,12 @@ const NodeEdge: FC<NodeProps> = (props) => {

return (
<>
<ContextualToolbar id={props.id} dragging={props.dragging} onOpenPanel={onContextMenu}>
<ContextualToolbar
id={props.id}
title={t('branding.appName')}
dragging={props.dragging}
onOpenPanel={onContextMenu}
>
<ToolbarButtonGroup>
<IconButton
icon={<Icon as={TopicIcon} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const NodeGroup: FC<NodeProps<Group>> = ({ id, data, selected, ...props }) => {

return (
<>
<ContextualToolbar id={id} dragging={props.dragging} onOpenPanel={onContextMenu}>
<ContextualToolbar id={id} title={data.title} dragging={props.dragging} onOpenPanel={onContextMenu}>
<ToolbarButtonGroup isAttached={false}>
<IconButton
data-testid="node-group-toolbar-expand"
Expand Down

0 comments on commit 7d1538f

Please sign in to comment.