sadpandajoe commented on code in PR #35584:
URL: https://github.com/apache/superset/pull/35584#discussion_r2421705049
##########
superset-frontend/src/features/home/ChartTable.tsx:
##########
@@ -132,12 +132,17 @@ function ChartTable({
setLoaded(true);
}, [activeTab]);
- const handleBulkChartExport = (chartsToExport: Chart[]) => {
+ const handleBulkChartExport = async (chartsToExport: Chart[]) => {
const ids = chartsToExport.map(({ id }) => id);
- handleResourceExport('chart', ids, () => {
- setPreparingExport(false);
- });
setPreparingExport(true);
+ try {
+ await handleResourceExport('chart', ids, () => {
+ setPreparingExport(false);
+ });
+ } catch (error) {
Review Comment:
nit: Do we have a test for this? If not we should validate that the toast
message appears and the spinner clears so it's not in an infinite loading state.
##########
superset-frontend/src/features/home/DashboardTable.tsx:
##########
@@ -118,12 +118,17 @@ function DashboardTable({
setLoaded(true);
}, [activeTab]);
- const handleBulkDashboardExport = (dashboardsToExport: Dashboard[]) => {
+ const handleBulkDashboardExport = async (dashboardsToExport: Dashboard[]) =>
{
const ids = dashboardsToExport.map(({ id }) => id);
- handleResourceExport('dashboard', ids, () => {
- setPreparingExport(false);
- });
setPreparingExport(true);
+ try {
+ await handleResourceExport('dashboard', ids, () => {
+ setPreparingExport(false);
+ });
+ } catch (error) {
Review Comment:
nit: Same question as above. Do we have a test that handles this part?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]