2021-05-04 17:58:18 +00:00
|
|
|
import type { TFunction } from "i18next";
|
|
|
|
import type { AccessType } from "keycloak-admin/lib/defs/whoAmIRepresentation";
|
2021-07-21 09:20:32 +00:00
|
|
|
import type { ComponentType } from "react";
|
|
|
|
import type { MatchOptions } from "use-react-router-breadcrumbs";
|
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-21 09:20:32 +00:00
|
|
|
import { DashboardSection } from "./dashboard/Dashboard";
|
2021-07-23 14:41:42 +00:00
|
|
|
import eventRoutes from "./events/routes";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { GroupsSection } from "./groups/GroupsSection";
|
2021-07-21 09:20:32 +00:00
|
|
|
import { SearchGroups } from "./groups/SearchGroups";
|
2021-07-26 10:43:30 +00:00
|
|
|
import identityProviders from "./identity-providers/routes";
|
2020-10-01 14:25:29 +00:00
|
|
|
import { PageNotFoundSection } from "./PageNotFoundSection";
|
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
|
|
|
|
2021-07-21 09:20:32 +00:00
|
|
|
export type RouteDef = {
|
|
|
|
path: string;
|
|
|
|
component: ComponentType;
|
2021-07-22 14:48:00 +00:00
|
|
|
breadcrumb?: (t: TFunction) => string | ComponentType<any>;
|
2020-10-21 11:31:41 +00:00
|
|
|
access: AccessType;
|
2021-07-21 09:20:32 +00:00
|
|
|
matchOptions?: MatchOptions;
|
2020-10-21 11:31:41 +00:00
|
|
|
};
|
|
|
|
|
2021-07-21 09:20:32 +00:00
|
|
|
export const routes: RouteDef[] = [
|
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-01-05 19:49:33 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/",
|
2021-01-15 01:44:16 +00:00
|
|
|
component: DashboardSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:home"),
|
2021-01-05 19:49:33 +00:00
|
|
|
access: "anyone",
|
|
|
|
},
|
2021-03-01 15:06:04 +00:00
|
|
|
{
|
|
|
|
path: "/:realm/groups/search",
|
|
|
|
component: SearchGroups,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("groups:searchGroups"),
|
2021-03-01 15:06:04 +00:00
|
|
|
access: "query-groups",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/:realm/groups",
|
|
|
|
component: GroupsSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
access: "query-groups",
|
2021-03-01 15:06:04 +00:00
|
|
|
matchOptions: {
|
|
|
|
exact: false,
|
|
|
|
},
|
|
|
|
},
|
2020-10-01 14:25:29 +00:00
|
|
|
{
|
|
|
|
path: "/",
|
2021-01-15 01:44:16 +00:00
|
|
|
component: DashboardSection,
|
2021-07-21 09:20:32 +00:00
|
|
|
breadcrumb: (t) => t("common:home"),
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "anyone",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
{
|
2020-11-12 18:59:23 +00:00
|
|
|
path: "*",
|
2020-10-01 14:25:29 +00:00
|
|
|
component: PageNotFoundSection,
|
2020-10-21 11:31:41 +00:00
|
|
|
access: "anyone",
|
2020-10-01 14:25:29 +00:00
|
|
|
},
|
|
|
|
];
|