remove extra call to get_viz in explorev2 (#1812)

* Not working errors

* Remove update_explore endpoint, only update explore endpoints in reducer on query

* Change scroll to auto and make container reponse to height:

* Remove update_explore endpoint

* Remove can_update_explore perm
This commit is contained in:
vera-liu
2016-12-12 10:58:07 -08:00
committed by GitHub
parent 699602d1c5
commit 9f7486f402
8 changed files with 84 additions and 116 deletions

View File

@@ -8,9 +8,7 @@ import ControlPanelsContainer from './ControlPanelsContainer';
import SaveModal from './SaveModal';
import QueryAndSaveBtns from '../../explore/components/QueryAndSaveBtns';
import { autoQueryFields } from '../stores/fields';
import { getParamObject } from '../exploreUtils';
const $ = require('jquery');
import { getExploreUrl } from '../exploreUtils';
const propTypes = {
form_data: React.PropTypes.object.isRequired,
@@ -48,11 +46,12 @@ class ExploreViewContainer extends React.Component {
}
onQuery(form_data) {
const data = getParamObject(form_data, this.props.datasource_type);
this.queryFormData(data);
const params = $.param(data, true);
this.updateUrl(params);
this.props.actions.chartUpdateStarted();
history.pushState(
{},
document.title,
getExploreUrl(form_data, this.props.datasource_type)
);
// remove alerts when query
this.props.actions.removeControlPanelAlert();
this.props.actions.removeChartAlert();
@@ -63,17 +62,6 @@ class ExploreViewContainer extends React.Component {
return `${window.innerHeight - navHeight}px`;
}
updateUrl(params) {
const baseUrl =
`/superset/explore/${this.props.datasource_type}/${this.props.form_data.datasource}/`;
const newEndpoint = `${baseUrl}?${params}`;
history.pushState({}, document.title, newEndpoint);
}
queryFormData(data) {
this.props.actions.updateExplore(
this.props.datasource_type, this.props.form_data.datasource, data);
}
handleResize() {
this.setState({ height: this.getHeight() });
}
@@ -119,7 +107,6 @@ class ExploreViewContainer extends React.Component {
<ChartContainer
actions={this.props.actions}
height={this.state.height}
actions={this.props.actions}
/>
</div>
</div>