|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
import { Redirect, RouteComponentProps } from 'react-router-dom'; |
|
|
|
|
import { Navigate, useParams } from 'react-router-dom-v5-compat'; |
|
|
|
|
|
|
|
|
|
import { isTruthy } from '@grafana/data'; |
|
|
|
|
import { NavLandingPage } from 'app/core/components/NavLandingPage/NavLandingPage'; |
|
|
|
@ -107,23 +107,19 @@ export function getAppRoutes(): RouteDescriptor[] { |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: DATASOURCES_ROUTES.List, |
|
|
|
|
component: () => <Redirect to={CONNECTIONS_ROUTES.DataSources} />, |
|
|
|
|
component: () => <Navigate replace to={CONNECTIONS_ROUTES.DataSources} />, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: DATASOURCES_ROUTES.Edit, |
|
|
|
|
component: (props: RouteComponentProps<{ uid: string }>) => ( |
|
|
|
|
<Redirect to={CONNECTIONS_ROUTES.DataSourcesEdit.replace(':uid', props.match.params.uid)} /> |
|
|
|
|
), |
|
|
|
|
component: DataSourceEditRoute, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: DATASOURCES_ROUTES.Dashboards, |
|
|
|
|
component: (props: RouteComponentProps<{ uid: string }>) => ( |
|
|
|
|
<Redirect to={CONNECTIONS_ROUTES.DataSourcesDashboards.replace(':uid', props.match.params.uid)} /> |
|
|
|
|
), |
|
|
|
|
component: DataSourceDashboardRoute, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: DATASOURCES_ROUTES.New, |
|
|
|
|
component: () => <Redirect to={CONNECTIONS_ROUTES.DataSourcesNew} />, |
|
|
|
|
component: () => <Navigate replace to={CONNECTIONS_ROUTES.DataSourcesNew} />, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/datasources/correlations', |
|
|
|
@ -219,7 +215,7 @@ export function getAppRoutes(): RouteDescriptor[] { |
|
|
|
|
{ |
|
|
|
|
path: '/org/users', |
|
|
|
|
// Org users page has been combined with admin users
|
|
|
|
|
component: () => <Redirect to={'/admin/users'} />, |
|
|
|
|
component: () => <Navigate replace to={'/admin/users'} />, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/org/users/invite', |
|
|
|
@ -292,7 +288,7 @@ export function getAppRoutes(): RouteDescriptor[] { |
|
|
|
|
() => |
|
|
|
|
import(/* webpackChunkName: "AdminAuthentication" */ '../features/auth-config/AuthProvidersListPage') |
|
|
|
|
) |
|
|
|
|
: () => <Redirect to="/admin" />, |
|
|
|
|
: () => <Navigate replace to="/admin" />, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/admin/authentication/ldap', |
|
|
|
@ -309,7 +305,7 @@ export function getAppRoutes(): RouteDescriptor[] { |
|
|
|
|
? SafeDynamicImport( |
|
|
|
|
() => import(/* webpackChunkName: "AdminAuthentication" */ '../features/auth-config/ProviderConfigPage') |
|
|
|
|
) |
|
|
|
|
: () => <Redirect to="/admin" />, |
|
|
|
|
: () => <Navigate replace to="/admin" />, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/admin/settings', |
|
|
|
@ -357,7 +353,7 @@ export function getAppRoutes(): RouteDescriptor[] { |
|
|
|
|
? SafeDynamicImport( |
|
|
|
|
() => import(/* webpackChunkName: "AdminFeatureTogglesPage" */ 'app/features/admin/AdminFeatureTogglesPage') |
|
|
|
|
) |
|
|
|
|
: () => <Redirect to="/admin" />, |
|
|
|
|
: () => <Navigate replace to="/admin" />, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/admin/storage/:path*', |
|
|
|
@ -398,7 +394,7 @@ export function getAppRoutes(): RouteDescriptor[] { |
|
|
|
|
{ |
|
|
|
|
path: '/verify', |
|
|
|
|
component: !config.verifyEmailEnabled |
|
|
|
|
? () => <Redirect to="/signup" /> |
|
|
|
|
? () => <Navigate replace to="/signup" /> |
|
|
|
|
: SafeDynamicImport( |
|
|
|
|
() => import(/* webpackChunkName "VerifyEmailPage"*/ 'app/core/components/Signup/VerifyEmailPage') |
|
|
|
|
), |
|
|
|
@ -408,7 +404,7 @@ export function getAppRoutes(): RouteDescriptor[] { |
|
|
|
|
{ |
|
|
|
|
path: '/signup', |
|
|
|
|
component: config.disableUserSignUp |
|
|
|
|
? () => <Redirect to="/login" /> |
|
|
|
|
? () => <Navigate replace to="/login" /> |
|
|
|
|
: SafeDynamicImport(() => import(/* webpackChunkName "SignupPage"*/ 'app/core/components/Signup/SignupPage')), |
|
|
|
|
pageClass: 'login-page', |
|
|
|
|
chromeless: true, |
|
|
|
@ -556,3 +552,13 @@ export function getSupportBundleRoutes(cfg = config): RouteDescriptor[] { |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DataSourceDashboardRoute() { |
|
|
|
|
const { uid = '' } = useParams(); |
|
|
|
|
return <Navigate replace to={CONNECTIONS_ROUTES.DataSourcesDashboards.replace(':uid', uid)} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DataSourceEditRoute() { |
|
|
|
|
const { uid = '' } = useParams(); |
|
|
|
|
return <Navigate replace to={CONNECTIONS_ROUTES.DataSourcesEdit.replace(':uid', uid)} />; |
|
|
|
|
} |
|
|
|
|