changed to append to url, for client role details (#1048)

fixes: #1041
This commit is contained in:
Erik Jan de Wit 2021-08-25 15:22:53 +02:00 committed by GitHub
parent 02ffc1fb88
commit 5b23354e35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -13,9 +13,9 @@ import { emptyFormatter, upperCaseFormatter } from "../util";
import { useRealm } from "../context/realm-context/RealmContext"; import { useRealm } from "../context/realm-context/RealmContext";
import type RealmRepresentation from "keycloak-admin/lib/defs/realmRepresentation"; import type RealmRepresentation from "keycloak-admin/lib/defs/realmRepresentation";
import { HelpItem } from "../components/help-enabler/HelpItem"; import { HelpItem } from "../components/help-enabler/HelpItem";
import { toRealmRole } from "./routes/RealmRole";
import "./RealmRolesSection.css"; import "./RealmRolesSection.css";
import { toRealmRole } from "./routes/RealmRole";
type myRealmRepresentation = RealmRepresentation & { type myRealmRepresentation = RealmRepresentation & {
defaultRole?: { defaultRole?: {

View file

@ -1,5 +1,5 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { generatePath } from "react-router-dom"; import { useRouteMatch } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RealmRoleTabs } from "../RealmRoleTabs"; import { RealmRoleTabs } from "../RealmRoleTabs";
@ -24,6 +24,9 @@ export const RealmRoleRoute: RouteDef = {
export const toRealmRole = ( export const toRealmRole = (
params: RealmRoleParams params: RealmRoleParams
): LocationDescriptorObject => ({ ): LocationDescriptorObject => {
pathname: generatePath(RealmRoleRoute.path, params), const { url } = useRouteMatch();
}); return {
pathname: `${url}/${params.id}/details`,
};
};