feat(cp-frontend): only show GraphsContainer when metrics existent

This commit is contained in:
Sérgio Ramos 2017-08-30 16:47:10 +01:00
parent 8695a134d2
commit 9c4d69d586

View File

@ -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 => (
<GraphContainer xs={4}>
<GraphLeftShaddow />
@ -193,6 +193,10 @@ const ServiceListItem = ({
))
: null;
const metrics = graphs ? (
<GraphsContainer>{graphs}</GraphsContainer>
) : null;
const view = children.length ? (
<CardGroupView>{childrenItems}</CardGroupView>
) : (
@ -202,7 +206,7 @@ const ServiceListItem = ({
<Status service={service} />
<HealthInfoContainer>{healthyInfo}</HealthInfoContainer>
</StatusContainer>
<GraphsContainer>{metrics}</GraphsContainer>
{metrics}
</ServiceView>
);