mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Auth: Display page not found when the provider is invalid (#92563)
display page not found when the provider is invalid
This commit is contained in:
parent
a9c2c97531
commit
2b70945fda
@ -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<typeof connector>;
|
||||
* 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 <PageNotFound />;
|
||||
}
|
||||
|
||||
const pageNav = getPageNav(config);
|
||||
|
||||
return (
|
||||
<Page
|
||||
navId="authentication"
|
||||
|
Loading…
Reference in New Issue
Block a user