* Fix loading for time series graph panel
* Fix test by adding loading prop to dummyProps
(cherry picked from commit 5d52e50f6f)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
co-authored by
Ivana Huckova
parent
aadbb1ebf4
commit
ca6a767dc0
@@ -21,6 +21,7 @@ const dummyProps: ExploreProps = {
|
||||
} as DataSourceApi,
|
||||
datasourceMissing: false,
|
||||
exploreId: ExploreId.left,
|
||||
loading: false,
|
||||
initializeExplore: jest.fn(),
|
||||
initialized: true,
|
||||
modifyQueries: jest.fn(),
|
||||
|
||||
@@ -110,6 +110,7 @@ export interface ExploreProps {
|
||||
originPanelId: number;
|
||||
addQueryRow: typeof addQueryRow;
|
||||
theme: GrafanaTheme;
|
||||
loading: boolean;
|
||||
showMetrics: boolean;
|
||||
showTable: boolean;
|
||||
showLogs: boolean;
|
||||
@@ -287,8 +288,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
|
||||
}
|
||||
|
||||
renderGraphPanel(width: number) {
|
||||
const { graphResult, absoluteRange, timeZone, splitOpen, queryResponse } = this.props;
|
||||
const isLoading = queryResponse.state === LoadingState.Loading;
|
||||
const { graphResult, absoluteRange, timeZone, splitOpen, queryResponse, loading } = this.props;
|
||||
return (
|
||||
<ExploreGraphNGPanel
|
||||
data={graphResult!}
|
||||
@@ -298,7 +298,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
|
||||
onUpdateTimeRange={this.onUpdateTimeRange}
|
||||
annotations={queryResponse.annotations}
|
||||
splitOpenFn={splitOpen}
|
||||
isLoading={isLoading}
|
||||
isLoading={loading}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -482,6 +482,7 @@ function mapStateToProps(state: StoreState, { exploreId }: ExploreProps): Partia
|
||||
absoluteRange,
|
||||
queryResponse,
|
||||
showNodeGraph,
|
||||
loading,
|
||||
} = item;
|
||||
|
||||
const { datasource, queries, range: urlRange, originPanelId } = (urlState || {}) as ExploreUrlState;
|
||||
@@ -514,6 +515,7 @@ function mapStateToProps(state: StoreState, { exploreId }: ExploreProps): Partia
|
||||
showTable,
|
||||
showTrace,
|
||||
showNodeGraph,
|
||||
loading,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user