Skip to content

Commit

Permalink
Merge pull request #4201 from dlabrecq/cost-5870
Browse files Browse the repository at this point in the history
Make Overhead Costs dropdown always available
  • Loading branch information
dlabrecq authored Feb 19, 2025
2 parents 18d9726 + 1f04ac6 commit 8841997
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/routes/details/ocpDetails/detailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class DetailsHeaderBase extends React.Component<DetailsHeaderProps, DetailsHeade
const { currentDateRangeType } = this.state;

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

let cost: string | React.ReactNode = <EmptyValueState />;
let supplementaryCost: string | React.ReactNode = <EmptyValueState />;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/explorer/explorerHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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';
Expand Down Expand Up @@ -280,7 +281,6 @@ class ExplorerHeaderBase extends React.Component<ExplorerHeaderProps, ExplorerHe
perspective,
providersFetchStatus,
query,
report,
startDate,
} = this.props;

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

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

return (
<header style={styles.header}>
Expand Down
3 changes: 1 addition & 2 deletions src/routes/explorer/explorerTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ class ExplorerTableBase extends React.Component<ExplorerTableProps, ExplorerTabl

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

const computedItems = getUnsortedComputedReportItems<any, any>({
report,
Expand Down

0 comments on commit 8841997

Please sign in to comment.