From c9cfa696ec5fbcfb12a578253f02f82b852a089b Mon Sep 17 00:00:00 2001 From: artemonsh Date: Tue, 7 Feb 2023 15:45:23 +0300 Subject: [PATCH] update EmptyState --- .../src/views/CRUD/welcome/EmptyState.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx index 9427c537dd564..47e7817ae374d 100644 --- a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx +++ b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx @@ -37,6 +37,18 @@ const welcomeTableEmpty: Record = { [WelcomeTable.SavedQueries]: t('No saved queries yet'), }; +const welcomeTableWillAppear: Record 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; @@ -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(