Skip to content

Commit

Permalink
fix(camel): apply showInflightCounter option from camel preferences
Browse files Browse the repository at this point in the history
Fix #409
  • Loading branch information
tadayosi committed Nov 2, 2023
1 parent 46302c5 commit e3f4c3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type CamelOptions = {
// Route diagram
ignoreIdForLabel: boolean
showInflightCounter: boolean // TODO: Not used yet
showInflightCounter: boolean
maximumLabelWidth: number

// Trace / debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ReactFlow, {
useNodesState,
} from 'reactflow'
import 'reactflow/dist/style.css'
import { camelPreferencesService } from '../camel-preferences-service'
import { CamelContext } from '../context'
import { routesService } from '../routes-service'
import './RouteDiagram.css'
Expand Down Expand Up @@ -119,6 +120,8 @@ const CamelNode: React.FunctionComponent<NodeProps<CamelNodeData>> = ({
const [showFull] = useState(false)
const [annotation, setAnnotation] = useState<Annotation | undefined>(undefined)

const { showInflightCounter } = camelPreferencesService.loadOptions()

useEffect(() => {
if (!annotations || annotations.length === 0) {
setAnnotation(undefined)
Expand Down Expand Up @@ -159,7 +162,7 @@ const CamelNode: React.FunctionComponent<NodeProps<CamelNodeData>> = ({

<div className='annotation'>{annotation?.element}</div>
<div className='icon'>{data.imageUrl}</div>
<div className='inflights'>{data.stats?.exchangesInflight} </div>
<div className='inflights'>{showInflightCounter && data.stats?.exchangesInflight}</div>
<div className='number'>{data.stats?.exchangesCompleted}</div>
<div className='camel-node-label'> {truncate(data.label)}</div>

Expand Down

0 comments on commit e3f4c3f

Please sign in to comment.