From 40c148ba48adc4f8f5fd806e25a7111d1519f428 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Fri, 12 Apr 2024 10:08:14 +0100 Subject: [PATCH] EmptyState: Provide custom messages for existing empty states (#86021) provide custom messages for existing empty states --- .../app/features/admin/UserListAdminPage.tsx | 3 +- public/app/features/api-keys/ApiKeysPage.tsx | 3 +- .../commandPalette/CommandPalette.tsx | 2 +- .../components/DataSourcesList.tsx | 3 +- .../plugins/admin/components/PluginList.tsx | 3 +- .../ServiceAccountsListPage.tsx | 8 ++++- public/app/features/teams/TeamList.tsx | 3 +- public/locales/en-US/grafana.json | 33 +++++++++++++++++++ public/locales/pseudo-LOCALE/grafana.json | 33 +++++++++++++++++++ 9 files changed, 84 insertions(+), 7 deletions(-) diff --git a/public/app/features/admin/UserListAdminPage.tsx b/public/app/features/admin/UserListAdminPage.tsx index 8b9c42b211c..6fbbc543a56 100644 --- a/public/app/features/admin/UserListAdminPage.tsx +++ b/public/app/features/admin/UserListAdminPage.tsx @@ -7,6 +7,7 @@ import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { LinkButton, RadioButtonGroup, useStyles2, FilterInput, EmptyState } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; +import { t } from 'app/core/internationalization'; import { AccessControlAction, StoreState, UserFilter } from '../../types'; @@ -99,7 +100,7 @@ const UserListAdminPageUnConnected = ({ {!isLoading && users.length === 0 ? ( - + ) : ( { onDelete={this.onDeleteApiKey} /> ) : ( - + )} {migrationResult && ( diff --git a/public/app/features/commandPalette/CommandPalette.tsx b/public/app/features/commandPalette/CommandPalette.tsx index e6eb57ed7ab..a1e36d3a20b 100644 --- a/public/app/features/commandPalette/CommandPalette.tsx +++ b/public/app/features/commandPalette/CommandPalette.tsx @@ -121,7 +121,7 @@ const RenderResults = ({ isFetchingSearchResults, searchResults }: RenderResults const showEmptyState = !isFetchingSearchResults && items.length === 0; return showEmptyState ? ( - + ) : ( + ) : (
    {getDataSourcesList()}
)} diff --git a/public/app/features/plugins/admin/components/PluginList.tsx b/public/app/features/plugins/admin/components/PluginList.tsx index 587c324a043..76ad72cc2b4 100644 --- a/public/app/features/plugins/admin/components/PluginList.tsx +++ b/public/app/features/plugins/admin/components/PluginList.tsx @@ -3,6 +3,7 @@ import { useLocation } from 'react-router-dom'; import { config } from '@grafana/runtime'; import { EmptyState, Grid } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { CatalogPlugin, PluginListDisplayMode } from '../types'; @@ -20,7 +21,7 @@ export const PluginList = ({ plugins, displayMode, isLoading }: Props) => { const pathName = config.appSubUrl + (pathname.endsWith('/') ? pathname.slice(0, -1) : pathname); if (!isLoading && plugins.length === 0) { - return ; + return ; } return ( diff --git a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx index bc51b94d918..03b8b3a290a 100644 --- a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx @@ -8,6 +8,7 @@ import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA'; import { Page } from 'app/core/components/Page/Page'; import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; +import { t } from 'app/core/internationalization'; import { StoreState, ServiceAccountDTO, AccessControlAction, ServiceAccountStateFilter } from 'app/types'; import { ServiceAccountTable } from './ServiceAccountTable'; @@ -209,7 +210,12 @@ export const ServiceAccountsListPageUnconnected = ({ /> - {!isLoading && !noServiceAccountsCreated && serviceAccounts.length === 0 && } + {!isLoading && !noServiceAccountsCreated && serviceAccounts.length === 0 && ( + + )} {!isLoading && noServiceAccountsCreated && ( <> {hasFetched && teams.length === 0 ? ( - + ) : (