Skip to content

Commit 7517312

Browse files
authored
Merge pull request #4007 from dlabrecq/percentage
Remove percentage from EC2 instances table
2 parents 5bdd4a5 + 0669f16 commit 7517312

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/routes/details/awsBreakdown/instances/instancesTable.tsx

+4-13
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ const InstancesTable: React.FC<InstancesTableProps> = ({
129129
},
130130
];
131131

132-
computedItems.map((item, index) => {
133-
const cost = getTotalCost(item, index);
132+
computedItems.map(item => {
133+
const cost = getTotalCost(item);
134134
const actions = getActions(item);
135135

136136
newRows.push({
@@ -208,19 +208,10 @@ const InstancesTable: React.FC<InstancesTableProps> = ({
208208
);
209209
};
210210

211-
const getTotalCost = (item: ComputedReportItem, index: number) => {
212-
const cost = report?.meta?.total?.cost?.total ? report.meta.total.cost.total.value : 0;
211+
const getTotalCost = (item: ComputedReportItem) => {
213212
const value = item.cost?.total?.value || 0;
214213
const units = item.cost?.total?.units || 'USD';
215-
const percentValue = cost === 0 ? cost.toFixed(2) : ((value / cost) * 100).toFixed(2);
216-
return (
217-
<>
218-
{formatCurrency(value, units)}
219-
<div style={styles.infoDescription} key={`total-cost-${index}`}>
220-
{intl.formatMessage(messages.percentOfCost, { value: percentValue })}
221-
</div>
222-
</>
223-
);
214+
return formatCurrency(value, units);
224215
};
225216

226217
const handleOnSort = (sortType: string, isSortAscending: boolean) => {

0 commit comments

Comments
 (0)