mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Handle undefined graph and table results
This commit is contained in:
parent
05edb3e5ad
commit
957c659291
@ -30,6 +30,11 @@ export class GraphContainer extends PureComponent<GraphContainerProps> {
|
||||
render() {
|
||||
const { exploreId, graphResult, loading, onChangeTime, showingGraph, showingTable, range, split } = this.props;
|
||||
const graphHeight = showingGraph && showingTable ? '200px' : '400px';
|
||||
|
||||
if (!graphResult) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Panel label="Graph" isOpen={showingGraph} loading={loading} onToggle={this.onClickGraphButton}>
|
||||
<Graph
|
||||
|
@ -26,6 +26,11 @@ export class TableContainer extends PureComponent<TableContainerProps> {
|
||||
|
||||
render() {
|
||||
const { loading, onClickCell, showingTable, tableResult } = this.props;
|
||||
|
||||
if (!tableResult) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Panel label="Table" loading={loading} isOpen={showingTable} onToggle={this.onClickTableButton}>
|
||||
<Table data={tableResult} loading={loading} onClickCell={onClickCell} />
|
||||
|
Loading…
Reference in New Issue
Block a user