mirror of
https://github.com/apache/superset.git
synced 2026-04-28 04:25:07 +00:00
feat(sqllab): SPA migration (#25151)
This commit is contained in:
@@ -39,7 +39,6 @@ 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';
|
||||
@@ -571,17 +570,20 @@ export function postChartFormData(
|
||||
);
|
||||
}
|
||||
|
||||
export function redirectSQLLab(formData) {
|
||||
export function redirectSQLLab(formData, history) {
|
||||
return dispatch => {
|
||||
getChartDataRequest({ formData, resultFormat: 'json', resultType: 'query' })
|
||||
.then(({ json }) => {
|
||||
const redirectUrl = '/superset/sqllab/';
|
||||
const redirectUrl = '/sqllab/';
|
||||
const payload = {
|
||||
datasourceKey: formData.datasource,
|
||||
sql: json.result[0].query,
|
||||
};
|
||||
SupersetClient.postForm(redirectUrl, {
|
||||
form_data: safeStringify(payload),
|
||||
history.push({
|
||||
pathname: redirectUrl,
|
||||
state: {
|
||||
requestedQuery: payload,
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() =>
|
||||
|
||||
Reference in New Issue
Block a user