2021-10-29 16:11:06 +00:00
|
|
|
import { lazy } from "react";
|
2023-01-18 12:09:49 +00:00
|
|
|
import type { Path } from "react-router-dom";
|
2023-10-17 07:36:26 +00:00
|
|
|
import { generateEncodedPath } from "../../utils/generateEncodedPath";
|
2023-03-27 14:10:48 +00:00
|
|
|
import type { AppRouteObject } from "../../routes";
|
2021-07-23 16:29:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2023-03-24 14:37:24 +00:00
|
|
|
const RealmSettingsSection = lazy(() => import("../RealmSettingsSection"));
|
|
|
|
|
2023-03-27 14:10:48 +00:00
|
|
|
export const RealmSettingsRoute: AppRouteObject = {
|
2022-08-22 14:29:35 +00:00
|
|
|
path: "/:realm/realm-settings",
|
2023-03-24 14:37:24 +00:00
|
|
|
element: <RealmSettingsSection />,
|
2021-07-23 16:29:10 +00:00
|
|
|
breadcrumb: (t) => t("realmSettings"),
|
2023-03-27 00:31:23 +00:00
|
|
|
handle: {
|
|
|
|
access: "view-realm",
|
|
|
|
},
|
2021-07-23 16:29:10 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 14:10:48 +00:00
|
|
|
export const RealmSettingsRouteWithTab: AppRouteObject = {
|
2022-08-22 14:29:35 +00:00
|
|
|
...RealmSettingsRoute,
|
|
|
|
path: "/:realm/realm-settings/:tab",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toRealmSettings = (params: RealmSettingsParams): Partial<Path> => {
|
|
|
|
const path = params.tab
|
|
|
|
? RealmSettingsRouteWithTab.path
|
|
|
|
: RealmSettingsRoute.path;
|
|
|
|
|
|
|
|
return {
|
2023-10-17 07:36:26 +00:00
|
|
|
pathname: generateEncodedPath(path, params),
|
2022-08-22 14:29:35 +00:00
|
|
|
};
|
|
|
|
};
|