mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Add visualization flow to the CTA queries (#9370)
* Visualize after running Ctas query (#4) * Visualize after running Ctas query. Stub for table viz Work on the viz Add JS functionality for Ctas viz Add test for the table viz flow Fix test Add js test for the ctas viz * Fix tests * Resolve comments * Leverate tmpSchema in the query object * Fix i18n string Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
This commit is contained in:
@@ -1249,3 +1249,23 @@ export function createDatasource(vizOptions) {
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function createCtasDatasource(vizOptions) {
|
||||
return dispatch => {
|
||||
dispatch(createDatasourceStarted());
|
||||
return SupersetClient.post({
|
||||
endpoint: '/superset/get_or_create_table/',
|
||||
postPayload: { data: vizOptions },
|
||||
})
|
||||
.then(({ json }) => {
|
||||
dispatch(createDatasourceSuccess(json));
|
||||
|
||||
return json;
|
||||
})
|
||||
.catch(() => {
|
||||
const errorMsg = t('An error occurred while creating the data source');
|
||||
dispatch(createDatasourceFailed(errorMsg));
|
||||
return Promise.reject(new Error(errorMsg));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user