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:
Bogdan
2020-04-10 14:46:46 -07:00
committed by GitHub
parent a8ce3bccdf
commit 02b3fb1d63
12 changed files with 505 additions and 43 deletions

View File

@@ -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));
});
};
}