keycloak-scim/src/realm-settings/routes/AddClientProfile.ts
Jenny 3f7a912c2a
Realm settings: Return user to Policies subtab (#1823)
* add function to go to policies subtab

* use routable tabs

* use new defaultLocation prop

* rebase, lint, and tests

* unskip

* fix cancel test
2022-01-20 10:34:58 -05:00

22 lines
694 B
TypeScript

import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config";
export type AddClientProfileParams = {
realm: string;
tab: string;
};
export const AddClientProfileRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/:tab/add-profile",
component: lazy(() => import("../ClientProfileForm")),
breadcrumb: (t) => t("realm-settings:newClientProfile"),
access: "manage-realm",
};
export const toAddClientProfile = (
params: AddClientProfileParams
): LocationDescriptorObject => ({
pathname: generatePath(AddClientProfileRoute.path, params),
});