mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 04:41:50 +08:00

* Chore: reduce barrel files * chore: fixes unit test * Chore: reduces barrel files part II * chore: fix import sorting
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { DashboardRoutes } from 'app/types/dashboard';
|
|
|
|
import { SafeDynamicImport } from '../../core/components/DynamicImports/SafeDynamicImport';
|
|
import { config } from '../../core/config';
|
|
import { RouteDescriptor } from '../../core/navigation/types';
|
|
|
|
export const getPublicDashboardRoutes = (): RouteDescriptor[] => {
|
|
if (!config.publicDashboardsEnabled) {
|
|
return [];
|
|
}
|
|
|
|
return [
|
|
{
|
|
path: '/dashboard/public',
|
|
pageClass: 'page-dashboard',
|
|
routeName: DashboardRoutes.Public,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "ListPublicDashboardPage" */ '../../features/manage-dashboards/PublicDashboardListPage'
|
|
)
|
|
),
|
|
},
|
|
{
|
|
path: '/public-dashboards/:accessToken',
|
|
pageClass: 'page-dashboard',
|
|
routeName: DashboardRoutes.Public,
|
|
chromeless: true,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "PublicDashboardPage" */ '../../features/dashboard/containers/PublicDashboardPageProxy'
|
|
)
|
|
),
|
|
},
|
|
];
|
|
};
|