feat: expand new chart data endpoint coverage (#9903)

* feat: implement new chart API for additional components

* Fix python tests

* Fix tests

* Fix lint

* fix camel case error in requestParams

* lint

* fix samples row limit

* Add samples row limit to config

* remove unnecessary code

* lint

* Address review comments
This commit is contained in:
Ville Brofeldt
2020-06-02 10:47:28 +03:00
committed by GitHub
parent c7618ee54b
commit 38a6bd79da
12 changed files with 196 additions and 126 deletions

View File

@@ -18,8 +18,8 @@
*/
/* eslint camelcase: 0 */
import URI from 'urijs';
import { getChartMetadataRegistry } from '@superset-ui/chart';
import { availableDomains } from '../utils/hostNamesConfig';
import { SupersetClient } from '@superset-ui/connection';
import { allowCrossDomain, availableDomains } from '../utils/hostNamesConfig';
import { safeStringify } from '../utils/safeStringify';
const MAX_URL_LENGTH = 8000;
@@ -67,7 +67,9 @@ export function getAnnotationJsonUrl(slice_id, form_data, isNative) {
export function getURIDirectory(endpointType = 'base') {
// Building the directory part of the URI
if (
['json', 'csv', 'query', 'results', 'samples'].indexOf(endpointType) >= 0
['full', 'json', 'csv', 'query', 'results', 'samples'].includes(
endpointType,
)
) {
return '/superset/explore_json/';
}
@@ -107,11 +109,6 @@ export function getExploreLongUrl(
return url;
}
export function shouldUseLegacyApi(formData) {
const { useLegacyApi } = getChartMetadataRegistry().get(formData.viz_type);
return useLegacyApi || false;
}
export function getExploreUrl({
formData,
endpointType = 'base',