2021-07-26 10:43:30 +00:00
|
|
|
import type { LocationDescriptorObject } from "history";
|
|
|
|
import { generatePath } from "react-router-dom";
|
|
|
|
import type { RouteDef } from "../../route-config";
|
2021-09-22 20:27:30 +00:00
|
|
|
import { DetailSettings } from "../add/DetailSettings";
|
|
|
|
|
|
|
|
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",
|
|
|
|
component: DetailSettings,
|
|
|
|
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),
|
|
|
|
});
|