Skip to content

Commit

Permalink
Merge pull request #2826 from dlabrecq/3380-breakdown-title
Browse files Browse the repository at this point in the history
Details breakdown title and description are same
  • Loading branch information
dlabrecq authored Jan 11, 2023
2 parents c054cd0 + 3d2ef99 commit f741cec
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/routes/views/details/azureDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class DetailsTableBase extends React.Component<DetailsTableProps> {
<Link
to={getBreakdownPath({
basePath: paths.azureDetailsBreakdown,
label: label.toString(),
description: item.id,
groupBy,
id: item.id,
router,
title: label.toString(),
})}
>
{label}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/views/details/gcpDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class DetailsTableBase extends React.Component<DetailsTableProps> {
<Link
to={getBreakdownPath({
basePath: paths.gcpDetailsBreakdown,
label: label.toString(),
description: item.id,
groupBy,
id: item.id,
router,
title: label.toString(),
})}
>
{label}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/views/details/ibmDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class DetailsTableBase extends React.Component<DetailsTableProps> {
<Link
to={getBreakdownPath({
basePath: paths.ibmDetailsBreakdown,
label: label.toString(),
description: item.id,
groupBy,
id: item.id,
router,
title: label.toString(),
})}
>
{label}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/views/details/ociDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class DetailsTableBase extends React.Component<DetailsTableProps> {
<Link
to={getBreakdownPath({
basePath: paths.ociDetailsBreakdown,
label: label.toString(),
description: item.id,
groupBy,
id: item.id,
router,
title: label.toString(),
})}
>
{label}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/views/details/ocpDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ class DetailsTableBase extends React.Component<DetailsTableProps> {
<Link
to={getBreakdownPath({
basePath: paths.ocpDetailsBreakdown,
label: label.toString(),
description: item.id,
id: item.id,
isPlatformCosts,
groupBy,
router,
title: label.toString(),
})}
>
{label}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/views/details/rhelDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ class DetailsTableBase extends React.Component<DetailsTableProps> {
<Link
to={getBreakdownPath({
basePath: paths.rhelDetailsBreakdown,
label: label.toString(),
description: item.id,
groupBy,
id: item.id,
router,
title: label.toString(),
})}
>
{label}
Expand Down
8 changes: 4 additions & 4 deletions src/routes/views/utils/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ export const getBreakdownPath = ({
groupBy,
id,
isPlatformCosts,
label,
router,
title,
}: {
basePath: string;
description: string; // Used to display a description in the breakdown header
groupBy: string | number;
id: string | number; // group_by[account]=<id> param in the breakdown page
isPlatformCosts?: boolean;
label: string;
router: RouteComponentProps;
title: string | number; // Used to display a title in the breakdown header
}) => {
const queryFromRoute = parseQuery<Query>(router.location.search);
const newQuery = {
...queryFromRoute,
...(description && description !== label && { [breakdownDescKey]: description }),
...(isPlatformCosts && { [breakdownTitleKey]: label }),
...(description && description !== title && { [breakdownDescKey]: description }),
...(title && { [breakdownTitleKey]: title }),
group_by: {
[groupBy]: isPlatformCosts ? '*' : id, // Use ID here -- see https://github.com/project-koku/koku-ui/pull/2821
},
Expand Down

0 comments on commit f741cec

Please sign in to comment.