mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix initial state in split explore
- remove `edited` from query state to reset queries - clear more properties in state
This commit is contained in:
parent
1bb3cf1c31
commit
e832f91fb6
@ -207,6 +207,7 @@ export class Explore extends React.Component<any, IExploreState> {
|
|||||||
datasourceError: null,
|
datasourceError: null,
|
||||||
datasourceLoading: true,
|
datasourceLoading: true,
|
||||||
graphResult: null,
|
graphResult: null,
|
||||||
|
latency: 0,
|
||||||
logsResult: null,
|
logsResult: null,
|
||||||
queryErrors: [],
|
queryErrors: [],
|
||||||
queryHints: [],
|
queryHints: [],
|
||||||
@ -254,7 +255,10 @@ export class Explore extends React.Component<any, IExploreState> {
|
|||||||
this.setState({
|
this.setState({
|
||||||
graphResult: null,
|
graphResult: null,
|
||||||
logsResult: null,
|
logsResult: null,
|
||||||
|
latency: 0,
|
||||||
queries: ensureQueries(),
|
queries: ensureQueries(),
|
||||||
|
queryErrors: [],
|
||||||
|
queryHints: [],
|
||||||
tableResult: null,
|
tableResult: null,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -276,8 +280,10 @@ export class Explore extends React.Component<any, IExploreState> {
|
|||||||
|
|
||||||
onClickSplit = () => {
|
onClickSplit = () => {
|
||||||
const { onChangeSplit } = this.props;
|
const { onChangeSplit } = this.props;
|
||||||
|
const state = { ...this.state };
|
||||||
|
state.queries = state.queries.map(({ edited, ...rest }) => rest);
|
||||||
if (onChangeSplit) {
|
if (onChangeSplit) {
|
||||||
onChangeSplit(true, this.state);
|
onChangeSplit(true, state);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user