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 10:43:30 +00:00
|
|
|
import type { RouteDef } from "../../route-config";
|
2021-09-22 20:27:30 +00:00
|
|
|
|
|
|
|
type IdentityProviderTabs = "settings" | "mappers";
|
2021-07-26 10:43:30 +00:00
|
|
|
|
|
|
|
export type IdentityProviderParams = {
|
|
|
|
realm: string;
|
2021-09-22 20:27:30 +00:00
|
|
|
providerId: string;
|
|
|
|
alias: string;
|
|
|
|
tab: IdentityProviderTabs;
|
2021-07-26 10:43:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const IdentityProviderRoute: RouteDef = {
|
2021-09-22 20:27:30 +00:00
|
|
|
path: "/:realm/identity-providers/:providerId/:alias/:tab",
|
2021-10-29 16:11:06 +00:00
|
|
|
component: lazy(() => import("../add/DetailSettings")),
|
2021-09-22 20:27:30 +00:00
|
|
|
breadcrumb: (t) => t("identity-providers:providerDetails"),
|
2021-07-26 10:43:30 +00:00
|
|
|
access: "manage-identity-providers",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toIdentityProvider = (
|
|
|
|
params: IdentityProviderParams
|
2022-08-19 18:05:09 +00:00
|
|
|
): Partial<Path> => ({
|
2021-07-26 10:43:30 +00:00
|
|
|
pathname: generatePath(IdentityProviderRoute.path, params),
|
|
|
|
});
|