mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
DS Picker: Do not create extra history entries for panel onboarding (#68227)
This commit is contained in:
parent
c67bafbd5a
commit
0565c3440f
@ -65,7 +65,7 @@ export class QueryGroup extends PureComponent<Props, State> {
|
||||
querySubscription: Unsubscribable | null = null;
|
||||
|
||||
state: State = {
|
||||
isDataSourceModalOpen: false,
|
||||
isDataSourceModalOpen: !!locationService.getSearchObject().firstPanel,
|
||||
isLoadingHelp: false,
|
||||
helpContent: null,
|
||||
isPickerOpen: false,
|
||||
@ -87,6 +87,11 @@ export class QueryGroup extends PureComponent<Props, State> {
|
||||
});
|
||||
|
||||
this.setNewQueriesAndDatasource(options);
|
||||
|
||||
// Clean up the first panel flag since the modal is now open
|
||||
if (!!locationService.getSearchObject().firstPanel) {
|
||||
locationService.partial({ firstPanel: null }, true);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@ -117,14 +122,12 @@ export class QueryGroup extends PureComponent<Props, State> {
|
||||
datasource,
|
||||
...q,
|
||||
}));
|
||||
|
||||
this.setState({
|
||||
queries,
|
||||
dataSource: ds,
|
||||
dsSettings,
|
||||
defaultDataSource,
|
||||
// TODO: Detect the first panel added into a new dashboard better.
|
||||
// This is flaky in case the UID is generated differently
|
||||
isDataSourceModalOpen: !!locationService.getSearchObject().firstPanel,
|
||||
});
|
||||
} catch (error) {
|
||||
console.log('failed to load data source', error);
|
||||
@ -261,7 +264,6 @@ export class QueryGroup extends PureComponent<Props, State> {
|
||||
|
||||
onCloseDataSourceModal = () => {
|
||||
this.setState({ isDataSourceModalOpen: false });
|
||||
locationService.partial({ firstPanel: null });
|
||||
};
|
||||
|
||||
renderMixedPicker = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user