= (props) => {
icon={
visibleFlows[flow.id] ? (
-
+
) : (
-
+
)
}
@@ -104,6 +134,7 @@ export const FlowsList: FunctionComponent = (props) => {
}
variant="plain"
diff --git a/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.scss b/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.scss
index 60652333f..1d01fc0e9 100644
--- a/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.scss
+++ b/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.scss
@@ -1,14 +1,11 @@
-.flows-menu-display {
- display: inline-grid;
- max-width: 300px;
- margin: 0 8px;
- text-align: left;
-}
-
-.flows-menu-truncate {
- min-width: 0;
-}
-
.flows-menu {
+ overflow: hidden;
+ text-overflow: ellipsis;
white-space: nowrap;
+ max-width: 300px;
+
+ .flows-menu-display {
+ margin: 0 8px;
+ text-align: left;
+ }
}
diff --git a/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.test.tsx b/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.test.tsx
index 96ca19d1d..99a89c615 100644
--- a/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.test.tsx
+++ b/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.test.tsx
@@ -1,7 +1,7 @@
import { act, fireEvent, render, waitFor } from '@testing-library/react';
import { CamelResource, CamelRouteResource } from '../../../../models/camel';
import { EntityType } from '../../../../models/camel/entities';
-import { VisibleFLowsContextResult } from '../../../../providers/visible-flows.provider';
+import { VisibleFlowsContextResult } from '../../../../providers/visible-flows.provider';
import { TestProvidersWrapper } from '../../../../stubs';
import { FlowsMenu } from './FlowsMenu';
@@ -92,7 +92,7 @@ describe('FlowsMenu.tsx', () => {
const { Provider } = TestProvidersWrapper({
camelResource: singleFlowCamelResource,
- visibleFlowsContext: { visibleFlows: { ['route-1234']: true } } as unknown as VisibleFLowsContextResult,
+ visibleFlowsContext: { visibleFlows: { ['route-1234']: true } } as unknown as VisibleFlowsContextResult,
});
const wrapper = render(
@@ -110,7 +110,7 @@ describe('FlowsMenu.tsx', () => {
camelResource,
visibleFlowsContext: {
visibleFlows: { ['route-1234']: true, ['routeConfiguration-1234']: true },
- } as unknown as VisibleFLowsContextResult,
+ } as unknown as VisibleFlowsContextResult,
});
const wrapper = render(
@@ -127,7 +127,7 @@ describe('FlowsMenu.tsx', () => {
camelResource,
visibleFlowsContext: {
visibleFlows: { ['route-1234']: true, ['routeConfiguration-1234']: true },
- } as unknown as VisibleFLowsContextResult,
+ } as unknown as VisibleFlowsContextResult,
});
const wrapper = render(
@@ -144,7 +144,7 @@ describe('FlowsMenu.tsx', () => {
camelResource,
visibleFlowsContext: {
visibleFlows: { ['route-1234']: true, ['routeConfiguration-1234']: true },
- } as unknown as VisibleFLowsContextResult,
+ } as unknown as VisibleFlowsContextResult,
});
const wrapper = render(
diff --git a/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.tsx b/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.tsx
index 63f2d1eda..32f731ac3 100644
--- a/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.tsx
+++ b/packages/ui/src/components/Visualization/ContextToolbar/Flows/FlowsMenu.tsx
@@ -1,7 +1,6 @@
import { Badge, Icon, MenuToggle, MenuToggleAction, MenuToggleElement, Select } from '@patternfly/react-core';
import { ListIcon } from '@patternfly/react-icons';
import { FunctionComponent, Ref, useCallback, useContext, useState } from 'react';
-import { Truncate } from '@patternfly/react-core';
import { getVisibleFlowsInformation } from '../../../../models/visualization/flows/support/flows-visibility';
import { VisibleFlowsContext } from '../../../../providers/visible-flows.provider';
@@ -15,6 +14,8 @@ export const FlowsMenu: FunctionComponent = () => {
return getVisibleFlowsInformation(visibleFlows);
}, [visibleFlows]);
+ const { singleFlowId, visibleFlowsCount, totalFlowsCount } = visibleFlowsInformation();
+
/** Toggle the DSL dropdown */
const onToggleClick = () => {
setIsOpen(!isOpen);
@@ -40,15 +41,19 @@ export const FlowsMenu: FunctionComponent = () => {
-
-
+
+ {`${singleFlowId ?? 'Routes'}`}
-
- {visibleFlowsInformation().visibleFlowsCount}/{visibleFlowsInformation().totalFlowsCount}
+
+ {visibleFlowsCount}/{totalFlowsCount}
,
@@ -58,14 +63,7 @@ export const FlowsMenu: FunctionComponent = () => {
);
return (
- | |