2021-10-13 20:54:51 +00:00
|
|
|
import type { LocationDescriptorObject } from "history";
|
2021-10-29 16:11:06 +00:00
|
|
|
import { lazy } from "react";
|
2021-10-13 20:54:51 +00:00
|
|
|
import { generatePath } from "react-router-dom";
|
|
|
|
import type { RouteDef } from "../../route-config";
|
2021-10-21 18:40:02 +00:00
|
|
|
import { EditPolicyCrumb } from "../RealmSettingsSection";
|
2021-10-13 20:54:51 +00:00
|
|
|
|
|
|
|
export type EditClientPolicyParams = {
|
|
|
|
realm: string;
|
|
|
|
policyName: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const EditClientPolicyRoute: RouteDef = {
|
|
|
|
path: "/:realm/realm-settings/clientPolicies/:policyName/edit-policy",
|
2021-10-29 16:11:06 +00:00
|
|
|
component: lazy(() => import("../NewClientPolicyForm")),
|
2021-10-13 20:54:51 +00:00
|
|
|
access: "manage-realm",
|
2021-10-21 18:40:02 +00:00
|
|
|
breadcrumb: () => EditPolicyCrumb,
|
2021-10-13 20:54:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const toEditClientPolicy = (
|
|
|
|
params: EditClientPolicyParams
|
|
|
|
): LocationDescriptorObject => ({
|
|
|
|
pathname: generatePath(EditClientPolicyRoute.path, params),
|
|
|
|
});
|