From a94fbc0d504819f368c0d31ba1b7eb61b24d292b Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Tue, 11 Jun 2024 14:43:20 -0400 Subject: [PATCH] fix(matchexpr): fix bug in evaluator List view (#1278) (cherry picked from commit 875e7acdbfb5003aae9592afe47742ea1cfeb46c) --- .../Components/MatchExpression/MatchExpressionVisualizer.tsx | 2 +- src/app/Shared/Services/api.types.ts | 1 + src/app/Topology/Shared/utils.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/Shared/Components/MatchExpression/MatchExpressionVisualizer.tsx b/src/app/Shared/Components/MatchExpression/MatchExpressionVisualizer.tsx index 4b8945801..f22a6c3a3 100644 --- a/src/app/Shared/Components/MatchExpression/MatchExpressionVisualizer.tsx +++ b/src/app/Shared/Components/MatchExpression/MatchExpressionVisualizer.tsx @@ -388,7 +388,7 @@ const ListView: React.FC<{ alertOptions?: AlertOptions }> = ({ alertOptions, ... isHidden={!expanded.includes(connectUrl)} > target }} + entity={{ getData: () => ({ target }) }} columnModifier={{ default: '3Col' }} alertOptions={alertOptions} className="topology__list-view__entity-details" diff --git a/src/app/Shared/Services/api.types.ts b/src/app/Shared/Services/api.types.ts index 97be1f5b7..021b84eef 100644 --- a/src/app/Shared/Services/api.types.ts +++ b/src/app/Shared/Services/api.types.ts @@ -500,6 +500,7 @@ export enum NodeType { ENDPOINT = 'Endpoint', // Standalone targets TARGET = 'Target', + NODE = 'Node', // Default/fallback for unknown } interface _AbstractNode { diff --git a/src/app/Topology/Shared/utils.tsx b/src/app/Topology/Shared/utils.tsx index c95befeac..97b25887e 100644 --- a/src/app/Topology/Shared/utils.tsx +++ b/src/app/Topology/Shared/utils.tsx @@ -38,7 +38,7 @@ export const DiscoveryTreeContext = React.createContext(DEFAULT_EMPTY_UNIVERSE); export const COLLAPSE_EXEMPTS = [NodeType.NAMESPACE, NodeType.REALM, NodeType.UNIVERSE]; -export const nodeTypeToAbbr = (type: NodeType): string => { +export const nodeTypeToAbbr = (type: NodeType = NodeType.NODE): string => { // Keep uppercases (or uppercase whole word if none) and retain first 4 charaters. return (type.replace(/[^A-Z]/g, '') || type.toUpperCase()).slice(0, 4); };