From 057a995d26911684b9136a269e9f02877eaf09ab Mon Sep 17 00:00:00 2001 From: Dan Labrecque Date: Thu, 20 Feb 2025 08:28:10 -0500 Subject: [PATCH] Fix when costDistribution dropdown is shown --- src/routes/details/ocpDetails/detailsHeader.tsx | 5 +---- src/routes/explorer/explorerHeader.tsx | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/routes/details/ocpDetails/detailsHeader.tsx b/src/routes/details/ocpDetails/detailsHeader.tsx index cbddb23ed..0df31555c 100644 --- a/src/routes/details/ocpDetails/detailsHeader.tsx +++ b/src/routes/details/ocpDetails/detailsHeader.tsx @@ -12,7 +12,6 @@ import React from 'react'; import type { WrappedComponentProps } from 'react-intl'; import { injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import { ComputedReportItemValueType } from 'routes/components/charts/common'; import { CostDistribution } from 'routes/components/costDistribution'; import { Currency } from 'routes/components/currency'; import { DateRange } from 'routes/components/dateRange'; @@ -130,8 +129,6 @@ class DetailsHeaderBase extends React.Component 0; - const showCostDistribution = costDistribution === ComputedReportItemValueType.distributed; // Always show -- see https://issues.redhat.com/browse/COST-5870 - const { cost, infrastructureCost, supplementaryCost } = getTotalCost(report, costDistribution); return ( @@ -169,7 +166,7 @@ class DetailsHeaderBase extends React.Component - {showCostDistribution && ( + {costDistribution && ( diff --git a/src/routes/explorer/explorerHeader.tsx b/src/routes/explorer/explorerHeader.tsx index 6a556439c..884efdd62 100644 --- a/src/routes/explorer/explorerHeader.tsx +++ b/src/routes/explorer/explorerHeader.tsx @@ -16,7 +16,6 @@ import React from 'react'; import type { WrappedComponentProps } from 'react-intl'; import { injectIntl } from 'react-intl'; import { connect } from 'react-redux'; -import { ComputedReportItemValueType } from 'routes/components/charts/common'; import { CostDistribution } from 'routes/components/costDistribution'; import { CostType } from 'routes/components/costType'; import { Currency } from 'routes/components/currency'; @@ -304,9 +303,8 @@ class ExplorerHeaderBase extends React.Component 0; - const showCostDistribution = costDistribution === ComputedReportItemValueType.distributed; // Always show -- see https://issues.redhat.com/browse/COST-5870 - const { cost, infrastructureCost, supplementaryCost } = getTotalCost(report, costDistribution); + const dateRange = intl.formatDateTimeRange(new Date(startDate + 'T00:00:00'), new Date(endDate + 'T00:00:00'), { day: 'numeric', month: 'long', @@ -349,7 +347,7 @@ class ExplorerHeaderBase extends React.Component - {showCostDistribution && ( + {costDistribution && (