keycloak-scim/src/realm-settings/routes/RealmSettings.ts

39 lines
895 B
TypeScript
Raw Normal View History

2021-10-29 16:11:06 +00:00
import { lazy } from "react";
import { generatePath } from "react-router-dom";
import type { Path } from "react-router-dom-v5-compat";
import type { RouteDef } from "../../route-config";
export type RealmSettingsTab =
| "general"
| "login"
| "email"
| "themes"
| "keys"
| "events"
| "localization"
2022-06-22 11:35:10 +00:00
| "security-defenses"
| "sessions"
| "tokens"
2022-06-22 11:35:10 +00:00
| "client-policies"
| "user-profile"
| "user-registration";
export type RealmSettingsParams = {
realm: string;
tab?: RealmSettingsTab;
};
export const RealmSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/:tab?",
2021-10-29 16:11:06 +00:00
component: lazy(() => import("../RealmSettingsSection")),
breadcrumb: (t) => t("realmSettings"),
access: "view-realm",
legacy: true,
};
export const toRealmSettings = (
params: RealmSettingsParams
): Partial<Path> => ({
pathname: generatePath(RealmSettingsRoute.path, params),
});