Merge branch 'feature/handle-empty-alert-set'

pull/398/head
Kevin Fitzpatrick 2016-11-07 12:02:14 -08:00
commit 0c1e89ac1e
1 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,10 @@ const AlertsApp = React.createClass({
const results = [];
const alertSeries = _.get(resp, ['data', 'results', '0', 'series'], []);
if (alertSeries.length === 0) {
this.setState({loading: false, alerts: []});
return;
}
const timeIndex = alertSeries[0].columns.findIndex((col) => col === 'time');
const hostIndex = alertSeries[0].columns.findIndex((col) => col === 'host');