2022-01-31 07:20:35 +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 AuthorizationTab =
|
|
|
|
| "settings"
|
|
|
|
| "resources"
|
|
|
|
| "scopes"
|
|
|
|
| "policies"
|
|
|
|
| "permissions"
|
2022-02-09 22:37:31 +00:00
|
|
|
| "evaluate"
|
|
|
|
| "export";
|
2022-01-31 07:20:35 +00:00
|
|
|
|
|
|
|
export type AuthorizationParams = {
|
|
|
|
realm: string;
|
|
|
|
clientId: string;
|
|
|
|
tab: AuthorizationTab;
|
|
|
|
};
|
|
|
|
export const AuthorizationRoute: RouteDef = {
|
|
|
|
path: "/:realm/clients/:clientId/authorization/:tab",
|
|
|
|
component: lazy(() => import("../ClientDetails")),
|
|
|
|
breadcrumb: (t) => t("clients:clientSettings"),
|
|
|
|
access: "view-clients",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const toAuthorizationTab = (
|
|
|
|
params: AuthorizationParams
|
|
|
|
): LocationDescriptorObject => ({
|
|
|
|
pathname: generatePath(AuthorizationRoute.path, params),
|
|
|
|
});
|