2022-08-30 02:40:04 -05:00
|
|
|
import React from 'react';
|
|
|
|
import { Redirect } from 'react-router-dom';
|
|
|
|
|
2021-11-19 06:42:26 -06:00
|
|
|
import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport';
|
|
|
|
import { RouteDescriptor } from 'app/core/navigation/types';
|
2022-04-22 08:33:13 -05:00
|
|
|
|
2021-11-19 06:42:26 -06:00
|
|
|
import { PluginAdminRoutes } from './types';
|
|
|
|
|
|
|
|
const DEFAULT_ROUTES = [
|
|
|
|
{
|
|
|
|
path: '/plugins',
|
2022-07-06 10:00:56 -05:00
|
|
|
navId: 'plugins',
|
2021-11-19 06:42:26 -06:00
|
|
|
routeName: PluginAdminRoutes.Home,
|
|
|
|
component: SafeDynamicImport(() => import(/* webpackChunkName: "PluginListPage" */ './pages/Browse')),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/plugins/browse',
|
2022-07-06 10:00:56 -05:00
|
|
|
navId: 'plugins',
|
2021-11-19 06:42:26 -06:00
|
|
|
routeName: PluginAdminRoutes.Browse,
|
|
|
|
component: SafeDynamicImport(() => import(/* webpackChunkName: "PluginListPage" */ './pages/Browse')),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/plugins/:pluginId/',
|
2022-07-06 10:00:56 -05:00
|
|
|
navId: 'plugins',
|
2021-11-19 06:42:26 -06:00
|
|
|
routeName: PluginAdminRoutes.Details,
|
|
|
|
component: SafeDynamicImport(() => import(/* webpackChunkName: "PluginPage" */ './pages/PluginDetails')),
|
|
|
|
},
|
|
|
|
{
|
2022-08-30 02:40:04 -05:00
|
|
|
path: '/admin/plugins/*',
|
2022-07-06 10:00:56 -05:00
|
|
|
navId: 'admin-plugins',
|
2022-08-30 02:40:04 -05:00
|
|
|
component: () => <Redirect to="/plugins" />,
|
2021-11-19 06:42:26 -06:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export function getRoutes(): RouteDescriptor[] {
|
|
|
|
return DEFAULT_ROUTES;
|
|
|
|
}
|