From 7735c1c726e3601cad665f64a9a9bac8cf4525c9 Mon Sep 17 00:00:00 2001 From: Jenny Date: Thu, 6 Jul 2023 11:39:07 +0200 Subject: [PATCH] Show charts if metadata fetch fails --- .../asset_details/tabs/overview/overview.tsx | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx index 47dc6016cc953..04f76c3c4de80 100644 --- a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx +++ b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx @@ -55,36 +55,6 @@ export const Overview = ({ metadata, } = useMetadata(nodeName, nodeType, inventoryModel.requiredMetrics, sourceId, currentTimeRange); - if (fetchMetadataError) { - return ( - - window.location.reload()} - > - {i18n.translate('xpack.infra.assetDetailsEmbeddable.overview.errorAction', { - defaultMessage: 'reload the page', - })} - - ), - }} - /> - - ); - } - return ( @@ -95,9 +65,36 @@ export const Overview = ({ /> - + {fetchMetadataError ? ( + + window.location.reload()} + > + {i18n.translate('xpack.infra.assetDetailsEmbeddable.overview.errorAction', { + defaultMessage: 'reload the page', + })} + + ), + }} + /> + + ) : ( + + )} - ); };