mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
[Explore view] Use POST method for charting requests (#3993)
* [Explore view] Use POST method for charting requests * fix per code review comments * more code review fixes * code review fix: remove duplicated calls for getting values from request * [Explore view] Use POST method for charting requests * fix per code review comments * more code review fixes * code review fix: remove duplicated calls for getting values from request
This commit is contained in:
@@ -7,6 +7,7 @@ import sql from 'react-syntax-highlighter/dist/languages/sql';
|
||||
import json from 'react-syntax-highlighter/dist/languages/json';
|
||||
import github from 'react-syntax-highlighter/dist/styles/github';
|
||||
import CopyToClipboard from './../../components/CopyToClipboard';
|
||||
import { getExploreUrlAndPayload } from '../exploreUtils';
|
||||
|
||||
import ModalTrigger from './../../components/ModalTrigger';
|
||||
import Button from '../../components/Button';
|
||||
@@ -23,7 +24,7 @@ const propTypes = {
|
||||
animation: PropTypes.bool,
|
||||
queryResponse: PropTypes.object,
|
||||
chartStatus: PropTypes.string,
|
||||
queryEndpoint: PropTypes.string.isRequired,
|
||||
latestQueryFormData: PropTypes.object.isRequired,
|
||||
};
|
||||
const defaultProps = {
|
||||
animation: true,
|
||||
@@ -51,9 +52,16 @@ export default class DisplayQueryButton extends React.PureComponent {
|
||||
}
|
||||
fetchQuery() {
|
||||
this.setState({ isLoading: true });
|
||||
const { url, payload } = getExploreUrlAndPayload({
|
||||
formData: this.props.latestQueryFormData,
|
||||
endpointType: 'query',
|
||||
});
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: this.props.queryEndpoint,
|
||||
type: 'POST',
|
||||
url,
|
||||
data: {
|
||||
form_data: JSON.stringify(payload),
|
||||
},
|
||||
success: (data) => {
|
||||
this.setState({
|
||||
language: data.language,
|
||||
|
||||
Reference in New Issue
Block a user