From 8c5abb388ac8770ed61edcc9189f0b44e373f788 Mon Sep 17 00:00:00 2001 From: Jen Evans Date: Tue, 7 Feb 2023 16:58:16 -0800 Subject: [PATCH] Check for empty costs array and allow title override Signed-off-by: Jen Evans --- .../src/components/CostInsightsLayout/CostInsightsLayout.tsx | 3 ++- .../cost-insights/src/components/EntityCosts/EntityCosts.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx b/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx index 0a583aae0d..55d5668189 100644 --- a/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx +++ b/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx @@ -37,6 +37,7 @@ type CostInsightsLayoutProps = { }; export const CostInsightsLayout = ({ + title = 'Cost Insights', groups, children, }: PropsWithChildren) => { @@ -46,7 +47,7 @@ export const CostInsightsLayout = ({
diff --git a/plugins/cost-insights/src/components/EntityCosts/EntityCosts.tsx b/plugins/cost-insights/src/components/EntityCosts/EntityCosts.tsx index 9dda1c65e3..69bf8885e7 100644 --- a/plugins/cost-insights/src/components/EntityCosts/EntityCosts.tsx +++ b/plugins/cost-insights/src/components/EntityCosts/EntityCosts.tsx @@ -120,7 +120,7 @@ export const EntityCostsCard = () => { return {error.message}; } - if (!dailyCost) { + if (!dailyCost || !dailyCost.aggregation.length) { return No daily costs; }