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