Skip to content

Commit 115f7d4

Browse files
authored
Merge pull request #4204 from dlabrecq/ocp2
Fix when costDistribution dropdown is shown
2 parents 9a9de90 + 057a995 commit 115f7d4

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/routes/details/ocpDetails/detailsHeader.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import React from 'react';
1212
import type { WrappedComponentProps } from 'react-intl';
1313
import { injectIntl } from 'react-intl';
1414
import { connect } from 'react-redux';
15-
import { ComputedReportItemValueType } from 'routes/components/charts/common';
1615
import { CostDistribution } from 'routes/components/costDistribution';
1716
import { Currency } from 'routes/components/currency';
1817
import { DateRange } from 'routes/components/dateRange';
@@ -130,8 +129,6 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, DetailsHeade
130129
const { currentDateRangeType } = this.state;
131130

132131
const showContent = report && !providersError && providers?.meta?.count > 0;
133-
const showCostDistribution = costDistribution === ComputedReportItemValueType.distributed; // Always show -- see https://issues.redhat.com/browse/COST-5870
134-
135132
const { cost, infrastructureCost, supplementaryCost } = getTotalCost(report, costDistribution);
136133

137134
return (
@@ -169,7 +166,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, DetailsHeade
169166
timeScopeValue={timeScopeValue}
170167
/>
171168
</FlexItem>
172-
{showCostDistribution && (
169+
{costDistribution && (
173170
<FlexItem>
174171
<CostDistribution costDistribution={costDistribution} onSelect={onCostDistributionSelect} />
175172
</FlexItem>

src/routes/explorer/explorerHeader.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import React from 'react';
1616
import type { WrappedComponentProps } from 'react-intl';
1717
import { injectIntl } from 'react-intl';
1818
import { connect } from 'react-redux';
19-
import { ComputedReportItemValueType } from 'routes/components/charts/common';
2019
import { CostDistribution } from 'routes/components/costDistribution';
2120
import { CostType } from 'routes/components/costType';
2221
import { Currency } from 'routes/components/currency';
@@ -304,9 +303,8 @@ class ExplorerHeaderBase extends React.Component<ExplorerHeaderProps, ExplorerHe
304303
const tagPathsType = getTagReportPathsType(perspective);
305304

306305
const showContent = report && !providersError && providers?.meta?.count > 0;
307-
const showCostDistribution = costDistribution === ComputedReportItemValueType.distributed; // Always show -- see https://issues.redhat.com/browse/COST-5870
308-
309306
const { cost, infrastructureCost, supplementaryCost } = getTotalCost(report, costDistribution);
307+
310308
const dateRange = intl.formatDateTimeRange(new Date(startDate + 'T00:00:00'), new Date(endDate + 'T00:00:00'), {
311309
day: 'numeric',
312310
month: 'long',
@@ -349,7 +347,7 @@ class ExplorerHeaderBase extends React.Component<ExplorerHeaderProps, ExplorerHe
349347
tagPathsType={tagPathsType}
350348
/>
351349
</FlexItem>
352-
{showCostDistribution && (
350+
{costDistribution && (
353351
<FlexItem>
354352
<CostDistribution costDistribution={costDistribution} onSelect={onCostDistributionSelect} />
355353
</FlexItem>

0 commit comments

Comments
 (0)