make all routes lazy (#1445)

This commit is contained in:
Erik Jan de Wit 2021-10-29 18:11:06 +02:00 committed by GitHub
parent 9e5f711bea
commit c96450ef61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
98 changed files with 223 additions and 212 deletions

View file

@ -46,7 +46,7 @@ const realmFlows = [
"dockerAuthenticationFlow", "dockerAuthenticationFlow",
]; ];
export const AuthenticationSection = () => { export default function AuthenticationSection() {
const { t } = useTranslation("authentication"); const { t } = useTranslation("authentication");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { realm } = useRealm(); const { realm } = useRealm();
@ -293,4 +293,4 @@ export const AuthenticationSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -47,7 +47,7 @@ export const providerConditionFilter = (
value: AuthenticationProviderRepresentation value: AuthenticationProviderRepresentation
) => value.displayName?.startsWith("Condition "); ) => value.displayName?.startsWith("Condition ");
export const FlowDetails = () => { export default function FlowDetails() {
const { t } = useTranslation("authentication"); const { t } = useTranslation("authentication");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { realm } = useRealm(); const { realm } = useRealm();
@ -466,4 +466,4 @@ export const FlowDetails = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -19,7 +19,7 @@ import { NameDescription } from "./NameDescription";
import { FlowType } from "./FlowType"; import { FlowType } from "./FlowType";
import { toFlow } from "../routes/Flow"; import { toFlow } from "../routes/Flow";
export const CreateFlow = () => { export default function CreateFlow() {
const { t } = useTranslation("authentication"); const { t } = useTranslation("authentication");
const history = useHistory(); const history = useHistory();
const { realm } = useRealm(); const { realm } = useRealm();
@ -88,4 +88,4 @@ export const CreateFlow = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AuthenticationSection } from "../AuthenticationSection";
export type AuthenticationParams = { realm: string; tab?: string }; export type AuthenticationParams = { realm: string; tab?: string };
export const AuthenticationRoute: RouteDef = { export const AuthenticationRoute: RouteDef = {
path: "/:realm/authentication/:tab?", path: "/:realm/authentication/:tab?",
component: AuthenticationSection, component: lazy(() => import("../AuthenticationSection")),
breadcrumb: (t) => t("authentication"), breadcrumb: (t) => t("authentication"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { CreateFlow } from "../form/CreateFlow";
export type CreateFlowParams = { realm: string }; export type CreateFlowParams = { realm: string };
export const CreateFlowRoute: RouteDef = { export const CreateFlowRoute: RouteDef = {
path: "/:realm/authentication/flows/create", path: "/:realm/authentication/flows/create",
component: CreateFlow, component: lazy(() => import("../form/CreateFlow")),
breadcrumb: (t) => t("authentication:createFlow"), breadcrumb: (t) => t("authentication:createFlow"),
access: "manage-authorization", access: "manage-authorization",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { FlowDetails } from "../FlowDetails";
export type FlowParams = { export type FlowParams = {
realm: string; realm: string;
@ -12,7 +12,7 @@ export type FlowParams = {
export const FlowRoute: RouteDef = { export const FlowRoute: RouteDef = {
path: "/:realm/authentication/:id/:usedBy/:builtIn?", path: "/:realm/authentication/:id/:usedBy/:builtIn?",
component: FlowDetails, component: lazy(() => import("../FlowDetails")),
breadcrumb: (t) => t("authentication:flowDetails"), breadcrumb: (t) => t("authentication:flowDetails"),
access: "manage-authorization", access: "manage-authorization",
}; };

View file

@ -45,7 +45,7 @@ import {
} from "./details/SearchFilter"; } from "./details/SearchFilter";
import type { Row } from "../clients/scopes/ClientScopes"; import type { Row } from "../clients/scopes/ClientScopes";
export const ClientScopesSection = () => { export default function ClientScopesSection() {
const { realm } = useRealm(); const { realm } = useRealm();
const { whoAmI } = useWhoAmI(); const { whoAmI } = useWhoAmI();
const { t } = useTranslation("client-scopes"); const { t } = useTranslation("client-scopes");
@ -282,4 +282,4 @@ export const ClientScopesSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -31,7 +31,7 @@ import { toClientScope } from "../routes/ClientScope";
import "./mapping-details.css"; import "./mapping-details.css";
export const MappingDetails = () => { export default function MappingDetails() {
const { t } = useTranslation("client-scopes"); const { t } = useTranslation("client-scopes");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
@ -269,4 +269,4 @@ export const MappingDetails = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -35,7 +35,7 @@ import {
import { useRealm } from "../../context/realm-context/RealmContext"; import { useRealm } from "../../context/realm-context/RealmContext";
import { toMapper } from "../routes/Mapper"; import { toMapper } from "../routes/Mapper";
export const ClientScopeForm = () => { export default function ClientScopeForm() {
const { t } = useTranslation("client-scopes"); const { t } = useTranslation("client-scopes");
const [clientScope, setClientScope] = const [clientScope, setClientScope] =
useState<ClientScopeDefaultOptionalType>(); useState<ClientScopeDefaultOptionalType>();
@ -307,4 +307,4 @@ export const ClientScopeForm = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ClientScopeForm } from "../form/ClientScopeForm";
export type ClientScopeTab = "settings" | "mappers" | "scope"; export type ClientScopeTab = "settings" | "mappers" | "scope";
@ -14,7 +14,7 @@ export type ClientScopeParams = {
export const ClientScopeRoute: RouteDef = { export const ClientScopeRoute: RouteDef = {
path: "/:realm/client-scopes/:id/:type/:tab", path: "/:realm/client-scopes/:id/:type/:tab",
component: ClientScopeForm, component: lazy(() => import("../form/ClientScopeForm")),
breadcrumb: (t) => t("client-scopes:clientScopeDetails"), breadcrumb: (t) => t("client-scopes:clientScopeDetails"),
access: "view-clients", access: "view-clients",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ClientScopesSection } from "../ClientScopesSection";
export type ClientScopesParams = { realm: string }; export type ClientScopesParams = { realm: string };
export const ClientScopesRoute: RouteDef = { export const ClientScopesRoute: RouteDef = {
path: "/:realm/client-scopes", path: "/:realm/client-scopes",
component: ClientScopesSection, component: lazy(() => import("../ClientScopesSection")),
breadcrumb: (t) => t("client-scopes:clientScopeList"), breadcrumb: (t) => t("client-scopes:clientScopeList"),
access: "view-clients", access: "view-clients",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { MappingDetails } from "../details/MappingDetails";
export type MapperParams = { export type MapperParams = {
realm: string; realm: string;
@ -12,7 +12,7 @@ export type MapperParams = {
export const MapperRoute: RouteDef = { export const MapperRoute: RouteDef = {
path: "/:realm/client-scopes/:id/:type/mappers/:mapperId", path: "/:realm/client-scopes/:id/:type/mappers/:mapperId",
component: MappingDetails, component: lazy(() => import("../details/MappingDetails")),
breadcrumb: (t) => t("common:mappingDetails"), breadcrumb: (t) => t("common:mappingDetails"),
access: "view-clients", access: "view-clients",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ClientScopeForm } from "../form/ClientScopeForm";
export type NewClientScopeParams = { realm: string }; export type NewClientScopeParams = { realm: string };
export const NewClientScopeRoute: RouteDef = { export const NewClientScopeRoute: RouteDef = {
path: "/:realm/client-scopes/new", path: "/:realm/client-scopes/new",
component: ClientScopeForm, component: lazy(() => import("../form/ClientScopeForm")),
breadcrumb: (t) => t("client-scopes:createClientScope"), breadcrumb: (t) => t("client-scopes:createClientScope"),
access: "manage-clients", access: "manage-clients",
}; };

View file

@ -170,7 +170,7 @@ export type SaveOptions = {
messageKey?: string; messageKey?: string;
}; };
export const ClientDetails = () => { export default function ClientDetails() {
const { t } = useTranslation("clients"); const { t } = useTranslation("clients");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
@ -497,4 +497,4 @@ export const ClientDetails = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -32,7 +32,7 @@ import { toClient } from "./routes/Client";
import { toImportClient } from "./routes/ImportClient"; import { toImportClient } from "./routes/ImportClient";
import { isRealmClient, getProtocolName } from "./utils"; import { isRealmClient, getProtocolName } from "./utils";
export const ClientsSection = () => { export default function ClientsSection() {
const { t } = useTranslation("clients"); const { t } = useTranslation("clients");
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
@ -213,4 +213,4 @@ export const ClientsSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -20,7 +20,7 @@ import { toClients } from "../routes/Clients";
import { CapabilityConfig } from "./CapabilityConfig"; import { CapabilityConfig } from "./CapabilityConfig";
import { GeneralSettings } from "./GeneralSettings"; import { GeneralSettings } from "./GeneralSettings";
export const NewClientForm = () => { export default function NewClientForm() {
const { t } = useTranslation("clients"); const { t } = useTranslation("clients");
const { realm } = useRealm(); const { realm } = useRealm();
const adminClient = useAdminClient(); const adminClient = useAdminClient();
@ -151,4 +151,4 @@ export const NewClientForm = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -23,7 +23,7 @@ import { ClientDescription } from "../ClientDescription";
import { toClient } from "../routes/Client"; import { toClient } from "../routes/Client";
import { toClients } from "../routes/Clients"; import { toClients } from "../routes/Clients";
export const ImportForm = () => { export default function ImportForm() {
const { t } = useTranslation("clients"); const { t } = useTranslation("clients");
const history = useHistory(); const history = useHistory();
const adminClient = useAdminClient(); const adminClient = useAdminClient();
@ -111,4 +111,4 @@ export const ImportForm = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -22,7 +22,7 @@ import { useAlerts } from "../../components/alert/Alerts";
import { AccessTokenDialog } from "./AccessTokenDialog"; import { AccessTokenDialog } from "./AccessTokenDialog";
import { toClients } from "../routes/Clients"; import { toClients } from "../routes/Clients";
export const CreateInitialAccessToken = () => { export default function CreateInitialAccessToken() {
const { t } = useTranslation("clients"); const { t } = useTranslation("clients");
const { handleSubmit, control } = useForm(); const { handleSubmit, control } = useForm();
@ -144,4 +144,4 @@ export const CreateInitialAccessToken = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { NewClientForm } from "../add/NewClientForm";
export type AddClientParams = { realm: string }; export type AddClientParams = { realm: string };
export const AddClientRoute: RouteDef = { export const AddClientRoute: RouteDef = {
path: "/:realm/clients/add-client", path: "/:realm/clients/add-client",
component: NewClientForm, component: lazy(() => import("../add/NewClientForm")),
breadcrumb: (t) => t("clients:createClient"), breadcrumb: (t) => t("clients:createClient"),
access: "manage-clients", access: "manage-clients",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ClientDetails } from "../ClientDetails";
export type ClientTab = export type ClientTab =
| "settings" | "settings"
@ -18,7 +18,7 @@ export type ClientParams = {
export const ClientRoute: RouteDef = { export const ClientRoute: RouteDef = {
path: "/:realm/clients/:clientId/:tab", path: "/:realm/clients/:clientId/:tab",
component: ClientDetails, component: lazy(() => import("../ClientDetails")),
breadcrumb: (t) => t("clients:clientSettings"), breadcrumb: (t) => t("clients:clientSettings"),
access: "view-clients", access: "view-clients",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ClientsSection } from "../ClientsSection";
export type ClientsTab = "list" | "initialAccessToken"; export type ClientsTab = "list" | "initialAccessToken";
@ -12,7 +12,7 @@ export type ClientsParams = {
export const ClientsRoute: RouteDef = { export const ClientsRoute: RouteDef = {
path: "/:realm/clients/:tab?", path: "/:realm/clients/:tab?",
component: ClientsSection, component: lazy(() => import("../ClientsSection")),
breadcrumb: (t) => t("clients:clientList"), breadcrumb: (t) => t("clients:clientList"),
access: "query-clients", access: "query-clients",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { CreateInitialAccessToken } from "../initial-access/CreateInitialAccessToken";
export type CreateInitialAccessTokenParams = { realm: string }; export type CreateInitialAccessTokenParams = { realm: string };
export const CreateInitialAccessTokenRoute: RouteDef = { export const CreateInitialAccessTokenRoute: RouteDef = {
path: "/:realm/clients/initialAccessToken/create", path: "/:realm/clients/initialAccessToken/create",
component: CreateInitialAccessToken, component: lazy(() => import("../initial-access/CreateInitialAccessToken")),
breadcrumb: (t) => t("clients:createToken"), breadcrumb: (t) => t("clients:createToken"),
access: "manage-clients", access: "manage-clients",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ImportForm } from "../import/ImportForm";
export type ImportClientParams = { realm: string }; export type ImportClientParams = { realm: string };
export const ImportClientRoute: RouteDef = { export const ImportClientRoute: RouteDef = {
path: "/:realm/clients/import-client", path: "/:realm/clients/import-client",
component: ImportForm, component: lazy(() => import("../import/ImportForm")),
breadcrumb: (t) => t("clients:importClient"), breadcrumb: (t) => t("clients:importClient"),
access: "manage-clients", access: "manage-clients",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { MappingDetails } from "../../client-scopes/details/MappingDetails"; import { lazy } from "react";
export type MapperParams = { export type MapperParams = {
realm: string; realm: string;
@ -11,7 +11,7 @@ export type MapperParams = {
export const MapperRoute: RouteDef = { export const MapperRoute: RouteDef = {
path: "/:realm/clients/:id/mappers/:mapperId", path: "/:realm/clients/:id/mappers/:mapperId",
component: MappingDetails, component: lazy(() => import("../../client-scopes/details/MappingDetails")),
breadcrumb: (t) => t("common:mappingDetails"), breadcrumb: (t) => t("common:mappingDetails"),
access: "view-clients", access: "view-clients",
}; };

View file

@ -165,7 +165,7 @@ const Dashboard = () => {
); );
}; };
export const DashboardSection = () => { export default function DashboardSection() {
const { realm } = useRealm(); const { realm } = useRealm();
const isMasterRealm = realm === "master"; const isMasterRealm = realm === "master";
return ( return (
@ -174,4 +174,4 @@ export const DashboardSection = () => {
{isMasterRealm && <Dashboard />} {isMasterRealm && <Dashboard />}
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { DashboardSection } from "../Dashboard";
export type DashboardParams = { realm?: string }; export type DashboardParams = { realm?: string };
export const DashboardRoute: RouteDef = { export const DashboardRoute: RouteDef = {
path: "/:realm?", path: "/:realm?",
component: DashboardSection, component: lazy(() => import("../Dashboard")),
breadcrumb: (t) => t("common:home"), breadcrumb: (t) => t("common:home"),
access: "anyone", access: "anyone",
}; };

View file

@ -84,7 +84,7 @@ const DetailCell = (event: EventRepresentation) => (
</DescriptionList> </DescriptionList>
); );
export const EventsSection = () => { export default function EventsSection() {
const { t } = useTranslation("events"); const { t } = useTranslation("events");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { realm } = useRealm(); const { realm } = useRealm();
@ -482,4 +482,4 @@ export const EventsSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { EventsSection } from "../EventsSection";
export type EventsTab = "userEvents" | "adminEvents"; export type EventsTab = "userEvents" | "adminEvents";
@ -12,7 +12,7 @@ export type EventsParams = {
export const EventsRoute: RouteDef = { export const EventsRoute: RouteDef = {
path: "/:realm/events/:tab?", path: "/:realm/events/:tab?",
component: EventsSection, component: lazy(() => import("../EventsSection")),
breadcrumb: (t) => t("events:title"), breadcrumb: (t) => t("events:title"),
access: "view-events", access: "view-events",
}; };

View file

@ -26,7 +26,7 @@ import { GroupsModal } from "./GroupsModal";
import "./GroupsSection.css"; import "./GroupsSection.css";
export const GroupsSection = () => { export default function GroupsSection() {
const { t } = useTranslation("groups"); const { t } = useTranslation("groups");
const [activeTab, setActiveTab] = useState(0); const [activeTab, setActiveTab] = useState(0);
@ -174,4 +174,4 @@ export const GroupsSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -29,7 +29,7 @@ type SearchGroup = GroupRepresentation & {
link?: string; link?: string;
}; };
export const SearchGroups = () => { export default function SearchGroups() {
const { t } = useTranslation("groups"); const { t } = useTranslation("groups");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { realm } = useRealm(); const { realm } = useRealm();
@ -185,4 +185,4 @@ export const SearchGroups = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { GroupsSection } from "../GroupsSection";
export type GroupsParams = { realm: string }; export type GroupsParams = { realm: string };
export const GroupsRoute: RouteDef = { export const GroupsRoute: RouteDef = {
path: "/:realm/groups", path: "/:realm/groups",
component: GroupsSection, component: lazy(() => import("../GroupsSection")),
access: "query-groups", access: "query-groups",
matchOptions: { matchOptions: {
exact: false, exact: false,

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { SearchGroups } from "../SearchGroups";
export type GroupsSearchParams = { realm: string }; export type GroupsSearchParams = { realm: string };
export const GroupsSearchRoute: RouteDef = { export const GroupsSearchRoute: RouteDef = {
path: "/:realm/groups/search", path: "/:realm/groups/search",
component: SearchGroups, component: lazy(() => import("../SearchGroups")),
breadcrumb: (t) => t("groups:searchGroups"), breadcrumb: (t) => t("groups:searchGroups"),
access: "query-groups", access: "query-groups",
}; };

View file

@ -37,7 +37,7 @@ import { ManageOderDialog } from "./ManageOrderDialog";
import { toIdentityProvider } from "./routes/IdentityProvider"; import { toIdentityProvider } from "./routes/IdentityProvider";
import { toIdentityProviderCreate } from "./routes/IdentityProviderCreate"; import { toIdentityProviderCreate } from "./routes/IdentityProviderCreate";
export const IdentityProvidersSection = () => { export default function IdentityProvidersSection() {
const { t } = useTranslation("identity-providers"); const { t } = useTranslation("identity-providers");
const identityProviders = _.groupBy( const identityProviders = _.groupBy(
useServerInfo().identityProviders, useServerInfo().identityProviders,
@ -269,4 +269,4 @@ export const IdentityProvidersSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -20,7 +20,7 @@ import { GeneralSettings } from "./GeneralSettings";
import { toIdentityProvider } from "../routes/IdentityProvider"; import { toIdentityProvider } from "../routes/IdentityProvider";
import type { IdentityProviderCreateParams } from "../routes/IdentityProviderCreate"; import type { IdentityProviderCreateParams } from "../routes/IdentityProviderCreate";
export const AddIdentityProvider = () => { export default function AddIdentityProvider() {
const { t } = useTranslation("identity-providers"); const { t } = useTranslation("identity-providers");
const { providerId } = useParams<IdentityProviderCreateParams>(); const { providerId } = useParams<IdentityProviderCreateParams>();
const form = useForm<IdentityProviderRepresentation>(); const form = useForm<IdentityProviderRepresentation>();
@ -92,4 +92,4 @@ export const AddIdentityProvider = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -47,7 +47,7 @@ type Role = RoleRepresentation & {
clientId?: string; clientId?: string;
}; };
export const AddMapper = () => { export default function AddMapper() {
const { t } = useTranslation("identity-providers"); const { t } = useTranslation("identity-providers");
const form = useForm<IdPMapperRepresentationWithAttributes>(); const form = useForm<IdPMapperRepresentationWithAttributes>();
@ -901,4 +901,4 @@ export const AddMapper = () => {
</FormAccess> </FormAccess>
</PageSection> </PageSection>
); );
}; }

View file

@ -23,7 +23,7 @@ type DiscoveryIdentity = IdentityProviderRepresentation & {
discoveryEndpoint?: string; discoveryEndpoint?: string;
}; };
export const AddOpenIdConnect = () => { export default function AddOpenIdConnect() {
const { t } = useTranslation("identity-providers"); const { t } = useTranslation("identity-providers");
const history = useHistory(); const history = useHistory();
const { url } = useRouteMatch(); const { url } = useRouteMatch();
@ -97,4 +97,4 @@ export const AddOpenIdConnect = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -18,7 +18,7 @@ import { SamlConnectSettings } from "./SamlConnectSettings";
import { useRealm } from "../../context/realm-context/RealmContext"; import { useRealm } from "../../context/realm-context/RealmContext";
import { useAlerts } from "../../components/alert/Alerts"; import { useAlerts } from "../../components/alert/Alerts";
export const AddSamlConnect = () => { export default function AddSamlConnect() {
const { t } = useTranslation("identity-providers"); const { t } = useTranslation("identity-providers");
const history = useHistory(); const history = useHistory();
const id = "saml"; const id = "saml";
@ -89,4 +89,4 @@ export const AddSamlConnect = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -101,7 +101,7 @@ const Header = ({ onChange, value, save, toggleDeleteDialog }: HeaderProps) => {
); );
}; };
export const DetailSettings = () => { export default function DetailSettings() {
const { t } = useTranslation("identity-providers"); const { t } = useTranslation("identity-providers");
const { alias, providerId } = useParams<IdentityProviderParams>(); const { alias, providerId } = useParams<IdentityProviderParams>();
@ -397,4 +397,4 @@ export const DetailSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AddMapper } from "../add/AddMapper";
export type IdentityProviderAddMapperParams = { export type IdentityProviderAddMapperParams = {
realm: string; realm: string;
@ -12,7 +12,7 @@ export type IdentityProviderAddMapperParams = {
export const IdentityProviderAddMapperRoute: RouteDef = { export const IdentityProviderAddMapperRoute: RouteDef = {
path: "/:realm/identity-providers/:providerId/:alias/:tab/create", path: "/:realm/identity-providers/:providerId/:alias/:tab/create",
component: AddMapper, component: lazy(() => import("../add/AddMapper")),
access: "manage-identity-providers", access: "manage-identity-providers",
breadcrumb: (t) => t("identity-providers:addIdPMapper"), breadcrumb: (t) => t("identity-providers:addIdPMapper"),
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AddMapper } from "../add/AddMapper";
export type IdentityProviderEditMapperParams = { export type IdentityProviderEditMapperParams = {
realm: string; realm: string;
@ -12,7 +12,7 @@ export type IdentityProviderEditMapperParams = {
export const IdentityProviderEditMapperRoute: RouteDef = { export const IdentityProviderEditMapperRoute: RouteDef = {
path: "/:realm/identity-providers/:providerId/:alias/mappers/:id", path: "/:realm/identity-providers/:providerId/:alias/mappers/:id",
component: AddMapper, component: lazy(() => import("../add/AddMapper")),
access: "manage-identity-providers", access: "manage-identity-providers",
breadcrumb: (t) => t("identity-providers:editIdPMapper"), breadcrumb: (t) => t("identity-providers:editIdPMapper"),
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { DetailSettings } from "../add/DetailSettings";
type IdentityProviderTabs = "settings" | "mappers"; type IdentityProviderTabs = "settings" | "mappers";
@ -14,7 +14,7 @@ export type IdentityProviderParams = {
export const IdentityProviderRoute: RouteDef = { export const IdentityProviderRoute: RouteDef = {
path: "/:realm/identity-providers/:providerId/:alias/:tab", path: "/:realm/identity-providers/:providerId/:alias/:tab",
component: DetailSettings, component: lazy(() => import("../add/DetailSettings")),
breadcrumb: (t) => t("identity-providers:providerDetails"), breadcrumb: (t) => t("identity-providers:providerDetails"),
access: "manage-identity-providers", access: "manage-identity-providers",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AddIdentityProvider } from "../add/AddIdentityProvider";
export type IdentityProviderCreateParams = { export type IdentityProviderCreateParams = {
realm: string; realm: string;
@ -10,7 +10,7 @@ export type IdentityProviderCreateParams = {
export const IdentityProviderCreateRoute: RouteDef = { export const IdentityProviderCreateRoute: RouteDef = {
path: "/:realm/identity-providers/:providerId/add", path: "/:realm/identity-providers/:providerId/add",
component: AddIdentityProvider, component: lazy(() => import("../add/AddIdentityProvider")),
breadcrumb: (t) => t("identity-providers:addProvider"), breadcrumb: (t) => t("identity-providers:addProvider"),
access: "manage-identity-providers", access: "manage-identity-providers",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AddOpenIdConnect } from "../add/AddOpenIdConnect";
export type IdentityProviderKeycloakOidcParams = { realm: string }; export type IdentityProviderKeycloakOidcParams = { realm: string };
export const IdentityProviderKeycloakOidcRoute: RouteDef = { export const IdentityProviderKeycloakOidcRoute: RouteDef = {
path: "/:realm/identity-providers/keycloak-oidc/add", path: "/:realm/identity-providers/keycloak-oidc/add",
component: AddOpenIdConnect, component: lazy(() => import("../add/AddOpenIdConnect")),
breadcrumb: (t) => t("identity-providers:addKeycloakOpenIdProvider"), breadcrumb: (t) => t("identity-providers:addKeycloakOpenIdProvider"),
access: "manage-identity-providers", access: "manage-identity-providers",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AddOpenIdConnect } from "../add/AddOpenIdConnect";
export type IdentityProviderOidcParams = { realm: string }; export type IdentityProviderOidcParams = { realm: string };
export const IdentityProviderOidcRoute: RouteDef = { export const IdentityProviderOidcRoute: RouteDef = {
path: "/:realm/identity-providers/oidc/add", path: "/:realm/identity-providers/oidc/add",
component: AddOpenIdConnect, component: lazy(() => import("../add/AddOpenIdConnect")),
breadcrumb: (t) => t("identity-providers:addOpenIdProvider"), breadcrumb: (t) => t("identity-providers:addOpenIdProvider"),
access: "manage-identity-providers", access: "manage-identity-providers",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AddSamlConnect } from "../add/AddSamlConnect";
export type IdentityProviderSamlParams = { realm: string }; export type IdentityProviderSamlParams = { realm: string };
export const IdentityProviderSamlRoute: RouteDef = { export const IdentityProviderSamlRoute: RouteDef = {
path: "/:realm/identity-providers/saml/add", path: "/:realm/identity-providers/saml/add",
component: AddSamlConnect, component: lazy(() => import("../add/AddSamlConnect")),
breadcrumb: (t) => t("identity-providers:addSamlProvider"), breadcrumb: (t) => t("identity-providers:addSamlProvider"),
access: "manage-identity-providers", access: "manage-identity-providers",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { IdentityProvidersSection } from "../IdentityProvidersSection";
export type IdentityProvidersParams = { realm: string }; export type IdentityProvidersParams = { realm: string };
export const IdentityProvidersRoute: RouteDef = { export const IdentityProvidersRoute: RouteDef = {
path: "/:realm/identity-providers", path: "/:realm/identity-providers",
component: IdentityProvidersSection, component: lazy(() => import("../IdentityProvidersSection")),
breadcrumb: (t) => t("identityProviders"), breadcrumb: (t) => t("identityProviders"),
access: "view-identity-providers", access: "view-identity-providers",
}; };

View file

@ -42,7 +42,7 @@ type myRealmRepresentation = RealmRepresentation & {
}; };
}; };
export const RealmRoleTabs = () => { export default function RealmRoleTabs() {
const { t } = useTranslation("roles"); const { t } = useTranslation("roles");
const form = useForm<RoleFormType>({ mode: "onChange" }); const form = useForm<RoleFormType>({ mode: "onChange" });
const history = useHistory(); const history = useHistory();
@ -408,4 +408,4 @@ export const RealmRoleTabs = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -4,7 +4,7 @@ import { ViewHeader } from "../components/view-header/ViewHeader";
import { useAdminClient } from "../context/auth/AdminClient"; import { useAdminClient } from "../context/auth/AdminClient";
import { RolesList } from "./RolesList"; import { RolesList } from "./RolesList";
export const RealmRolesSection = () => { export default function RealmRolesSection() {
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const loader = (first?: number, max?: number, search?: string) => { const loader = (first?: number, max?: number, search?: string) => {
@ -30,4 +30,4 @@ export const RealmRolesSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RealmRoleTabs } from "../RealmRoleTabs";
export type AddRoleParams = { realm: string }; export type AddRoleParams = { realm: string };
export const AddRoleRoute: RouteDef = { export const AddRoleRoute: RouteDef = {
path: "/:realm/roles/add-role", path: "/:realm/roles/add-role",
component: RealmRoleTabs, component: lazy(() => import("../RealmRoleTabs")),
breadcrumb: (t) => t("roles:createRole"), breadcrumb: (t) => t("roles:createRole"),
access: "manage-realm", access: "manage-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RealmRoleTabs } from "../RealmRoleTabs";
export type AddRoleToClientParams = { export type AddRoleToClientParams = {
realm: string; realm: string;
@ -10,7 +10,7 @@ export type AddRoleToClientParams = {
export const AddRoleToClientRoute: RouteDef = { export const AddRoleToClientRoute: RouteDef = {
path: "/:realm/clients/:clientId/roles/add-role", path: "/:realm/clients/:clientId/roles/add-role",
component: RealmRoleTabs, component: lazy(() => import("../RealmRoleTabs")),
breadcrumb: (t) => t("roles:createRole"), breadcrumb: (t) => t("roles:createRole"),
access: "manage-realm", access: "manage-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RealmRoleTabs } from "../RealmRoleTabs";
export type ClientRoleTab = "details" | "attributes" | "users-in-role"; export type ClientRoleTab = "details" | "attributes" | "users-in-role";
@ -14,7 +14,7 @@ export type ClientRoleParams = {
export const ClientRoleRoute: RouteDef = { export const ClientRoleRoute: RouteDef = {
path: "/:realm/clients/:clientId/roles/:id/:tab?", path: "/:realm/clients/:clientId/roles/:id/:tab?",
component: RealmRoleTabs, component: lazy(() => import("../RealmRoleTabs")),
breadcrumb: (t) => t("roles:roleDetails"), breadcrumb: (t) => t("roles:roleDetails"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router"; import { generatePath } from "react-router";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RealmRoleTabs } from "../RealmRoleTabs";
export type RealmRoleTab = export type RealmRoleTab =
| "details" | "details"
@ -17,7 +17,7 @@ export type RealmRoleParams = {
export const RealmRoleRoute: RouteDef = { export const RealmRoleRoute: RouteDef = {
path: "/:realm/roles/:id/:tab?", path: "/:realm/roles/:id/:tab?",
component: RealmRoleTabs, component: lazy(() => import("../RealmRoleTabs")),
breadcrumb: (t) => t("roles:roleDetails"), breadcrumb: (t) => t("roles:roleDetails"),
access: ["view-realm", "view-users"], access: ["view-realm", "view-users"],
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RealmRolesSection } from "../RealmRolesSection";
export type RealmRolesParams = { realm: string }; export type RealmRolesParams = { realm: string };
export const RealmRolesRoute: RouteDef = { export const RealmRolesRoute: RouteDef = {
path: "/:realm/roles", path: "/:realm/roles",
component: RealmRolesSection, component: lazy(() => import("../RealmRolesSection")),
breadcrumb: (t) => t("roles:roleList"), breadcrumb: (t) => t("roles:roleList"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -45,7 +45,7 @@ const defaultValues: ClientProfileForm = {
executors: [], executors: [],
}; };
export const ClientProfileForm = () => { export default function ClientProfileForm() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const history = useHistory(); const history = useHistory();
const { const {
@ -479,4 +479,4 @@ export const ClientProfileForm = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -35,7 +35,7 @@ const defaultValues: ExecutorForm = {
executor: "", executor: "",
}; };
export const ExecutorForm = () => { export default function ExecutorForm() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const history = useHistory(); const history = useHistory();
const { realm, profileName } = useParams<ClientProfileParams>(); const { realm, profileName } = useParams<ClientProfileParams>();
@ -204,4 +204,4 @@ export const ExecutorForm = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -26,7 +26,7 @@ import type ComponentTypeRepresentation from "@keycloak/keycloak-admin-client/li
import { useRealm } from "../context/realm-context/RealmContext"; import { useRealm } from "../context/realm-context/RealmContext";
import type { EditClientPolicyParams } from "./routes/EditClientPolicy"; import type { EditClientPolicyParams } from "./routes/EditClientPolicy";
export const NewClientPolicyCondition = () => { export default function NewClientPolicyCondition() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
const history = useHistory(); const history = useHistory();
@ -194,4 +194,4 @@ export const NewClientPolicyCondition = () => {
</FormPanel> </FormPanel>
</PageSection> </PageSection>
); );
}; }

View file

@ -56,7 +56,7 @@ type PolicyDetailAttributes = {
name: string; name: string;
}; };
export const NewClientPolicyForm = () => { export default function NewClientPolicyForm() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const { errors, reset: resetForm } = useForm<NewClientPolicyForm>({ const { errors, reset: resetForm } = useForm<NewClientPolicyForm>({
defaultValues, defaultValues,
@ -655,4 +655,4 @@ export const NewClientPolicyForm = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -24,14 +24,15 @@ import { prettyPrintJSON } from "../util";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { toAddClientProfile } from "./routes/AddClientProfile"; import { toAddClientProfile } from "./routes/AddClientProfile";
import type ClientProfileRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation"; import type ClientProfileRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation";
import "./RealmSettingsSection.css";
import { toClientProfile } from "./routes/ClientProfile"; import { toClientProfile } from "./routes/ClientProfile";
import "./RealmSettingsSection.css";
type ClientProfile = ClientProfileRepresentation & { type ClientProfile = ClientProfileRepresentation & {
global: boolean; global: boolean;
}; };
export const ProfilesTab = () => { export default function ProfilesTab() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { realm } = useRealm(); const { realm } = useRealm();
@ -281,4 +282,4 @@ export const ProfilesTab = () => {
)} )}
</> </>
); );
}; }

View file

@ -87,7 +87,7 @@ const sortByPriority = (components: ComponentRepresentation[]) => {
return sortedComponents; return sortedComponents;
}; };
export const RealmSettingsSection = () => { export default function RealmSettingsSection() {
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { realm: realmName } = useRealm(); const { realm: realmName } = useRealm();
const [realm, setRealm] = useState<RealmRepresentation>(); const [realm, setRealm] = useState<RealmRepresentation>();
@ -130,4 +130,4 @@ export const RealmSettingsSection = () => {
realmComponents={realmComponents} realmComponents={realmComponents}
/> />
); );
}; }

View file

@ -40,7 +40,7 @@ import { SecurityDefences } from "./security-defences/SecurityDefences";
import { RealmSettingsSessionsTab } from "./SessionsTab"; import { RealmSettingsSessionsTab } from "./SessionsTab";
import { RealmSettingsThemesTab } from "./ThemesTab"; import { RealmSettingsThemesTab } from "./ThemesTab";
import { RealmSettingsTokensTab } from "./TokensTab"; import { RealmSettingsTokensTab } from "./TokensTab";
import { ProfilesTab } from "./ProfilesTab"; import ProfilesTab from "./ProfilesTab";
import { PoliciesTab } from "./PoliciesTab"; import { PoliciesTab } from "./PoliciesTab";
import { PartialImportDialog } from "./PartialImport"; import { PartialImportDialog } from "./PartialImport";
import { PartialExportDialog } from "./PartialExport"; import { PartialExportDialog } from "./PartialExport";

View file

@ -92,7 +92,7 @@ export const AESGeneratedForm = ({
if ( if (
key === "config" && key === "config" &&
component.config?.secretSize && component.config?.secretSize &&
component.config?.active component.config.active
) { ) {
form.setValue("config.secretSize", value.secretSize[0]); form.setValue("config.secretSize", value.secretSize[0]);
@ -338,7 +338,7 @@ export const AESGeneratedForm = ({
); );
}; };
export const AESGeneratedSettings = () => { export default function AESGeneratedSettings() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const providerId = useRouteMatch<MatchParams>( const providerId = useRouteMatch<MatchParams>(
"/:realm/realm-settings/keys/:id?/:providerType?/settings" "/:realm/realm-settings/keys/:id?/:providerType?/settings"
@ -351,4 +351,4 @@ export const AESGeneratedSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -92,7 +92,7 @@ export const ECDSAGeneratedForm = ({
if ( if (
key === "config" && key === "config" &&
component.config?.ecdsaEllipticCurveKey && component.config?.ecdsaEllipticCurveKey &&
component.config?.active component.config.active
) { ) {
form.setValue("config.secretSize", value.ecdsaEllipticCurveKey[0]); form.setValue("config.secretSize", value.ecdsaEllipticCurveKey[0]);
@ -329,7 +329,7 @@ export const ECDSAGeneratedForm = ({
); );
}; };
export const ECDSAGeneratedSettings = () => { export default function ECDSAGeneratedSettings() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const providerId = useRouteMatch<MatchParams>( const providerId = useRouteMatch<MatchParams>(
"/:realm/realm-settings/keys/:id?/:providerType?/settings" "/:realm/realm-settings/keys/:id?/:providerType?/settings"
@ -342,4 +342,4 @@ export const ECDSAGeneratedSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -94,8 +94,8 @@ export const HMACGeneratedForm = ({
if ( if (
key === "config" && key === "config" &&
component.config?.secretSize && component.config?.secretSize &&
component.config?.active && component.config.active &&
component.config?.algorithm component.config.algorithm
) { ) {
form.setValue("config.secretSize", value.secretSize[0]); form.setValue("config.secretSize", value.secretSize[0]);
@ -380,7 +380,7 @@ export const HMACGeneratedForm = ({
); );
}; };
export const HMACGeneratedSettings = () => { export default function HMACGeneratedSettings() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const providerId = useRouteMatch<MatchParams>( const providerId = useRouteMatch<MatchParams>(
"/:realm/realm-settings/keys/:id?/:providerType?/settings" "/:realm/realm-settings/keys/:id?/:providerType?/settings"
@ -393,4 +393,4 @@ export const HMACGeneratedSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -92,12 +92,12 @@ export const JavaKeystoreForm = ({
if ( if (
key === "config" && key === "config" &&
component.config?.secretSize && component.config?.secretSize &&
component.config?.active && component.config.active &&
component.config?.algorithm && component.config.algorithm &&
component.config?.keystore && component.config.keystore &&
component.config?.keystorePassword && component.config.keystorePassword &&
component.config?.keyAlias && component.config.keyAlias &&
component.config?.keyPassword component.config.keyPassword
) { ) {
form.setValue("config.secretSize", value.secretSize[0]); form.setValue("config.secretSize", value.secretSize[0]);
@ -449,7 +449,7 @@ export const JavaKeystoreForm = ({
); );
}; };
export const JavaKeystoreSettings = () => { export default function JavaKeystoreSettings() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const providerId = useRouteMatch<MatchParams>( const providerId = useRouteMatch<MatchParams>(
"/:realm/realm-settings/keys/:id?/:providerType?/settings" "/:realm/realm-settings/keys/:id?/:providerType?/settings"
@ -462,4 +462,4 @@ export const JavaKeystoreSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -94,8 +94,8 @@ export const RSAGeneratedForm = ({
if ( if (
key === "config" && key === "config" &&
component.config?.secretSize && component.config?.secretSize &&
component.config?.active && component.config.active &&
component.config?.algorithm component.config.algorithm
) { ) {
form.setValue("config.secretSize", value.secretSize[0]); form.setValue("config.secretSize", value.secretSize[0]);
@ -381,7 +381,7 @@ export const RSAGeneratedForm = ({
); );
}; };
export const RSAGeneratedSettings = () => { export default function RSAGeneratedSettings() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const providerId = useRouteMatch<MatchParams>( const providerId = useRouteMatch<MatchParams>(
"/:realm/realm-settings/keys/:id?/:providerType?/settings" "/:realm/realm-settings/keys/:id?/:providerType?/settings"
@ -394,4 +394,4 @@ export const RSAGeneratedSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -99,10 +99,10 @@ export const RSAForm = ({
if ( if (
key === "config" && key === "config" &&
component.config?.secretSize && component.config?.secretSize &&
component.config?.active && component.config.active &&
component.config?.algorithm && component.config.algorithm &&
component.config?.privateKey && component.config.privateKey &&
component.config?.certificate component.config.certificate
) { ) {
form.setValue("config.secretSize", value.secretSize[0]); form.setValue("config.secretSize", value.secretSize[0]);
@ -407,7 +407,7 @@ export const RSAForm = ({
); );
}; };
export const RSASettings = () => { export default function RSASettings() {
const { t } = useTranslation("realm-settings"); const { t } = useTranslation("realm-settings");
const providerId = useRouteMatch<MatchParams>( const providerId = useRouteMatch<MatchParams>(
"/:realm/realm-settings/keys/:id?/:providerType?/settings" "/:realm/realm-settings/keys/:id?/:providerType?/settings"
@ -420,4 +420,4 @@ export const RSASettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,14 +1,14 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { NewClientPolicyForm } from "../NewClientPolicyForm";
import { NewPolicyCrumb } from "../RealmSettingsSection"; import { NewPolicyCrumb } from "../RealmSettingsSection";
export type AddClientPolicyParams = { realm: string }; export type AddClientPolicyParams = { realm: string };
export const AddClientPolicyRoute: RouteDef = { export const AddClientPolicyRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/add-client-policy", path: "/:realm/realm-settings/clientPolicies/add-client-policy",
component: NewClientPolicyForm, component: lazy(() => import("../NewClientPolicyForm")),
breadcrumb: () => NewPolicyCrumb, breadcrumb: () => NewPolicyCrumb,
access: "manage-clients", access: "manage-clients",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ClientProfileForm } from "../ClientProfileForm";
export type AddClientProfileParams = { export type AddClientProfileParams = {
realm: string; realm: string;
@ -9,7 +9,7 @@ export type AddClientProfileParams = {
export const AddClientProfileRoute: RouteDef = { export const AddClientProfileRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/add-profile", path: "/:realm/realm-settings/clientPolicies/add-profile",
component: ClientProfileForm, component: lazy(() => import("../ClientProfileForm")),
breadcrumb: (t) => t("realm-settings:newClientProfile"), breadcrumb: (t) => t("realm-settings:newClientProfile"),
access: "manage-realm", access: "manage-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { NewClientPolicyCondition } from "../NewClientPolicyCondition";
export type NewClientPolicyConditionParams = { export type NewClientPolicyConditionParams = {
realm: string; realm: string;
@ -10,7 +10,7 @@ export type NewClientPolicyConditionParams = {
export const NewClientPolicyConditionRoute: RouteDef = { export const NewClientPolicyConditionRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/:policyName?/edit-policy/create-condition", path: "/:realm/realm-settings/clientPolicies/:policyName?/edit-policy/create-condition",
component: NewClientPolicyCondition, component: lazy(() => import("../NewClientPolicyCondition")),
breadcrumb: (t) => t("realm-settings:addCondition"), breadcrumb: (t) => t("realm-settings:addCondition"),
access: "manage-clients", access: "manage-clients",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ExecutorForm } from "../ExecutorForm";
export type AddExecutorParams = { export type AddExecutorParams = {
realm: string; realm: string;
@ -10,7 +10,7 @@ export type AddExecutorParams = {
export const AddExecutorRoute: RouteDef = { export const AddExecutorRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/:profileName/add-executor", path: "/:realm/realm-settings/clientPolicies/:profileName/add-executor",
component: ExecutorForm, component: lazy(() => import("../ExecutorForm")),
breadcrumb: (t) => t("realm-settings:addExecutor"), breadcrumb: (t) => t("realm-settings:addExecutor"),
access: "manage-realm", access: "manage-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { AESGeneratedSettings } from "../key-providers/aes-generated/AESGeneratedForm";
import { EditProviderCrumb } from "../RealmSettingsSection"; import { EditProviderCrumb } from "../RealmSettingsSection";
export type AesGeneratedSettingsParams = { export type AesGeneratedSettingsParams = {
@ -11,7 +11,9 @@ export type AesGeneratedSettingsParams = {
export const AesGeneratedSettingsRoute: RouteDef = { export const AesGeneratedSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/keys/:id/aes-generated/settings", path: "/:realm/realm-settings/keys/:id/aes-generated/settings",
component: AESGeneratedSettings, component: lazy(
() => import("../key-providers/aes-generated/AESGeneratedForm")
),
breadcrumb: () => EditProviderCrumb, breadcrumb: () => EditProviderCrumb,
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ProfilesTab } from "../ProfilesTab";
export type ClientPoliciesParams = { export type ClientPoliciesParams = {
realm: string; realm: string;
@ -9,7 +9,7 @@ export type ClientPoliciesParams = {
export const ClientPoliciesRoute: RouteDef = { export const ClientPoliciesRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies", path: "/:realm/realm-settings/clientPolicies",
component: ProfilesTab, component: lazy(() => import("../ProfilesTab")),
breadcrumb: (t) => t("realm-settings:allClientPolicies"), breadcrumb: (t) => t("realm-settings:allClientPolicies"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ClientProfileForm } from "../ClientProfileForm";
export type ClientProfileParams = { export type ClientProfileParams = {
realm: string; realm: string;
@ -10,7 +10,7 @@ export type ClientProfileParams = {
export const ClientProfileRoute: RouteDef = { export const ClientProfileRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/:profileName/edit-profile", path: "/:realm/realm-settings/clientPolicies/:profileName/edit-profile",
component: ClientProfileForm, component: lazy(() => import("../ClientProfileForm")),
breadcrumb: (t) => t("realm-settings:clientProfile"), breadcrumb: (t) => t("realm-settings:clientProfile"),
access: ["view-realm", "view-users"], access: ["view-realm", "view-users"],
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { ECDSAGeneratedSettings } from "../key-providers/ecdsa-generated/ECDSAGeneratedForm";
import { EditProviderCrumb } from "../RealmSettingsSection"; import { EditProviderCrumb } from "../RealmSettingsSection";
export type EcdsaGeneratedSettingsParams = { export type EcdsaGeneratedSettingsParams = {
@ -11,7 +11,9 @@ export type EcdsaGeneratedSettingsParams = {
export const EcdsaGeneratedSettingsRoute: RouteDef = { export const EcdsaGeneratedSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/keys/:id/ecdsa-generated/settings", path: "/:realm/realm-settings/keys/:id/ecdsa-generated/settings",
component: ECDSAGeneratedSettings, component: lazy(
() => import("../key-providers/ecdsa-generated/ECDSAGeneratedForm")
),
breadcrumb: () => EditProviderCrumb, breadcrumb: () => EditProviderCrumb,
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { NewClientPolicyForm } from "../NewClientPolicyForm";
import { EditPolicyCrumb } from "../RealmSettingsSection"; import { EditPolicyCrumb } from "../RealmSettingsSection";
export type EditClientPolicyParams = { export type EditClientPolicyParams = {
@ -11,7 +11,7 @@ export type EditClientPolicyParams = {
export const EditClientPolicyRoute: RouteDef = { export const EditClientPolicyRoute: RouteDef = {
path: "/:realm/realm-settings/clientPolicies/:policyName/edit-policy", path: "/:realm/realm-settings/clientPolicies/:policyName/edit-policy",
component: NewClientPolicyForm, component: lazy(() => import("../NewClientPolicyForm")),
access: "manage-realm", access: "manage-realm",
breadcrumb: () => EditPolicyCrumb, breadcrumb: () => EditPolicyCrumb,
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { HMACGeneratedSettings } from "../key-providers/hmac-generated/HMACGeneratedForm";
import { EditProviderCrumb } from "../RealmSettingsSection"; import { EditProviderCrumb } from "../RealmSettingsSection";
export type HmacGeneratedSettingsParams = { export type HmacGeneratedSettingsParams = {
@ -11,7 +11,9 @@ export type HmacGeneratedSettingsParams = {
export const HmacGeneratedSettingsRoute: RouteDef = { export const HmacGeneratedSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/keys/:id/hmac-generated/settings", path: "/:realm/realm-settings/keys/:id/hmac-generated/settings",
component: HMACGeneratedSettings, component: lazy(
() => import("../key-providers/hmac-generated/HMACGeneratedForm")
),
breadcrumb: () => EditProviderCrumb, breadcrumb: () => EditProviderCrumb,
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { JavaKeystoreSettings } from "../key-providers/java-keystore/JavaKeystoreForm";
import { EditProviderCrumb } from "../RealmSettingsSection"; import { EditProviderCrumb } from "../RealmSettingsSection";
export type JavaKeystoreSettingsParams = { export type JavaKeystoreSettingsParams = {
@ -11,7 +11,9 @@ export type JavaKeystoreSettingsParams = {
export const JavaKeystoreSettingsRoute: RouteDef = { export const JavaKeystoreSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/keys/:id/java-keystore/settings", path: "/:realm/realm-settings/keys/:id/java-keystore/settings",
component: JavaKeystoreSettings, component: lazy(
() => import("../key-providers/java-keystore/JavaKeystoreForm")
),
breadcrumb: () => EditProviderCrumb, breadcrumb: () => EditProviderCrumb,
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RealmSettingsSection } from "../RealmSettingsSection";
export type RealmSettingsTab = export type RealmSettingsTab =
| "general" | "general"
@ -22,7 +22,7 @@ export type RealmSettingsParams = {
export const RealmSettingsRoute: RouteDef = { export const RealmSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/:tab?", path: "/:realm/realm-settings/:tab?",
component: RealmSettingsSection, component: lazy(() => import("../RealmSettingsSection")),
breadcrumb: (t) => t("realmSettings"), breadcrumb: (t) => t("realmSettings"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RSAGeneratedSettings } from "../key-providers/rsa-generated/RSAGeneratedForm";
import { EditProviderCrumb } from "../RealmSettingsSection"; import { EditProviderCrumb } from "../RealmSettingsSection";
export type RsaGeneratedSettingsParams = { export type RsaGeneratedSettingsParams = {
@ -11,7 +11,9 @@ export type RsaGeneratedSettingsParams = {
export const RsaGeneratedSettingsRoute: RouteDef = { export const RsaGeneratedSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/keys/:id/rsa-generated/settings", path: "/:realm/realm-settings/keys/:id/rsa-generated/settings",
component: RSAGeneratedSettings, component: lazy(
() => import("../key-providers/rsa-generated/RSAGeneratedForm")
),
breadcrumb: () => EditProviderCrumb, breadcrumb: () => EditProviderCrumb,
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { RSASettings } from "../key-providers/rsa/RSAForm";
import { EditProviderCrumb } from "../RealmSettingsSection"; import { EditProviderCrumb } from "../RealmSettingsSection";
export type RsaSettingsParams = { export type RsaSettingsParams = {
@ -11,7 +11,7 @@ export type RsaSettingsParams = {
export const RsaSettingsRoute: RouteDef = { export const RsaSettingsRoute: RouteDef = {
path: "/:realm/realm-settings/keys/:id/rsa/settings", path: "/:realm/realm-settings/keys/:id/rsa/settings",
component: RSASettings, component: lazy(() => import("../key-providers/rsa/RSAForm")),
breadcrumb: () => EditProviderCrumb, breadcrumb: () => EditProviderCrumb,
access: "view-realm", access: "view-realm",
}; };

View file

@ -21,7 +21,7 @@ import { useRealm } from "../../context/realm-context/RealmContext";
import { useWhoAmI } from "../../context/whoami/WhoAmI"; import { useWhoAmI } from "../../context/whoami/WhoAmI";
import { toDashboard } from "../../dashboard/routes/Dashboard"; import { toDashboard } from "../../dashboard/routes/Dashboard";
export const NewRealmForm = () => { export default function NewRealmForm() {
const { t } = useTranslation("realm"); const { t } = useTranslation("realm");
const history = useHistory(); const history = useHistory();
const { refresh } = useWhoAmI(); const { refresh } = useWhoAmI();
@ -111,4 +111,4 @@ export const NewRealmForm = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { NewRealmForm } from "../add/NewRealmForm";
export type AddRealmParams = { realm: string }; export type AddRealmParams = { realm: string };
export const AddRealmRoute: RouteDef = { export const AddRealmRoute: RouteDef = {
path: "/:realm/add-realm", path: "/:realm/add-realm",
component: NewRealmForm, component: lazy(() => import("../add/NewRealmForm")),
breadcrumb: (t) => t("realm:createRealm"), breadcrumb: (t) => t("realm:createRealm"),
access: "manage-realm", access: "manage-realm",
}; };

View file

@ -35,7 +35,7 @@ const Clients = (row: UserSessionRepresentation) => {
); );
}; };
export const SessionsSection = () => { export default function SessionsSection() {
const { t } = useTranslation("sessions"); const { t } = useTranslation("sessions");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const [filterDropdownOpen, setFilterDropdownOpen] = useState(false); const [filterDropdownOpen, setFilterDropdownOpen] = useState(false);
@ -213,4 +213,4 @@ export const SessionsSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { SessionsSection } from "../SessionsSection";
export type SessionsParams = { realm: string }; export type SessionsParams = { realm: string };
export const SessionsRoute: RouteDef = { export const SessionsRoute: RouteDef = {
path: "/:realm/sessions", path: "/:realm/sessions",
component: SessionsSection, component: lazy(() => import("../SessionsSection")),
breadcrumb: (t) => t("sessions:title"), breadcrumb: (t) => t("sessions:title"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -79,7 +79,7 @@ const KerberosSettingsHeader = ({
); );
}; };
export const UserFederationKerberosSettings = () => { export default function UserFederationKerberosSettings() {
const { t } = useTranslation("user-federation"); const { t } = useTranslation("user-federation");
const form = useForm<ComponentRepresentation>({ mode: "onChange" }); const form = useForm<ComponentRepresentation>({ mode: "onChange" });
const history = useHistory(); const history = useHistory();
@ -199,4 +199,4 @@ export const UserFederationKerberosSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -172,7 +172,7 @@ const LdapSettingsHeader = ({
); );
}; };
export const UserFederationLdapSettings = () => { export default function UserFederationLdapSettings() {
const { t } = useTranslation("user-federation"); const { t } = useTranslation("user-federation");
const form = useForm<ComponentRepresentation>({ mode: "onChange" }); const form = useForm<ComponentRepresentation>({ mode: "onChange" });
const history = useHistory(); const history = useHistory();
@ -373,4 +373,4 @@ export const UserFederationLdapSettings = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -26,7 +26,7 @@ import { useAdminClient, useFetch } from "../context/auth/AdminClient";
import { useRealm } from "../context/realm-context/RealmContext"; import { useRealm } from "../context/realm-context/RealmContext";
import "./user-federation.css"; import "./user-federation.css";
export const UserFederationSection = () => { export default function UserFederationSection() {
const [userFederations, setUserFederations] = const [userFederations, setUserFederations] =
useState<ComponentRepresentation[]>(); useState<ComponentRepresentation[]>();
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
@ -205,4 +205,4 @@ export const UserFederationSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -35,7 +35,7 @@ import { LdapMapperHardcodedAttribute } from "./LdapMapperHardcodedAttribute";
import { LdapMapperRoleGroup } from "./LdapMapperRoleGroup"; import { LdapMapperRoleGroup } from "./LdapMapperRoleGroup";
import { useRealm } from "../../../context/realm-context/RealmContext"; import { useRealm } from "../../../context/realm-context/RealmContext";
export const LdapMapperDetails = () => { export default function LdapMapperDetails() {
const form = useForm<ComponentRepresentation>(); const form = useForm<ComponentRepresentation>();
const [mapping, setMapping] = useState<ComponentRepresentation>(); const [mapping, setMapping] = useState<ComponentRepresentation>();
@ -400,4 +400,4 @@ export const LdapMapperDetails = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UserFederationKerberosSettings } from "../UserFederationKerberosSettings";
export type NewKerberosUserFederationParams = { realm: string }; export type NewKerberosUserFederationParams = { realm: string };
export const NewKerberosUserFederationRoute: RouteDef = { export const NewKerberosUserFederationRoute: RouteDef = {
path: "/:realm/user-federation/kerberos/new", path: "/:realm/user-federation/kerberos/new",
component: UserFederationKerberosSettings, component: lazy(() => import("../UserFederationKerberosSettings")),
breadcrumb: (t) => t("common:settings"), breadcrumb: (t) => t("common:settings"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UserFederationLdapSettings } from "../UserFederationLdapSettings";
export type NewLdapUserFederationParams = { realm: string }; export type NewLdapUserFederationParams = { realm: string };
export const NewLdapUserFederationRoute: RouteDef = { export const NewLdapUserFederationRoute: RouteDef = {
path: "/:realm/user-federation/ldap/new", path: "/:realm/user-federation/ldap/new",
component: UserFederationLdapSettings, component: lazy(() => import("../UserFederationLdapSettings")),
breadcrumb: (t) => t("user-federation:addOneLdap"), breadcrumb: (t) => t("user-federation:addOneLdap"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UserFederationSection } from "../UserFederationSection";
export type UserFederationParams = { realm: string }; export type UserFederationParams = { realm: string };
export const UserFederationRoute: RouteDef = { export const UserFederationRoute: RouteDef = {
path: "/:realm/user-federation", path: "/:realm/user-federation",
component: UserFederationSection, component: lazy(() => import("../UserFederationSection")),
breadcrumb: (t) => t("userFederation"), breadcrumb: (t) => t("userFederation"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UserFederationKerberosSettings } from "../UserFederationKerberosSettings";
export type UserFederationKerberosParams = { export type UserFederationKerberosParams = {
realm: string; realm: string;
@ -10,7 +10,7 @@ export type UserFederationKerberosParams = {
export const UserFederationKerberosRoute: RouteDef = { export const UserFederationKerberosRoute: RouteDef = {
path: "/:realm/user-federation/kerberos/:id", path: "/:realm/user-federation/kerberos/:id",
component: UserFederationKerberosSettings, component: lazy(() => import("../UserFederationKerberosSettings")),
breadcrumb: (t) => t("common:settings"), breadcrumb: (t) => t("common:settings"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UserFederationLdapSettings } from "../UserFederationLdapSettings";
export type UserFederationLdapParams = { export type UserFederationLdapParams = {
realm: string; realm: string;
@ -11,7 +11,7 @@ export type UserFederationLdapParams = {
export const UserFederationLdapRoute: RouteDef = { export const UserFederationLdapRoute: RouteDef = {
path: "/:realm/user-federation/ldap/:id/:tab?", path: "/:realm/user-federation/ldap/:id/:tab?",
component: UserFederationLdapSettings, component: lazy(() => import("../UserFederationLdapSettings")),
breadcrumb: (t) => t("common:settings"), breadcrumb: (t) => t("common:settings"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,7 +1,7 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { LdapMapperDetails } from "../ldap/mappers/LdapMapperDetails";
export type UserFederationLdapMapperParams = { export type UserFederationLdapMapperParams = {
realm: string; realm: string;
@ -12,7 +12,7 @@ export type UserFederationLdapMapperParams = {
export const UserFederationLdapMapperRoute: RouteDef = { export const UserFederationLdapMapperRoute: RouteDef = {
path: "/:realm/user-federation/ldap/:id/:tab/:mapperId", path: "/:realm/user-federation/ldap/:id/:tab/:mapperId",
component: LdapMapperDetails, component: lazy(() => import("../ldap/mappers/LdapMapperDetails")),
breadcrumb: (t) => t("common:mappingDetails"), breadcrumb: (t) => t("common:mappingDetails"),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UserFederationSection } from "../UserFederationSection";
export type UserFederationsKerberosParams = { realm: string }; export type UserFederationsKerberosParams = { realm: string };
export const UserFederationsKerberosRoute: RouteDef = { export const UserFederationsKerberosRoute: RouteDef = {
path: "/:realm/user-federation/kerberos", path: "/:realm/user-federation/kerberos",
component: UserFederationSection, component: lazy(() => import("../UserFederationSection")),
access: "view-realm", access: "view-realm",
}; };

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UserFederationSection } from "../UserFederationSection";
export type UserFederationsLdapParams = { realm: string }; export type UserFederationsLdapParams = { realm: string };
export const UserFederationsLdapRoute: RouteDef = { export const UserFederationsLdapRoute: RouteDef = {
path: "/:realm/user-federation/ldap", path: "/:realm/user-federation/ldap",
component: UserFederationSection, component: lazy(() => import("../UserFederationSection")),
access: "view-realm", access: "view-realm",
}; };

View file

@ -44,7 +44,7 @@ type BruteUser = UserRepresentation & {
brute?: Record<string, object>; brute?: Record<string, object>;
}; };
export const UsersSection = () => { export default function UsersSection() {
const { t } = useTranslation("users"); const { t } = useTranslation("users");
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { addAlert, addError } = useAlerts(); const { addAlert, addError } = useAlerts();
@ -355,4 +355,4 @@ export const UsersSection = () => {
</PageSection> </PageSection>
</> </>
); );
}; }

View file

@ -1,13 +1,13 @@
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { lazy } from "react";
import { generatePath } from "react-router-dom"; import { generatePath } from "react-router-dom";
import type { RouteDef } from "../../route-config"; import type { RouteDef } from "../../route-config";
import { UsersSection } from "../UsersSection";
export type UsersParams = { realm: string }; export type UsersParams = { realm: string };
export const UsersRoute: RouteDef = { export const UsersRoute: RouteDef = {
path: "/:realm/users", path: "/:realm/users",
component: UsersSection, component: lazy(() => import("../UsersSection")),
breadcrumb: (t) => t("users:title"), breadcrumb: (t) => t("users:title"),
access: "query-users", access: "query-users",
}; };