mirror of
https://github.com/apache/superset.git
synced 2026-04-24 10:35:01 +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:
@@ -27,7 +27,6 @@ import {
|
||||
getExploreUrl,
|
||||
getLegacyEndpointType,
|
||||
buildV1ChartDataPayload,
|
||||
postForm,
|
||||
shouldUseLegacyApi,
|
||||
getChartDataUri,
|
||||
} from 'src/explore/exploreUtils';
|
||||
@@ -40,6 +39,7 @@ import { addDangerToast } from 'src/components/MessageToasts/actions';
|
||||
import { logEvent } from 'src/logger/actions';
|
||||
import { Logger, LOG_ACTIONS_LOAD_CHART } from 'src/logger/LogUtils';
|
||||
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
||||
import { safeStringify } from 'src/utils/safeStringify';
|
||||
import { allowCrossDomain as domainShardingEnabled } from 'src/utils/hostNamesConfig';
|
||||
import { updateDataMask } from 'src/dataMask/actions';
|
||||
import { waitForAsyncData } from 'src/middleware/asyncEvent';
|
||||
@@ -563,7 +563,9 @@ export function redirectSQLLab(formData) {
|
||||
datasourceKey: formData.datasource,
|
||||
sql: json.result[0].query,
|
||||
};
|
||||
postForm(redirectUrl, payload);
|
||||
SupersetClient.postForm(redirectUrl, {
|
||||
form_data: safeStringify(payload),
|
||||
});
|
||||
})
|
||||
.catch(() =>
|
||||
dispatch(addDangerToast(t('An error occurred while loading the SQL'))),
|
||||
|
||||
Reference in New Issue
Block a user