2021-09-02 20:14:43 +00:00
|
|
|
import React, { useEffect, useState } from "react";
|
|
|
|
import { useHistory } from "react-router-dom";
|
2022-01-03 15:00:03 +00:00
|
|
|
import { Controller, FormProvider, useForm, useWatch } from "react-hook-form";
|
2021-09-02 20:14:43 +00:00
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import {
|
|
|
|
AlertVariant,
|
|
|
|
ButtonVariant,
|
|
|
|
DropdownItem,
|
|
|
|
DropdownSeparator,
|
|
|
|
PageSection,
|
|
|
|
Tab,
|
|
|
|
TabTitleText,
|
|
|
|
} from "@patternfly/react-core";
|
|
|
|
|
|
|
|
import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation";
|
|
|
|
import type ComponentRepresentation from "@keycloak/keycloak-admin-client/lib/defs/componentRepresentation";
|
|
|
|
|
|
|
|
import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog";
|
2022-01-14 10:05:50 +00:00
|
|
|
import {
|
|
|
|
routableTab,
|
|
|
|
RoutableTabs,
|
|
|
|
} from "../components/routable-tabs/RoutableTabs";
|
2021-09-02 20:14:43 +00:00
|
|
|
import { useRealm } from "../context/realm-context/RealmContext";
|
2021-11-11 16:04:04 +00:00
|
|
|
import { useRealms } from "../context/RealmsContext";
|
2021-09-02 20:14:43 +00:00
|
|
|
import { ViewHeader } from "../components/view-header/ViewHeader";
|
|
|
|
import { useAdminClient } from "../context/auth/AdminClient";
|
|
|
|
import { useServerInfo } from "../context/server-info/ServerInfoProvider";
|
|
|
|
import { useAlerts } from "../components/alert/Alerts";
|
|
|
|
import {
|
|
|
|
convertFormValuesToObject,
|
|
|
|
convertToFormValues,
|
|
|
|
KEY_PROVIDER_TYPE,
|
|
|
|
toUpperCase,
|
|
|
|
} from "../util";
|
|
|
|
|
|
|
|
import { RealmSettingsEmailTab } from "./EmailTab";
|
|
|
|
import { EventsTab } from "./event-config/EventsTab";
|
|
|
|
import { RealmSettingsGeneralTab } from "./GeneralTab";
|
|
|
|
import { KeysListTab } from "./KeysListTab";
|
|
|
|
import { KeysProvidersTab } from "./KeysProvidersTab";
|
|
|
|
import { RealmSettingsLoginTab } from "./LoginTab";
|
|
|
|
import { SecurityDefences } from "./security-defences/SecurityDefences";
|
|
|
|
import { RealmSettingsSessionsTab } from "./SessionsTab";
|
|
|
|
import { RealmSettingsThemesTab } from "./ThemesTab";
|
|
|
|
import { RealmSettingsTokensTab } from "./TokensTab";
|
2021-10-29 16:11:06 +00:00
|
|
|
import ProfilesTab from "./ProfilesTab";
|
2021-09-09 10:45:19 +00:00
|
|
|
import { PoliciesTab } from "./PoliciesTab";
|
2021-09-02 20:14:43 +00:00
|
|
|
import { PartialImportDialog } from "./PartialImport";
|
2021-10-29 02:50:25 +00:00
|
|
|
import { PartialExportDialog } from "./PartialExport";
|
2022-01-31 07:19:44 +00:00
|
|
|
import { RealmSettingsTab, toRealmSettings } from "./routes/RealmSettings";
|
2021-09-02 20:14:43 +00:00
|
|
|
import { LocalizationTab } from "./LocalizationTab";
|
2021-09-09 10:45:19 +00:00
|
|
|
import { HelpItem } from "../components/help-enabler/HelpItem";
|
2021-11-16 11:10:10 +00:00
|
|
|
import { UserRegistration } from "./UserRegistration";
|
2021-11-11 16:04:04 +00:00
|
|
|
import { toDashboard } from "../dashboard/routes/Dashboard";
|
|
|
|
import environment from "../environment";
|
2021-12-21 15:32:53 +00:00
|
|
|
import helpUrls from "../help-urls";
|
2022-01-03 15:00:03 +00:00
|
|
|
import { UserProfileTab } from "./user-profile/UserProfileTab";
|
|
|
|
import useIsFeatureEnabled, { Feature } from "../utils/useIsFeatureEnabled";
|
2022-01-31 07:19:44 +00:00
|
|
|
import { ClientPoliciesTab, toClientPolicies } from "./routes/ClientPolicies";
|
|
|
|
import { KeySubTab, toKeysTab } from "./routes/KeysTab";
|
2021-09-02 20:14:43 +00:00
|
|
|
|
|
|
|
type RealmSettingsHeaderProps = {
|
|
|
|
onChange: (value: boolean) => void;
|
|
|
|
value: boolean;
|
|
|
|
save: () => void;
|
|
|
|
realmName: string;
|
2021-09-27 17:15:36 +00:00
|
|
|
refresh: () => void;
|
2021-09-02 20:14:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const RealmSettingsHeader = ({
|
|
|
|
save,
|
|
|
|
onChange,
|
|
|
|
value,
|
|
|
|
realmName,
|
2021-09-27 17:15:36 +00:00
|
|
|
refresh,
|
2021-09-02 20:14:43 +00:00
|
|
|
}: RealmSettingsHeaderProps) => {
|
|
|
|
const { t } = useTranslation("realm-settings");
|
|
|
|
const adminClient = useAdminClient();
|
2021-11-11 16:04:04 +00:00
|
|
|
const { refresh: refreshRealms } = useRealms();
|
2021-09-02 20:14:43 +00:00
|
|
|
const { addAlert, addError } = useAlerts();
|
|
|
|
const history = useHistory();
|
|
|
|
const [partialImportOpen, setPartialImportOpen] = useState(false);
|
2021-10-29 02:50:25 +00:00
|
|
|
const [partialExportOpen, setPartialExportOpen] = useState(false);
|
2021-09-02 20:14:43 +00:00
|
|
|
|
|
|
|
const [toggleDisableDialog, DisableConfirm] = useConfirmDialog({
|
|
|
|
titleKey: "realm-settings:disableConfirmTitle",
|
|
|
|
messageKey: "realm-settings:disableConfirm",
|
|
|
|
continueButtonLabel: "common:disable",
|
|
|
|
onConfirm: () => {
|
|
|
|
onChange(!value);
|
|
|
|
save();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
|
|
|
|
titleKey: "realm-settings:deleteConfirmTitle",
|
|
|
|
messageKey: "realm-settings:deleteConfirm",
|
|
|
|
continueButtonLabel: "common:delete",
|
|
|
|
continueButtonVariant: ButtonVariant.danger,
|
|
|
|
onConfirm: async () => {
|
|
|
|
try {
|
|
|
|
await adminClient.realms.del({ realm: realmName });
|
|
|
|
addAlert(t("deletedSuccess"), AlertVariant.success);
|
2021-11-11 16:04:04 +00:00
|
|
|
await refreshRealms();
|
|
|
|
history.push(toDashboard({ realm: environment.masterRealm }));
|
2021-09-02 20:14:43 +00:00
|
|
|
refresh();
|
|
|
|
} catch (error) {
|
|
|
|
addError("realm-settings:deleteError", error);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<DisableConfirm />
|
|
|
|
<DeleteConfirm />
|
|
|
|
<PartialImportDialog
|
|
|
|
open={partialImportOpen}
|
|
|
|
toggleDialog={() => setPartialImportOpen(!partialImportOpen)}
|
|
|
|
/>
|
2021-10-29 02:50:25 +00:00
|
|
|
<PartialExportDialog
|
|
|
|
isOpen={partialExportOpen}
|
|
|
|
onClose={() => setPartialExportOpen(false)}
|
|
|
|
/>
|
2021-09-02 20:14:43 +00:00
|
|
|
<ViewHeader
|
|
|
|
titleKey={toUpperCase(realmName)}
|
2021-12-21 15:32:53 +00:00
|
|
|
subKey="realm-settings:realmSettingsExplain"
|
|
|
|
helpUrl={helpUrls.realmSettingsUrl}
|
2021-09-02 20:14:43 +00:00
|
|
|
divider={false}
|
|
|
|
dropdownItems={[
|
|
|
|
<DropdownItem
|
|
|
|
key="import"
|
|
|
|
data-testid="openPartialImportModal"
|
|
|
|
onClick={() => {
|
|
|
|
setPartialImportOpen(true);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{t("partialImport")}
|
|
|
|
</DropdownItem>,
|
2021-10-29 02:50:25 +00:00
|
|
|
<DropdownItem
|
|
|
|
key="export"
|
|
|
|
data-testid="openPartialExportModal"
|
|
|
|
onClick={() => setPartialExportOpen(true)}
|
|
|
|
>
|
|
|
|
{t("partialExport")}
|
|
|
|
</DropdownItem>,
|
2021-09-02 20:14:43 +00:00
|
|
|
<DropdownSeparator key="separator" />,
|
|
|
|
<DropdownItem key="delete" onClick={toggleDeleteDialog}>
|
|
|
|
{t("common:delete")}
|
|
|
|
</DropdownItem>,
|
|
|
|
]}
|
|
|
|
isEnabled={value}
|
|
|
|
onToggle={(value) => {
|
|
|
|
if (!value) {
|
|
|
|
toggleDisableDialog();
|
|
|
|
} else {
|
|
|
|
onChange(value);
|
|
|
|
save();
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
type RealmSettingsTabsProps = {
|
|
|
|
realm: RealmRepresentation;
|
2021-09-27 17:15:36 +00:00
|
|
|
refresh: () => void;
|
2021-09-02 20:14:43 +00:00
|
|
|
realmComponents: ComponentRepresentation[];
|
|
|
|
};
|
|
|
|
|
|
|
|
export const RealmSettingsTabs = ({
|
|
|
|
realm,
|
|
|
|
realmComponents,
|
2021-09-27 17:15:36 +00:00
|
|
|
refresh,
|
2021-09-02 20:14:43 +00:00
|
|
|
}: RealmSettingsTabsProps) => {
|
|
|
|
const { t } = useTranslation("realm-settings");
|
|
|
|
const adminClient = useAdminClient();
|
|
|
|
const { addAlert, addError } = useAlerts();
|
2021-11-11 16:04:04 +00:00
|
|
|
const { realm: realmName } = useRealm();
|
|
|
|
const { refresh: refreshRealms } = useRealms();
|
2021-09-02 20:14:43 +00:00
|
|
|
const history = useHistory();
|
2022-01-03 15:00:03 +00:00
|
|
|
const isFeatureEnabled = useIsFeatureEnabled();
|
2021-09-02 20:14:43 +00:00
|
|
|
|
|
|
|
const kpComponentTypes =
|
|
|
|
useServerInfo().componentTypes?.[KEY_PROVIDER_TYPE] ?? [];
|
|
|
|
|
2021-11-03 19:47:42 +00:00
|
|
|
const form = useForm({ mode: "onChange", shouldUnregister: false });
|
2021-09-02 20:14:43 +00:00
|
|
|
const { control, getValues, setValue, reset: resetForm } = form;
|
|
|
|
|
|
|
|
const [key, setKey] = useState(0);
|
|
|
|
|
2021-09-27 17:15:36 +00:00
|
|
|
const refreshHeader = () => {
|
2021-09-02 20:14:43 +00:00
|
|
|
setKey(new Date().getTime());
|
|
|
|
};
|
|
|
|
|
|
|
|
const setupForm = (r: RealmRepresentation = realm) => {
|
2021-12-08 15:08:42 +00:00
|
|
|
convertToFormValues(r, setValue);
|
2021-09-02 20:14:43 +00:00
|
|
|
resetForm(getValues());
|
|
|
|
};
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
setupForm();
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
const save = async (realm: RealmRepresentation) => {
|
|
|
|
try {
|
2021-12-08 15:08:42 +00:00
|
|
|
realm = convertFormValuesToObject(realm);
|
2021-09-27 17:15:36 +00:00
|
|
|
|
2021-09-02 20:14:43 +00:00
|
|
|
await adminClient.realms.update(
|
|
|
|
{ realm: realmName },
|
2021-09-27 17:15:36 +00:00
|
|
|
{
|
|
|
|
...realm,
|
|
|
|
id: realmName,
|
|
|
|
}
|
2021-09-02 20:14:43 +00:00
|
|
|
);
|
|
|
|
setupForm(realm);
|
|
|
|
const isRealmRenamed = realmName !== realm.realm;
|
|
|
|
if (isRealmRenamed) {
|
2021-11-11 16:04:04 +00:00
|
|
|
await refreshRealms();
|
2022-01-31 07:19:44 +00:00
|
|
|
history.push(toRealmSettings({ realm: realm.realm!, tab: "general" }));
|
2021-09-02 20:14:43 +00:00
|
|
|
}
|
|
|
|
addAlert(t("saveSuccess"), AlertVariant.success);
|
|
|
|
} catch (error) {
|
|
|
|
addError("realm-settings:saveError", error);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-01-03 15:00:03 +00:00
|
|
|
const userProfileEnabled = useWatch({
|
|
|
|
control,
|
|
|
|
name: "attributes.userProfileEnabled",
|
|
|
|
defaultValue: "false",
|
|
|
|
});
|
|
|
|
|
2022-01-31 07:19:44 +00:00
|
|
|
const route = (tab: RealmSettingsTab | undefined = "general") =>
|
|
|
|
routableTab({
|
|
|
|
to: toRealmSettings({ realm: realmName, tab }),
|
|
|
|
history,
|
|
|
|
});
|
|
|
|
|
|
|
|
const policiesRoute = (tab: ClientPoliciesTab) =>
|
|
|
|
routableTab({
|
|
|
|
to: toClientPolicies({
|
|
|
|
realm: realmName,
|
|
|
|
tab,
|
|
|
|
}),
|
|
|
|
history,
|
|
|
|
});
|
|
|
|
|
|
|
|
const keysRoute = (tab: KeySubTab) =>
|
|
|
|
routableTab({
|
|
|
|
to: toKeysTab({ realm: realmName, tab }),
|
|
|
|
history,
|
|
|
|
});
|
2021-09-02 20:14:43 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Controller
|
|
|
|
name="enabled"
|
|
|
|
defaultValue={true}
|
|
|
|
control={control}
|
|
|
|
render={({ onChange, value }) => (
|
|
|
|
<RealmSettingsHeader
|
|
|
|
value={value}
|
|
|
|
onChange={onChange}
|
|
|
|
realmName={realmName}
|
2021-09-27 17:15:36 +00:00
|
|
|
refresh={refreshHeader}
|
2021-09-02 20:14:43 +00:00
|
|
|
save={() => save(getValues())}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
<PageSection variant="light" className="pf-u-p-0">
|
|
|
|
<FormProvider {...form}>
|
2022-01-31 07:19:44 +00:00
|
|
|
<RoutableTabs
|
|
|
|
isBox
|
|
|
|
mountOnEnter
|
|
|
|
defaultLocation={toRealmSettings({
|
|
|
|
realm: realmName,
|
|
|
|
tab: "general",
|
|
|
|
})}
|
|
|
|
>
|
2021-09-02 20:14:43 +00:00
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("general")}</TabTitleText>}
|
|
|
|
data-testid="rs-general-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route()}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<RealmSettingsGeneralTab
|
|
|
|
save={save}
|
|
|
|
reset={() => resetForm(realm)}
|
|
|
|
/>
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("login")}</TabTitleText>}
|
|
|
|
data-testid="rs-login-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("login")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
2021-09-27 17:15:36 +00:00
|
|
|
<RealmSettingsLoginTab
|
|
|
|
refresh={refresh}
|
|
|
|
save={save}
|
|
|
|
realm={realm}
|
|
|
|
/>
|
2021-09-02 20:14:43 +00:00
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("email")}</TabTitleText>}
|
|
|
|
data-testid="rs-email-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("email")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
2021-10-14 21:08:42 +00:00
|
|
|
<RealmSettingsEmailTab realm={realm} />
|
2021-09-02 20:14:43 +00:00
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("themes")}</TabTitleText>}
|
|
|
|
data-testid="rs-themes-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("themes")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<RealmSettingsThemesTab
|
|
|
|
save={save}
|
|
|
|
reset={() => resetForm(realm)}
|
|
|
|
/>
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("realm-settings:keys")}</TabTitleText>}
|
|
|
|
data-testid="rs-keys-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("keys")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
2022-01-31 07:19:44 +00:00
|
|
|
<RoutableTabs
|
|
|
|
defaultLocation={toKeysTab({ realm: realmName, tab: "list" })}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<Tab
|
|
|
|
id="keysList"
|
|
|
|
data-testid="rs-keys-list-tab"
|
|
|
|
aria-label="keys-list-subtab"
|
|
|
|
title={<TabTitleText>{t("keysList")}</TabTitleText>}
|
2022-01-31 07:19:44 +00:00
|
|
|
{...keysRoute("list")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<KeysListTab realmComponents={realmComponents} />
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
id="providers"
|
|
|
|
data-testid="rs-providers-tab"
|
|
|
|
aria-label="rs-providers-tab"
|
|
|
|
title={<TabTitleText>{t("providers")}</TabTitleText>}
|
2022-01-31 07:19:44 +00:00
|
|
|
{...keysRoute("providers")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<KeysProvidersTab
|
|
|
|
realmComponents={realmComponents}
|
|
|
|
keyProviderComponentTypes={kpComponentTypes}
|
|
|
|
refresh={refresh}
|
|
|
|
/>
|
|
|
|
</Tab>
|
2022-01-31 07:19:44 +00:00
|
|
|
</RoutableTabs>
|
2021-09-02 20:14:43 +00:00
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("events")}</TabTitleText>}
|
|
|
|
data-testid="rs-realm-events-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("events")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<EventsTab />
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("localization")}</TabTitleText>}
|
2022-01-14 10:05:50 +00:00
|
|
|
data-testid="rs-localization-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("localization")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<LocalizationTab
|
|
|
|
key={key}
|
|
|
|
refresh={refresh}
|
|
|
|
save={save}
|
|
|
|
reset={() => resetForm(realm)}
|
|
|
|
realm={realm}
|
|
|
|
/>
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("securityDefences")}</TabTitleText>}
|
2022-01-14 10:05:50 +00:00
|
|
|
data-testid="rs-security-defenses-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("securityDefences")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<SecurityDefences save={save} reset={() => resetForm(realm)} />
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={
|
|
|
|
<TabTitleText>{t("realm-settings:sessions")}</TabTitleText>
|
|
|
|
}
|
2022-01-14 10:05:50 +00:00
|
|
|
data-testid="rs-sessions-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("sessions")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<RealmSettingsSessionsTab key={key} realm={realm} save={save} />
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("realm-settings:tokens")}</TabTitleText>}
|
2022-01-14 10:05:50 +00:00
|
|
|
data-testid="rs-tokens-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("tokens")}
|
2021-09-02 20:14:43 +00:00
|
|
|
>
|
|
|
|
<RealmSettingsTokensTab
|
|
|
|
save={save}
|
|
|
|
realm={realm}
|
|
|
|
reset={() => resetForm(realm)}
|
|
|
|
/>
|
|
|
|
</Tab>
|
2021-09-09 10:45:19 +00:00
|
|
|
<Tab
|
|
|
|
title={
|
|
|
|
<TabTitleText>
|
|
|
|
{t("realm-settings:clientPolicies")}
|
|
|
|
</TabTitleText>
|
|
|
|
}
|
|
|
|
data-testid="rs-clientPolicies-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("clientPolicies")}
|
2021-09-09 10:45:19 +00:00
|
|
|
>
|
2022-01-20 15:34:58 +00:00
|
|
|
<RoutableTabs
|
|
|
|
mountOnEnter
|
|
|
|
defaultLocation={toClientPolicies({
|
|
|
|
realm: realmName,
|
|
|
|
tab: "profiles",
|
|
|
|
})}
|
2021-09-09 10:45:19 +00:00
|
|
|
>
|
|
|
|
<Tab
|
2021-10-12 15:03:56 +00:00
|
|
|
data-testid="rs-policies-clientProfiles-tab"
|
2021-09-09 10:45:19 +00:00
|
|
|
aria-label={t("clientProfilesSubTab")}
|
|
|
|
title={
|
|
|
|
<TabTitleText>
|
|
|
|
{t("profiles")}
|
|
|
|
<span className="kc-help-text">
|
|
|
|
<HelpItem
|
2021-12-14 14:56:36 +00:00
|
|
|
helpText="realm-settings:clientPoliciesProfilesHelpText"
|
|
|
|
fieldLabelId="realm-settings:clientPoliciesProfiles"
|
2021-09-09 10:45:19 +00:00
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
</TabTitleText>
|
|
|
|
}
|
2022-01-31 07:19:44 +00:00
|
|
|
{...policiesRoute("profiles")}
|
2021-09-09 10:45:19 +00:00
|
|
|
>
|
|
|
|
<ProfilesTab />
|
|
|
|
</Tab>
|
|
|
|
<Tab
|
|
|
|
id="policies"
|
|
|
|
data-testid="rs-policies-clientPolicies-tab"
|
|
|
|
aria-label={t("clientPoliciesSubTab")}
|
2022-01-31 07:19:44 +00:00
|
|
|
{...policiesRoute("policies")}
|
2021-09-09 10:45:19 +00:00
|
|
|
title={
|
|
|
|
<TabTitleText>
|
|
|
|
{t("policies")}
|
|
|
|
<span className="kc-help-text">
|
|
|
|
<HelpItem
|
2021-12-14 14:56:36 +00:00
|
|
|
helpText="realm-settings:clientPoliciesPoliciesHelpText"
|
|
|
|
fieldLabelId="realm-settings:clientPoliciesPolicies"
|
2021-09-09 10:45:19 +00:00
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
</TabTitleText>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<PoliciesTab />
|
|
|
|
</Tab>
|
2022-01-20 15:34:58 +00:00
|
|
|
</RoutableTabs>
|
2021-09-09 10:45:19 +00:00
|
|
|
</Tab>
|
2022-01-03 15:00:03 +00:00
|
|
|
{isFeatureEnabled(Feature.DeclarativeUserProfile) &&
|
|
|
|
userProfileEnabled === "true" && (
|
|
|
|
<Tab
|
|
|
|
title={
|
|
|
|
<TabTitleText>
|
|
|
|
{t("realm-settings:userProfile")}
|
|
|
|
</TabTitleText>
|
|
|
|
}
|
2022-01-14 10:05:50 +00:00
|
|
|
data-testid="rs-user-profile-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("userProfile")}
|
2022-01-03 15:00:03 +00:00
|
|
|
>
|
|
|
|
<UserProfileTab />
|
|
|
|
</Tab>
|
|
|
|
)}
|
2021-11-16 11:10:10 +00:00
|
|
|
<Tab
|
|
|
|
title={<TabTitleText>{t("userRegistration")}</TabTitleText>}
|
|
|
|
data-testid="rs-userRegistration-tab"
|
2022-01-31 07:19:44 +00:00
|
|
|
{...route("userRegistration")}
|
2021-11-16 11:10:10 +00:00
|
|
|
>
|
|
|
|
<UserRegistration />
|
|
|
|
</Tab>
|
2022-01-14 10:05:50 +00:00
|
|
|
</RoutableTabs>
|
2021-09-02 20:14:43 +00:00
|
|
|
</FormProvider>
|
|
|
|
</PageSection>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|