Skip to content

Commit

Permalink
update EmptyState
Browse files Browse the repository at this point in the history
  • Loading branch information
artemonsh committed Feb 7, 2023
1 parent 0ff6141 commit c9cfa69
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ const welcomeTableEmpty: Record<WelcomeTable, string> = {
[WelcomeTable.SavedQueries]: t('No saved queries yet'),
};

const welcomeTableWillAppear: Record<WelcomeTable, (other: string) => string> =
{
[WelcomeTable.Charts]: (other: string) =>
t('%(other)s charts will appear here', { other }),
[WelcomeTable.Dashboards]: (other: string) =>
t('%(other)s dashboards will appear here', { other }),
[WelcomeTable.Recents]: (other: string) =>
t('%(other)s recents will appear here', { other }),
[WelcomeTable.SavedQueries]: (other: string) =>
t('%(other)s saved queries will appear here', { other }),
};

export interface EmptyStateProps {
tableName: WelcomeTable;
tab?: string;
Expand Down Expand Up @@ -97,10 +109,8 @@ export default function EmptyState({
);
}
if (tab === TableTab.Other) {
return t('%(other)s %(tableName)s will appear here', {
other: otherTabTitle || t('Other'),
tableName: tableName.toLowerCase(),
});
const other = otherTabTitle || t('Other');
return welcomeTableWillAppear[tableName](other);
}
if (tab === TableTab.Edited) {
return t(
Expand Down

0 comments on commit c9cfa69

Please sign in to comment.