mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
[dashboard bug]Instant control should take effect instantly (#3890)
in explore view, controls like color cheme, legend, rich tooltip, etc., change these controls should see effect instantly, without click Run Query.
This commit is contained in:
@@ -9,6 +9,7 @@ import ControlPanelsContainer from './ControlPanelsContainer';
|
||||
import SaveModal from './SaveModal';
|
||||
import QueryAndSaveBtns from './QueryAndSaveBtns';
|
||||
import { getExploreUrl } from '../exploreUtils';
|
||||
import { areObjectsEqual } from '../../reduxUtils';
|
||||
import { getFormDataFromControls } from '../stores/store';
|
||||
import { chartPropType } from '../../chart/chartReducer';
|
||||
import * as exploreActions from '../actions/exploreActions';
|
||||
@@ -50,6 +51,11 @@ class ExploreViewContainer extends React.Component {
|
||||
if (np.controls.datasource.value !== this.props.controls.datasource.value) {
|
||||
this.props.actions.fetchDatasourceMetadata(np.form_data.datasource, true);
|
||||
}
|
||||
// if any control value changed and it's an instant control
|
||||
if (Object.keys(np.controls).some(key => (np.controls[key].renderTrigger &&
|
||||
!areObjectsEqual(np.controls[key].value, this.props.controls[key].value)))) {
|
||||
this.props.actions.renderTriggered(new Date().getTime(), this.props.chart.chartKey);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
|
||||
Reference in New Issue
Block a user