fixed the fix (#3512)

This commit is contained in:
Erik Jan de Wit 2022-10-10 21:01:52 +02:00 committed by GitHub
parent 1a2c80600c
commit 73818dae64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 14 deletions

View file

@ -1,8 +1,5 @@
import type { RouteDef } from "../route-config"; import type { RouteDef } from "../route-config";
import { import { ClientScopeRoute } from "./routes/ClientScope";
ClientScopeRoute,
ClientScopeWithTypeRoute,
} from "./routes/ClientScope";
import { ClientScopesRoute } from "./routes/ClientScopes"; import { ClientScopesRoute } from "./routes/ClientScopes";
import { MapperRoute } from "./routes/Mapper"; import { MapperRoute } from "./routes/Mapper";
import { NewClientScopeRoute } from "./routes/NewClientScope"; import { NewClientScopeRoute } from "./routes/NewClientScope";
@ -11,7 +8,6 @@ const routes: RouteDef[] = [
NewClientScopeRoute, NewClientScopeRoute,
MapperRoute, MapperRoute,
ClientScopeRoute, ClientScopeRoute,
ClientScopeWithTypeRoute,
ClientScopesRoute, ClientScopesRoute,
]; ];

View file

@ -13,21 +13,14 @@ export type ClientScopeParams = {
}; };
export const ClientScopeRoute: RouteDef = { export const ClientScopeRoute: RouteDef = {
path: "/:realm/client-scopes/:id/:tab", path: "/:realm/client-scopes/:id/:tab/:type",
component: lazy(() => import("../form/ClientScopeForm")), component: lazy(() => import("../form/ClientScopeForm")),
breadcrumb: (t) => t("client-scopes:clientScopeDetails"), breadcrumb: (t) => t("client-scopes:clientScopeDetails"),
access: "view-clients", access: "view-clients",
}; };
export const ClientScopeWithTypeRoute: RouteDef = {
...ClientScopeRoute,
path: "/:realm/client-scopes/:id/:tab/:type",
};
export const toClientScope = (params: ClientScopeParams): Partial<Path> => { export const toClientScope = (params: ClientScopeParams): Partial<Path> => {
const path = params.type const path = ClientScopeRoute.path;
? ClientScopeWithTypeRoute.path
: ClientScopeRoute.path;
return { return {
pathname: generatePath(path, params), pathname: generatePath(path, params),