2021-10-29 16:11:06 +00:00
|
|
|
import { lazy } from "react";
|
2022-08-19 18:05:09 +00:00
|
|
|
import type { Path } from "react-router-dom-v5-compat";
|
|
|
|
import { generatePath } from "react-router-dom-v5-compat";
|
2021-07-26 13:29:26 +00:00
|
|
|
import type { RouteDef } from "../../route-config";
|
|
|
|
|
|
|
|
export type NewLdapUserFederationParams = { realm: string };
|
|
|
|
|
|
|
|
export const NewLdapUserFederationRoute: RouteDef = {
|
|
|
|
path: "/:realm/user-federation/ldap/new",
|
2021-10-29 16:11:06 +00:00
|
|
|
component: lazy(() => import("../UserFederationLdapSettings")),
|
2022-01-05 17:06:53 +00:00
|
|
|
breadcrumb: (t) =>
|
|
|
|
t("user-federation:addProvider", { provider: "LDAP", count: 1 }),
|
2021-07-26 13:29:26 +00:00
|
|
|
access: "view-realm",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toNewLdapUserFederation = (
|
|
|
|
params: NewLdapUserFederationParams
|
2022-08-19 18:05:09 +00:00
|
|
|
): Partial<Path> => ({
|
2021-07-26 13:29:26 +00:00
|
|
|
pathname: generatePath(NewLdapUserFederationRoute.path, params),
|
|
|
|
});
|