Skip to content

Commit

Permalink
Merge pull request #4010 from dlabrecq/export
Browse files Browse the repository at this point in the history
Refactor export to support EC2 instances
  • Loading branch information
dlabrecq authored Sep 10, 2024
2 parents e3a8a5b + 600cd7c commit 318e8f9
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/routes/details/awsBreakdown/instances/instancesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@ const InstancesTable: React.FC<InstancesTableProps> = ({
// There is no group by for instances, but we use it to format messages
return (
<Actions
groupBy={'instance'}
groupBy={'resource_id'}
isDisabled={isDisabled}
item={item}
isTimeScoped
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={reportType}
Expand Down
3 changes: 2 additions & 1 deletion src/routes/details/awsDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'routes/components/dataTable/dataTable.scss';

import type { Query } from 'api/queries/query';
import type { AwsReport } from 'api/reports/awsReports';
import { ReportPathsType } from 'api/reports/report';
import { ReportPathsType, ReportType } from 'api/reports/report';
import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
Expand Down Expand Up @@ -222,6 +222,7 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
item={item}
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={ReportType.cost}
/>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/routes/details/azureDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'routes/components/dataTable/dataTable.scss';

import type { Query } from 'api/queries/query';
import type { AzureReport } from 'api/reports/azureReports';
import { ReportPathsType } from 'api/reports/report';
import { ReportPathsType, ReportType } from 'api/reports/report';
import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
Expand Down Expand Up @@ -194,6 +194,7 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
item={item}
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={ReportType.cost}
/>
);
};
Expand Down
5 changes: 4 additions & 1 deletion src/routes/details/components/actions/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { withRouter } from 'utils/router';
interface DetailsActionsOwnProps extends WrappedComponentProps, RouterComponentProps {
groupBy?: string;
isDisabled?: boolean;
isTimeScoped?: boolean;
item: ComputedReportItem;
reportPathsType: ReportPathsType;
reportQueryString: string;
Expand Down Expand Up @@ -52,14 +53,16 @@ class DetailsActionsBase extends React.Component<DetailsActionsProps, DetailsAct
}

private getExportModal = () => {
const { groupBy, item, reportPathsType, reportQueryString, reportType, showAggregateType } = this.props;
const { groupBy, isTimeScoped, item, reportPathsType, reportQueryString, reportType, showAggregateType } =
this.props;
const { isExportModalOpen } = this.state;

return (
<ExportModal
count={1}
groupBy={groupBy}
isOpen={isExportModalOpen}
isTimeScoped={isTimeScoped}
items={[item]}
onClose={this.handleExportModalClose}
reportPathsType={reportPathsType}
Expand Down
3 changes: 2 additions & 1 deletion src/routes/details/gcpDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'routes/components/dataTable/dataTable.scss';

import type { Query } from 'api/queries/query';
import type { GcpReport } from 'api/reports/gcpReports';
import { ReportPathsType } from 'api/reports/report';
import { ReportPathsType, ReportType } from 'api/reports/report';
import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
Expand Down Expand Up @@ -194,6 +194,7 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
item={item}
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={ReportType.cost}
/>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/routes/details/ibmDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'routes/components/dataTable/dataTable.scss';

import type { Query } from 'api/queries/query';
import type { IbmReport } from 'api/reports/ibmReports';
import { ReportPathsType } from 'api/reports/report';
import { ReportPathsType, ReportType } from 'api/reports/report';
import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
Expand Down Expand Up @@ -194,6 +194,7 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
item={item}
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={ReportType.cost}
/>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/routes/details/ociDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'routes/components/dataTable/dataTable.scss';

import type { Query } from 'api/queries/query';
import type { OciReport } from 'api/reports/ociReports';
import { ReportPathsType } from 'api/reports/report';
import { ReportPathsType, ReportType } from 'api/reports/report';
import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
Expand Down Expand Up @@ -194,6 +194,7 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
item={item}
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={ReportType.cost}
/>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/routes/details/ocpDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Label, Tooltip } from '@patternfly/react-core';
import AsyncComponent from '@redhat-cloud-services/frontend-components/AsyncComponent';
import type { Query } from 'api/queries/query';
import type { OcpReport, OcpReportItem } from 'api/reports/ocpReports';
import { ReportPathsType } from 'api/reports/report';
import { ReportPathsType, ReportType } from 'api/reports/report';
import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
Expand Down Expand Up @@ -373,6 +373,7 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
item={item}
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={ReportType.cost}
showPriceListOption={groupBy === 'cluster'}
/>
);
Expand Down
3 changes: 2 additions & 1 deletion src/routes/details/rhelDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'routes/components/dataTable/dataTable.scss';

import { Label } from '@patternfly/react-core';
import type { Query } from 'api/queries/query';
import { ReportPathsType } from 'api/reports/report';
import { ReportPathsType, ReportType } from 'api/reports/report';
import type { RhelReport } from 'api/reports/rhelReports';
import messages from 'locales/messages';
import React from 'react';
Expand Down Expand Up @@ -287,6 +287,7 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
item={item}
reportPathsType={reportPathsType}
reportQueryString={reportQueryString}
reportType={ReportType.cost}
showPriceListOption={groupBy === 'cluster'}
/>
);
Expand Down

0 comments on commit 318e8f9

Please sign in to comment.