diff --git a/public/app/features/auth-config/ProviderConfigPage.tsx b/public/app/features/auth-config/ProviderConfigPage.tsx index 12aef8a2cab..82f3ec5072b 100644 --- a/public/app/features/auth-config/ProviderConfigPage.tsx +++ b/public/app/features/auth-config/ProviderConfigPage.tsx @@ -6,6 +6,7 @@ import { Badge, Stack, Text } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { GrafanaRouteComponentProps } from 'app/core/navigation/types'; +import { PageNotFound } from '../../core/components/PageNotFound/PageNotFound'; import { StoreState } from '../../types'; import { ProviderConfigForm } from './ProviderConfigForm'; @@ -57,15 +58,16 @@ export type Props = ConnectedProps; * Separate the Page logic from the Content logic for easier testing. */ export const ProviderConfigPage = ({ config, loadProviders, isLoading, provider }: Props) => { - const pageNav = getPageNav(config); - useEffect(() => { loadProviders(provider); }, [loadProviders, provider]); - if (!config) { - return null; + if (!config || !config.provider || !UIMap[config.provider]) { + return ; } + + const pageNav = getPageNav(config); + return (