2022-03-16 09:32:23 +00:00
|
|
|
import type { LocationDescriptorObject } from "history";
|
|
|
|
import { lazy } from "react";
|
|
|
|
import { generatePath } from "react-router-dom";
|
|
|
|
import type { RouteDef } from "../../route-config";
|
|
|
|
|
|
|
|
export type AttributeParams = {
|
|
|
|
realm: string;
|
|
|
|
attributeName: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const AttributeRoute: RouteDef = {
|
|
|
|
path: "/:realm/realm-settings/userProfile/attributes/:attributeName/edit-attribute",
|
|
|
|
component: lazy(() => import("../NewAttributeSettings")),
|
2022-03-31 13:28:48 +00:00
|
|
|
breadcrumb: (t) => t("realm-settings:editAttribute"),
|
2022-03-16 09:32:23 +00:00
|
|
|
access: "manage-realm",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toAttribute = (
|
|
|
|
params: AttributeParams
|
|
|
|
): LocationDescriptorObject => ({
|
|
|
|
pathname: generatePath(AttributeRoute.path, params),
|
|
|
|
});
|