diff --git a/superset-frontend/src/pages/DatabaseList/index.tsx b/superset-frontend/src/pages/DatabaseList/index.tsx index 1d29cbc567b..0021cdc2cbd 100644 --- a/superset-frontend/src/pages/DatabaseList/index.tsx +++ b/superset-frontend/src/pages/DatabaseList/index.tsx @@ -65,8 +65,8 @@ const dbConfigExtraExtension = extensionsRegistry.get( const PAGE_SIZE = 25; interface DatabaseDeleteObject extends DatabaseObject { - chart_count: number; - dashboard_count: number; + charts: any; + dashboards: any; sqllab_tab_count: number; } interface DatabaseListProps { @@ -170,8 +170,8 @@ function DatabaseList({ .then(({ json = {} }) => { setDatabaseCurrentlyDeleting({ ...database, - chart_count: json.charts.count, - dashboard_count: json.dashboards.count, + charts: json.charts, + dashboards: json.dashboards, sqllab_tab_count: json.sqllab_tab_states.count, }); }) @@ -609,14 +609,62 @@ function DatabaseList({ description={ <>

+ {t('The database')} + {databaseCurrentlyDeleting.database_name} {t( - 'The database %s is linked to %s charts that appear on %s dashboards and users have %s SQL Lab tabs using this database open. Are you sure you want to continue? Deleting the database will break those objects.', - databaseCurrentlyDeleting.database_name, - databaseCurrentlyDeleting.chart_count, - databaseCurrentlyDeleting.dashboard_count, + 'is linked to %s charts that appear on %s dashboards and users have %s SQL Lab tabs using this database open. Are you sure you want to continue? Deleting the database will break those objects.', + databaseCurrentlyDeleting.charts.count, + databaseCurrentlyDeleting.dashboards.count, databaseCurrentlyDeleting.sqllab_tab_count, )}

+ {databaseCurrentlyDeleting.dashboards.count >= 1 && ( + <> +

{t('Affected Dashboards')}

+ + + )} + {databaseCurrentlyDeleting.charts.count >= 1 && ( + <> +

{t('Affected Charts')}

+ + + )} {DatabaseDeleteRelatedExtension && (