diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx index b2abed890ee35..a66f77909072d 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx @@ -54,11 +54,15 @@ function getContentsComponent( return ResourceContents; } - if (isTraceExplorerEnabled && selectedElementData.source && selectedElementData.target) { + if (isTraceExplorerEnabled && selectedElementData.sourceData && selectedElementData.targetData) { return EdgeContents; } - return DependencyContents; + if (selectedElementData.label) { + return DependencyContents; + } + + return null; } export interface ContentsProps { @@ -100,7 +104,6 @@ export function Popover({ focusedServiceName, environment, kuery, start, end }: const x = box ? box.x1 + box.w / 2 : -10000; const y = box ? box.y1 + box.h / 2 : -10000; - const isOpen = !!selectedElement; const triggerStyle: CSSProperties = { background: 'transparent', height: renderedHeight, @@ -177,6 +180,8 @@ export function Popover({ focusedServiceName, environment, kuery, start, end }: const ContentsComponent = getContentsComponent(selectedElementData, isTraceExplorerEnabled); + const isOpen = !!selectedElement && !!ContentsComponent; + return ( - + {ContentsComponent && ( + + )} );