michael-s-molina commented on code in PR #30016:
URL: https://github.com/apache/superset/pull/30016#discussion_r1750211263
##########
superset-frontend/src/pages/DatabaseList/index.tsx:
##########
@@ -609,20 +608,160 @@ function DatabaseList({
description={
<>
<p>
+ {t('The database')}{' '}
+ <b>{databaseCurrentlyDeleting.database_name}</b>{' '}
{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,
)}
</p>
+ {databaseCurrentlyDeleting.dashboards.count >= 1 && (
+ <>
+ <h4>{t('Affected Dashboards')}</h4>
+ <ul>
+ {databaseCurrentlyDeleting.dashboards.result
+ .slice(0, 10)
+ .map(
+ (
+ result: { id: number; title: string },
+ index: number,
+ ) => (
+ <li key={result.id}>
+ <a
+ href={`/superset/dashboard/${result.id}`}
+ target="_atRiskItem"
+ >
+ {result.title}
+ </a>
+ </li>
+ ),
+ )}
+ {databaseCurrentlyDeleting.dashboards.result.length >
+ 10 && (
+ <li>
+ {t(
+ '... and %s others',
+ databaseCurrentlyDeleting.dashboards.result.length -
+ 10,
+ )}
+ </li>
+ )}
+ </ul>
+ </>
+ )}
+ {databaseCurrentlyDeleting.charts.count >= 1 && (
+ <>
+ <h4>{t('Affected Charts')}</h4>
+ <ul>
+ {databaseCurrentlyDeleting.charts.result.slice(0, 10).map(
+ (
+ result: {
+ id: number;
+ slice_name: string;
+ },
+ index: number,
+ ) => (
+ <li key={result.id}>
+ <a
+ href={`/explore/?slice_id=${result.id}`}
+ target="_atRiskItem"
+ >
+ {result.slice_name}
+ </a>
+ </li>
+ ),
+ )}
+ {databaseCurrentlyDeleting.charts.result.length > 10 && (
+ <li>
+ {t(
+ '... and %s others',
+ databaseCurrentlyDeleting.charts.result.length - 10,
+ )}
+ </li>
+ )}
+ </ul>
+ </>
+ )}
{DatabaseDeleteRelatedExtension && (
<DatabaseDeleteRelatedExtension
database={databaseCurrentlyDeleting}
/>
)}
</>
+ /*
Review Comment:
Did you forget to remove this commented code?
--
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]