fix url-related issues

This commit is contained in:
mfrances 2021-04-05 15:55:12 -04:00
parent 4054bd8b65
commit 9858cd0d30
3 changed files with 19 additions and 8 deletions

View file

@ -201,12 +201,6 @@ export const routes: RoutesFn = (t: TFunction) => [
breadcrumb: null, breadcrumb: null,
access: "view-realm", access: "view-realm",
}, },
{
path: "/:realm/user-federation/ldap",
component: UserFederationSection,
breadcrumb: null,
access: "view-realm",
},
{ {
path: "/:realm/user-federation/kerberos/:id", path: "/:realm/user-federation/kerberos/:id",
component: UserFederationKerberosSettings, component: UserFederationKerberosSettings,
@ -219,6 +213,12 @@ export const routes: RoutesFn = (t: TFunction) => [
breadcrumb: t("common:settings"), breadcrumb: t("common:settings"),
access: "view-realm", access: "view-realm",
}, },
{
path: "/:realm/user-federation/ldap",
component: UserFederationSection,
breadcrumb: null,
access: "view-realm",
},
{ {
path: "/:realm/user-federation/ldap/:id/:tab?", path: "/:realm/user-federation/ldap/:id/:tab?",
component: UserFederationLdapSettings, component: UserFederationLdapSettings,

View file

@ -70,9 +70,16 @@ export const LdapMapperList = () => {
}) })
); );
const getUrl = (url: string) => {
if (url.indexOf("/mappers") === -1) {
return `${url}/mappers`;
}
return `${url}`;
};
const MapperLink = (mapper: ComponentRepresentation) => ( const MapperLink = (mapper: ComponentRepresentation) => (
<> <>
<Link to={`${url}/mappers/${mapper.id}`}>{mapper.name}</Link> <Link to={`${getUrl(url)}/${mapper.id}`}>{mapper.name}</Link>
</> </>
); );

View file

@ -147,7 +147,11 @@ export const LdapMappingDetails = () => {
</Button> </Button>
<Button <Button
variant="link" variant="link"
onClick={() => history.push(`/${realm}/user-federation`)} onClick={() =>
history.push(
`/${realm}/user-federation/ldap/${mapper!.parentId}/mappers`
)
}
data-testid="ldap-cancel" data-testid="ldap-cancel"
> >
{t("common:cancel")} {t("common:cancel")}