2021-08-26 08:39:35 +00:00
|
|
|
import type { AccessType } from "@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation";
|
2023-01-18 12:09:49 +00:00
|
|
|
import type { TFunction } from "i18next";
|
2023-03-24 14:37:24 +00:00
|
|
|
import type { ComponentType } from "react";
|
2023-07-11 16:06:54 +00:00
|
|
|
import type { NonIndexRouteObject, RouteObject } from "react-router-dom";
|
2023-01-18 12:09:49 +00:00
|
|
|
|
2023-03-27 16:34:53 +00:00
|
|
|
import { App } from "./App";
|
|
|
|
import { PageNotFoundSection } from "./PageNotFoundSection";
|
2021-07-22 10:17:53 +00:00
|
|
|
import authenticationRoutes from "./authentication/routes";
|
2021-07-22 11:17:00 +00:00
|
|
|
import clientScopesRoutes from "./client-scopes/routes";
|
2021-07-21 15:08:40 +00:00
|
|
|
import clientRoutes from "./clients/routes";
|
2021-07-26 13:36:18 +00:00
|
|
|
import dashboardRoutes from "./dashboard/routes";
|
2021-07-23 14:41:42 +00:00
|
|
|
import eventRoutes from "./events/routes";
|
2021-07-26 13:40:23 +00:00
|
|
|
import groupsRoutes from "./groups/routes";
|
2021-07-26 10:43:30 +00:00
|
|
|
import identityProviders from "./identity-providers/routes";
|
2021-07-22 14:18:59 +00:00
|
|
|
import realmRoleRoutes from "./realm-roles/routes";
|
2021-07-23 16:29:10 +00:00
|
|
|
import realmSettingRoutes from "./realm-settings/routes";
|
2021-07-22 07:13:35 +00:00
|
|
|
import realmRoutes from "./realm/routes";
|
2021-07-23 10:52:08 +00:00
|
|
|
import sessionRoutes from "./sessions/routes";
|
2021-07-26 13:29:26 +00:00
|
|
|
import userFederationRoutes from "./user-federation/routes";
|
2021-07-23 10:18:28 +00:00
|
|
|
import userRoutes from "./user/routes";
|
2020-10-21 11:31:41 +00:00
|
|
|
|
2023-03-27 14:10:48 +00:00
|
|
|
export type AppRouteObjectHandle = {
|
2023-03-27 00:31:23 +00:00
|
|
|
access: AccessType | AccessType[];
|
|
|
|
};
|
|
|
|
|
2023-03-27 14:10:48 +00:00
|
|
|
export interface AppRouteObject extends NonIndexRouteObject {
|
2021-07-21 09:20:32 +00:00
|
|
|
path: string;
|
2021-07-22 14:48:00 +00:00
|
|
|
breadcrumb?: (t: TFunction) => string | ComponentType<any>;
|
2023-03-27 14:10:48 +00:00
|
|
|
handle: AppRouteObjectHandle;
|
|
|
|
}
|
2020-10-21 11:31:41 +00:00
|
|
|
|
2023-03-27 16:34:53 +00:00
|
|
|
export const NotFoundRoute: AppRouteObject = {
|
2021-07-26 13:40:23 +00:00
|
|
|
path: "*",
|
2023-03-24 14:37:24 +00:00
|
|
|
element: <PageNotFoundSection />,
|
2023-03-27 00:31:23 +00:00
|
|
|
handle: {
|
|
|
|
access: "anyone",
|
|
|
|
},
|
2021-07-26 13:40:23 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 14:10:48 +00:00
|
|
|
export const routes: AppRouteObject[] = [
|
2021-07-22 10:17:53 +00:00
|
|
|
...authenticationRoutes,
|
2021-07-21 15:08:40 +00:00
|
|
|
...clientRoutes,
|
2021-07-22 11:17:00 +00:00
|
|
|
...clientScopesRoutes,
|
2021-07-23 14:41:42 +00:00
|
|
|
...eventRoutes,
|
2021-07-26 10:43:30 +00:00
|
|
|
...identityProviders,
|
2021-07-22 14:18:59 +00:00
|
|
|
...realmRoleRoutes,
|
2021-07-22 07:13:35 +00:00
|
|
|
...realmRoutes,
|
2021-07-23 16:29:10 +00:00
|
|
|
...realmSettingRoutes,
|
2021-07-23 10:52:08 +00:00
|
|
|
...sessionRoutes,
|
2021-07-26 13:29:26 +00:00
|
|
|
...userFederationRoutes,
|
2021-07-23 10:18:28 +00:00
|
|
|
...userRoutes,
|
2021-07-26 13:40:23 +00:00
|
|
|
...groupsRoutes,
|
2022-04-28 13:36:43 +00:00
|
|
|
...dashboardRoutes,
|
2021-07-26 13:40:23 +00:00
|
|
|
NotFoundRoute,
|
2020-10-01 14:25:29 +00:00
|
|
|
];
|
2023-03-27 16:34:53 +00:00
|
|
|
|
|
|
|
export const RootRoute: RouteObject = {
|
|
|
|
path: "/",
|
2023-05-03 11:27:27 +00:00
|
|
|
element: <App />,
|
2023-03-27 16:34:53 +00:00
|
|
|
children: routes,
|
|
|
|
};
|