From 9c4d69d5866886e3a609bd6557a4f0070131b6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 30 Aug 2017 16:47:10 +0100 Subject: [PATCH] feat(cp-frontend): only show GraphsContainer when metrics existent --- packages/cp-frontend/src/components/services/list-item.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/cp-frontend/src/components/services/list-item.js b/packages/cp-frontend/src/components/services/list-item.js index ab27c929..6fccbbbc 100644 --- a/packages/cp-frontend/src/components/services/list-item.js +++ b/packages/cp-frontend/src/components/services/list-item.js @@ -179,7 +179,7 @@ const ServiceListItem = ({ ); } - const metrics = !children.length + const graphs = !children.length && Object.keys(service.metrics).length ? Object.keys(service.metrics).map(key => ( @@ -193,6 +193,10 @@ const ServiceListItem = ({ )) : null; + const metrics = graphs ? ( + {graphs} + ) : null; + const view = children.length ? ( {childrenItems} ) : ( @@ -202,7 +206,7 @@ const ServiceListItem = ({ {healthyInfo} - {metrics} + {metrics} );