Commit b8e68177 by David Committed by Torkel Ödegaard

Explore: keep query when changing datasources (#13042)

- clear `edited` state for each query when a new datasource is set
parent 552a61b6
......@@ -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()
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment