mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 06:01:49 +08:00

* Chore: reduce barrel files * chore: fixes unit test * Chore: reduces barrel files part II * chore: fix import sorting
84 lines
2.6 KiB
TypeScript
84 lines
2.6 KiB
TypeScript
import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport';
|
|
import { RouteDescriptor } from 'app/core/navigation/types';
|
|
import { DashboardRoutes } from 'app/types/dashboard';
|
|
|
|
import { checkRequiredFeatures } from '../GettingStarted/features';
|
|
import { PROVISIONING_URL, CONNECT_URL, GETTING_STARTED_URL } from '../constants';
|
|
|
|
export function getProvisioningRoutes(): RouteDescriptor[] {
|
|
if (!checkRequiredFeatures()) {
|
|
return [
|
|
{
|
|
path: PROVISIONING_URL,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "GettingStartedPage"*/ 'app/features/provisioning/GettingStarted/GettingStartedPage'
|
|
)
|
|
),
|
|
},
|
|
];
|
|
}
|
|
|
|
return [
|
|
{
|
|
path: PROVISIONING_URL,
|
|
component: SafeDynamicImport(
|
|
() => import(/* webpackChunkName: "RepositoryListPage"*/ 'app/features/provisioning/HomePage')
|
|
),
|
|
},
|
|
{
|
|
path: GETTING_STARTED_URL,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "GettingStartedPage"*/ 'app/features/provisioning/GettingStarted/GettingStartedPage'
|
|
)
|
|
),
|
|
},
|
|
{
|
|
path: `${CONNECT_URL}/:type`,
|
|
component: SafeDynamicImport(
|
|
() => import(/* webpackChunkName: "ProvisioningWizardPage"*/ 'app/features/provisioning/Wizard/ConnectPage')
|
|
),
|
|
},
|
|
{
|
|
path: PROVISIONING_URL + '/:name',
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "RepositoryStatusPage"*/ 'app/features/provisioning/Repository/RepositoryStatusPage'
|
|
)
|
|
),
|
|
},
|
|
{
|
|
path: PROVISIONING_URL + '/:name/edit',
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(/* webpackChunkName: "EditRepositoryPage"*/ 'app/features/provisioning/Repository/EditRepositoryPage')
|
|
),
|
|
},
|
|
{
|
|
path: PROVISIONING_URL + '/:name/file/*',
|
|
component: SafeDynamicImport(
|
|
() => import(/* webpackChunkName: "FileStatusPage"*/ 'app/features/provisioning/File/FileStatusPage')
|
|
),
|
|
},
|
|
{
|
|
path: PROVISIONING_URL + '/:name/history/*',
|
|
component: SafeDynamicImport(
|
|
() => import(/* webpackChunkName: "FileHistoryPage"*/ 'app/features/provisioning/File/FileHistoryPage')
|
|
),
|
|
},
|
|
{
|
|
path: PROVISIONING_URL + '/:slug/dashboard/preview/*',
|
|
pageClass: 'page-dashboard',
|
|
routeName: DashboardRoutes.Provisioning,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(/* webpackChunkName: "DashboardScenePage" */ 'app/features/dashboard-scene/pages/DashboardScenePage')
|
|
),
|
|
},
|
|
];
|
|
}
|