Skip to content

Commit e2a7d96

Browse files
authored
Merge pull request #2279 from HubSpot/costs_plugin
Better loading state for costs table
2 parents 1741355 + d94620e commit e2a7d96

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

SingularityUI/app/components/requestDetail/CostsView.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import Column from '../common/table/Column';
99
import Utils from '../../utils';
1010

1111
const CostsView = ({requestId, costsAPI}) => {
12+
if (!config.costsApiUrlFormat) {
13+
return (<div></div>);
14+
}
1215
const costs = costsAPI ? costsAPI.data : [];
1316
const title = costs.length ? 'Average Daily Costs ($' + costs.map((c) => c.cost).reduce((p, c) => p + c).toFixed(4) + ')' : 'Average Daily Costs';
1417
return (
@@ -18,8 +21,9 @@ const CostsView = ({requestId, costsAPI}) => {
1821
keyGetter={(c) => c.activityType + c.cost + c.costKey+ c.costType}
1922
defaultSortBy={'cost'}
2023
defaultSortDirection={'DESC'}
21-
showPageLoaderWhenFetching={true}
24+
showPageLoaderWhenFetching={false}
2225
isFetching={!costs.length}
26+
emptyTableMessage={'No Cost Data'}
2327
>
2428
<Column
2529
label="Activity Type"

0 commit comments

Comments
 (0)