Skip to content

Commit 8841997

Browse files
authored
Merge pull request #4201 from dlabrecq/cost-5870
Make Overhead Costs dropdown always available
2 parents 18d9726 + 1f04ac6 commit 8841997

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/routes/details/ocpDetails/detailsHeader.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, DetailsHeade
131131
const { currentDateRangeType } = this.state;
132132

133133
const showContent = report && !providersError && providers?.meta?.count > 0;
134-
const showCostDistribution = groupBy === 'project' && report?.meta?.distributed_overhead === true;
134+
const showCostDistribution = costDistribution === ComputedReportItemValueType.distributed; // Always show -- see https://issues.redhat.com/browse/COST-5870
135135

136136
let cost: string | React.ReactNode = <EmptyValueState />;
137137
let supplementaryCost: string | React.ReactNode = <EmptyValueState />;

src/routes/explorer/explorerHeader.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ 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';
1920
import { CostDistribution } from 'routes/components/costDistribution';
2021
import { CostType } from 'routes/components/costType';
2122
import { Currency } from 'routes/components/currency';
@@ -280,7 +281,6 @@ class ExplorerHeaderBase extends React.Component<ExplorerHeaderProps, ExplorerHe
280281
perspective,
281282
providersFetchStatus,
282283
query,
283-
report,
284284
startDate,
285285
} = this.props;
286286

@@ -299,7 +299,7 @@ class ExplorerHeaderBase extends React.Component<ExplorerHeaderProps, ExplorerHe
299299
const resourcePathsType = getResourcePathsType(perspective);
300300
const tagPathsType = getTagReportPathsType(perspective);
301301

302-
const showCostDistribution = costDistribution && report?.meta?.distributed_overhead === true;
302+
const showCostDistribution = costDistribution === ComputedReportItemValueType.distributed; // Always show -- see https://issues.redhat.com/browse/COST-5870
303303

304304
return (
305305
<header style={styles.header}>

src/routes/explorer/explorerTable.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ class ExplorerTableBase extends React.Component<ExplorerTableProps, ExplorerTabl
135135

136136
const isGroupByProject = groupBy === 'project';
137137
const showPlatformCosts = perspective === PerspectiveType.ocp && isGroupByProject;
138-
const showCostDistribution =
139-
costDistribution === ComputedReportItemValueType.distributed && report?.meta?.distributed_overhead === true;
138+
const showCostDistribution = costDistribution === ComputedReportItemValueType.distributed; // Always show -- see https://issues.redhat.com/browse/COST-5870
140139

141140
const computedItems = getUnsortedComputedReportItems<any, any>({
142141
report,

0 commit comments

Comments
 (0)