mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 23:37:01 -06:00
Explore: keep query when changing datasources (#13042)
- clear `edited` state for each query when a new datasource is set
This commit is contained in:
parent
552a61b6ae
commit
b8e6817732
@ -173,6 +173,12 @@ export class Explore extends React.Component<any, ExploreState> {
|
||||
datasource.init();
|
||||
}
|
||||
|
||||
// Keep queries but reset edit state
|
||||
const nextQueries = this.state.queries.map(q => ({
|
||||
...q,
|
||||
edited: false,
|
||||
}));
|
||||
|
||||
this.setState(
|
||||
{
|
||||
datasource,
|
||||
@ -182,6 +188,7 @@ export class Explore extends React.Component<any, ExploreState> {
|
||||
supportsLogs,
|
||||
supportsTable,
|
||||
datasourceLoading: false,
|
||||
queries: nextQueries,
|
||||
},
|
||||
() => datasourceError === null && this.onSubmit()
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user