Use POST in sqllab_viz instead of url params to avoid error with long queries (#1933)

* Use POST in sqllab_viz instead of url params to avoid error with long queries

* Delete error handling

* Fix returning statement
This commit is contained in:
vera-liu
2017-01-11 11:58:16 -08:00
committed by GitHub
parent f0917c62f2
commit a385ee9e97
2 changed files with 15 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import { Alert, Button, Col, Modal } from 'react-bootstrap';
import Select from 'react-select';
import { Table } from 'reactable';
import shortid from 'shortid';
import $ from 'jquery';
const CHART_TYPES = [
{ value: 'dist_bar', label: 'Distribution - Bar Chart', requiresTime: false },
@@ -105,7 +106,17 @@ class VisualizeModal extends React.PureComponent {
sql: this.props.query.sql,
dbId: this.props.query.dbId,
};
window.open('/superset/sqllab_viz/?data=' + JSON.stringify(vizOptions));
$.ajax({
type: 'POST',
url: '/superset/sqllab_viz/',
async: false,
data: {
data: JSON.stringify(vizOptions),
},
success: (url) => {
window.open(url);
},
});
}
changeDatasourceName(event) {
this.setState({ datasourceName: event.target.value });