add updated breadcrumb for key providers (#884)

This commit is contained in:
Jenny 2021-07-20 14:47:05 -04:00 committed by GitHub
parent a0cd879857
commit 0055812ad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 7 deletions

View file

@ -4,6 +4,8 @@ import { useTranslation } from "react-i18next";
import { Controller, FormProvider, useForm } from "react-hook-form";
import {
AlertVariant,
Breadcrumb,
BreadcrumbItem,
ButtonVariant,
DropdownItem,
DropdownSeparator,
@ -44,6 +46,23 @@ type RealmSettingsHeaderProps = {
realmName: string;
};
export const EditProviderCrumb = () => {
const { t } = useTranslation("realm-settings");
const { realm } = useRealm();
return (
<>
<Breadcrumb>
<BreadcrumbItem to={`#/${realm}/realm-settings/keys`}>
{t("keys")}
</BreadcrumbItem>
<BreadcrumbItem>{t("providers")}</BreadcrumbItem>
<BreadcrumbItem isActive>{t("editProvider")}</BreadcrumbItem>
</Breadcrumb>
</>
);
};
const RealmSettingsHeader = ({
save,
onChange,

View file

@ -14,7 +14,10 @@ import { GroupsSection } from "./groups/GroupsSection";
import { IdentityProvidersSection } from "./identity-providers/IdentityProvidersSection";
import { PageNotFoundSection } from "./PageNotFoundSection";
import { RealmRolesSection } from "./realm-roles/RealmRolesSection";
import { RealmSettingsSection } from "./realm-settings/RealmSettingsSection";
import {
EditProviderCrumb,
RealmSettingsSection,
} from "./realm-settings/RealmSettingsSection";
import { NewRealmForm } from "./realm/add/NewRealmForm";
import { SessionsSection } from "./sessions/SessionsSection";
import { UserFederationSection } from "./user-federation/UserFederationSection";
@ -192,37 +195,37 @@ export const routes: RoutesFn = (t: TFunction) => [
{
path: "/:realm/realm-settings/keys/:id?/aes-generated/settings",
component: AESGeneratedSettings,
breadcrumb: t("realm-settings:editProvider"),
breadcrumb: EditProviderCrumb,
access: "view-realm",
},
{
path: "/:realm/realm-settings/keys/:id?/ecdsa-generated/settings",
component: ECDSAGeneratedSettings,
breadcrumb: t("realm-settings:editProvider"),
breadcrumb: EditProviderCrumb,
access: "view-realm",
},
{
path: "/:realm/realm-settings/keys/:id?/hmac-generated/settings",
component: HMACGeneratedSettings,
breadcrumb: t("realm-settings:editProvider"),
breadcrumb: EditProviderCrumb,
access: "view-realm",
},
{
path: "/:realm/realm-settings/keys/:id?/java-keystore/settings",
component: JavaKeystoreSettings,
breadcrumb: t("realm-settings:editProvider"),
breadcrumb: EditProviderCrumb,
access: "view-realm",
},
{
path: "/:realm/realm-settings/keys/:id?/rsa-generated/settings",
component: RSAGeneratedSettings,
breadcrumb: t("realm-settings:editProvider"),
breadcrumb: EditProviderCrumb,
access: "view-realm",
},
{
path: "/:realm/realm-settings/keys/:id?/rsa/settings",
component: RSASettings,
breadcrumb: t("realm-settings:editProvider"),
breadcrumb: EditProviderCrumb,
access: "view-realm",
},
{