Skip to content

Commit 938e0ff

Browse files
committed
fixing blank page
1 parent 6d72042 commit 938e0ff

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ describe('getThrouputChartSelector', () => {
3737
expect(throughputTimeseries).toEqual({ throughputTimeseries: [] });
3838
});
3939

40+
it('returns default values when timeseries is empty', () => {
41+
const throughputTimeseries = getThrouputChartSelector({
42+
theme,
43+
throuputChart: { throughputTimeseries: [] },
44+
});
45+
expect(throughputTimeseries).toEqual({ throughputTimeseries: [] });
46+
});
47+
4048
it('return throughput time series', () => {
4149
const throughputTimeseries = getThrouputChartSelector({
4250
theme,

x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { difference, zipObject } from 'lodash';
88
import { EuiTheme } from '../../../observability/public';
99
import { asTransactionRate } from '../../common/utils/formatters';
1010
import { TimeSeries } from '../../typings/timeseries';
11-
import { getEmptySeries } from '../components/shared/charts/helper/get_empty_series';
1211
import { APIReturnType } from '../services/rest/createCallApmApi';
1312
import { httpStatusCodeToColor } from '../utils/httpStatusCodeToColor';
1413

@@ -34,7 +33,7 @@ export function getThrouputChartSelector({
3433
};
3534
}
3635

37-
export function getThroughputTimeseries({
36+
function getThroughputTimeseries({
3837
throuputChart,
3938
theme,
4039
}: {
@@ -45,15 +44,6 @@ export function getThroughputTimeseries({
4544
const bucketKeys = throughputTimeseries.map(({ key }) => key);
4645
const getColor = getColorByKey(bucketKeys, theme);
4746

48-
if (!throughputTimeseries.length) {
49-
const start = throughputTimeseries[0].dataPoints[0].x;
50-
const end =
51-
throughputTimeseries[0].dataPoints[
52-
throughputTimeseries[0].dataPoints.length - 1
53-
].x;
54-
return getEmptySeries(start, end);
55-
}
56-
5747
return throughputTimeseries.map((bucket) => {
5848
return {
5949
title: bucket.key,

0 commit comments

Comments
 (0)