feat(explore): Keep or reset chart config after datasource change (#18215)

* feat(explore): Keep or reset chart config after datasource change

* Update copy

* Remove useDispatch

* fix test

* Fix bugs

* Remove ts ignore

* Scroll top when datasource changes

* Fix crashing when switching viz type
This commit is contained in:
Kamil Gabryjelski
2022-02-02 21:28:35 +01:00
committed by GitHub
parent f212f884e5
commit 70969821de
8 changed files with 402 additions and 181 deletions

View File

@@ -609,9 +609,11 @@ function ExploreViewContainer(props) {
datasourceType={props.datasource_type}
/>
<ConnectedControlPanelsContainer
exploreState={props.exploreState}
actions={props.actions}
form_data={props.form_data}
controls={props.controls}
chart={props.chart}
datasource_type={props.datasource_type}
isDatasourceMetaLoading={props.isDatasourceMetaLoading}
/>
@@ -673,6 +675,7 @@ function mapStateToProps(state) {
ownState: dataMask[form_data.slice_id ?? 0]?.ownState, // 0 - unsaved chart
impressionId,
user: explore.user,
exploreState: explore,
reports,
};
}