@@ -3,20 +3,17 @@ import React, { ComponentClass } from 'react';
3
3
import { hot } from 'react-hot-loader' ;
4
4
// @ts -ignore
5
5
import { connect } from 'react-redux' ;
6
- import _ from 'lodash' ;
7
6
import { AutoSizer } from 'react-virtualized' ;
8
7
import memoizeOne from 'memoize-one' ;
9
8
10
9
// Services & Utils
11
10
import store from 'app/core/store' ;
12
-
13
11
// Components
14
- import { Alert } from '@grafana/ui' ;
12
+ import { Alert , DataQuery , ExploreStartPageProps , DataSourceApi , PanelData } from '@grafana/ui' ;
15
13
import { ErrorBoundary } from './ErrorBoundary' ;
16
14
import LogsContainer from './LogsContainer' ;
17
15
import QueryRows from './QueryRows' ;
18
16
import TableContainer from './TableContainer' ;
19
-
20
17
// Actions
21
18
import {
22
19
changeSize ,
@@ -29,11 +26,8 @@ import {
29
26
updateTimeRange ,
30
27
toggleGraph ,
31
28
} from './state/actions' ;
32
-
33
29
// Types
34
- import { RawTimeRange , GraphSeriesXY , LoadingState , TimeZone , AbsoluteTimeRange } from '@grafana/data' ;
35
-
36
- import { DataQuery , ExploreStartPageProps , DataSourceApi , DataQueryError } from '@grafana/ui' ;
30
+ import { RawTimeRange , GraphSeriesXY , TimeZone , AbsoluteTimeRange } from '@grafana/data' ;
37
31
import {
38
32
ExploreItemState ,
39
33
ExploreUrlState ,
@@ -86,7 +80,6 @@ interface ExploreProps {
86
80
initialRange : RawTimeRange ;
87
81
mode : ExploreMode ;
88
82
initialUI : ExploreUIState ;
89
- queryErrors : DataQueryError [ ] ;
90
83
isLive : boolean ;
91
84
updateTimeRange : typeof updateTimeRange ;
92
85
graphResult ?: GraphSeriesXY [ ] ;
@@ -97,6 +90,7 @@ interface ExploreProps {
97
90
timeZone ?: TimeZone ;
98
91
onHiddenSeriesChanged ?: ( hiddenSeries : string [ ] ) => void ;
99
92
toggleGraph : typeof toggleGraph ;
93
+ queryResponse : PanelData ;
100
94
}
101
95
102
96
/**
@@ -243,14 +237,14 @@ export class Explore extends React.PureComponent<ExploreProps> {
243
237
showingStartPage,
244
238
split,
245
239
queryKeys,
246
- queryErrors,
247
240
mode,
248
241
graphResult,
249
242
loading,
250
243
absoluteRange,
251
244
showingGraph,
252
245
showingTable,
253
246
timeZone,
247
+ queryResponse,
254
248
} = this . props ;
255
249
const exploreClass = split ? 'explore explore-split' : 'explore' ;
256
250
@@ -272,7 +266,7 @@ export class Explore extends React.PureComponent<ExploreProps> {
272
266
{ datasourceInstance && (
273
267
< div className = "explore-container" >
274
268
< QueryRows exploreEvents = { this . exploreEvents } exploreId = { exploreId } queryKeys = { queryKeys } />
275
- < ErrorContainer queryErrors = { queryErrors } />
269
+ < ErrorContainer queryErrors = { [ queryResponse . error ] } />
276
270
< AutoSizer onResize = { this . onResize } disableHeight >
277
271
{ ( { width } ) => {
278
272
if ( width === 0 ) {
@@ -347,15 +341,15 @@ function mapStateToProps(state: StoreState, { exploreId }: ExploreProps) {
347
341
queryKeys,
348
342
urlState,
349
343
update,
350
- queryErrors,
351
344
isLive,
352
345
supportedModes,
353
346
mode,
354
347
graphResult,
355
- loadingState ,
348
+ loading ,
356
349
showingGraph,
357
350
showingTable,
358
351
absoluteRange,
352
+ queryResponse,
359
353
} = item ;
360
354
361
355
const { datasource, queries, range : urlRange , mode : urlMode , ui } = ( urlState || { } ) as ExploreUrlState ;
@@ -380,7 +374,6 @@ function mapStateToProps(state: StoreState, { exploreId }: ExploreProps) {
380
374
}
381
375
382
376
const initialUI = ui || DEFAULT_UI_STATE ;
383
- const loading = loadingState === LoadingState . Loading || loadingState === LoadingState . Streaming ;
384
377
385
378
return {
386
379
StartPage,
@@ -398,13 +391,13 @@ function mapStateToProps(state: StoreState, { exploreId }: ExploreProps) {
398
391
initialRange,
399
392
mode : newMode ,
400
393
initialUI,
401
- queryErrors,
402
394
isLive,
403
395
graphResult,
404
396
loading,
405
397
showingGraph,
406
398
showingTable,
407
399
absoluteRange,
400
+ queryResponse,
408
401
} ;
409
402
}
410
403
0 commit comments