mirror of
https://github.com/apache/superset.git
synced 2026-05-12 11:25:56 +00:00
fix(embedded): CSV download for chart (#20261)
* move postForm to superset client * lint * fix lint * fix type * update tests * add tests * add test for form submit * add test for request form * lint * fix test * fix tests * more tests * more tests * test * lint * more test for postForm * lint * Update superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com> * update tests * remove useless test * make test cover happy * make test cover happy * make test cover happy * make codecov happy * make codecov happy Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,13 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { t, styled, withTheme, DatasourceType } from '@superset-ui/core';
|
||||
import {
|
||||
DatasourceType,
|
||||
SupersetClient,
|
||||
styled,
|
||||
t,
|
||||
withTheme,
|
||||
} from '@superset-ui/core';
|
||||
import { getUrlParam } from 'src/utils/urlUtils';
|
||||
|
||||
import { AntdDropdown } from 'src/components';
|
||||
@@ -30,13 +36,13 @@ import {
|
||||
ChangeDatasourceModal,
|
||||
DatasourceModal,
|
||||
} from 'src/components/Datasource';
|
||||
import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal';
|
||||
import { postForm } from 'src/explore/exploreUtils';
|
||||
import Button from 'src/components/Button';
|
||||
import ErrorAlert from 'src/components/ErrorMessage/ErrorAlert';
|
||||
import WarningIconWithTooltip from 'src/components/WarningIconWithTooltip';
|
||||
import { URL_PARAMS } from 'src/constants';
|
||||
import { isUserAdmin } from 'src/dashboard/util/findPermission';
|
||||
import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal';
|
||||
import { safeStringify } from 'src/utils/safeStringify';
|
||||
|
||||
const propTypes = {
|
||||
actions: PropTypes.object.isRequired,
|
||||
@@ -193,7 +199,9 @@ class DatasourceControl extends React.PureComponent {
|
||||
datasourceKey: `${datasource.id}__${datasource.type}`,
|
||||
sql: datasource.sql,
|
||||
};
|
||||
postForm('/superset/sqllab/', payload);
|
||||
SupersetClient.postForm('/superset/sqllab/', {
|
||||
form_data: safeStringify(payload),
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user