2021-07-26 10:43:30 +00:00
|
|
|
import type { LocationDescriptorObject } from "history";
|
2021-10-29 16:11:06 +00:00
|
|
|
import { lazy } from "react";
|
2021-07-26 10:43:30 +00:00
|
|
|
import { generatePath } from "react-router-dom";
|
|
|
|
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
|
|
|
|
): LocationDescriptorObject => ({
|
|
|
|
pathname: generatePath(IdentityProviderRoute.path, params),
|
|
|
|
});
|