@keycloakify/keycloak-admin-ui
Version:
Repackaged Keycloak Admin UI
39 lines • 4.39 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { HelpItem, SelectControl, TextControl, } from "../../ui-shared";
import { FormGroup, Switch } from "@patternfly/react-core";
import { Controller, FormProvider } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { FormAccess } from "../../components/form/FormAccess";
import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader";
export const LdapSettingsSearching = ({ form, showSectionHeading = false, showSectionDescription = false, }) => {
const { t } = useTranslation();
return (_jsxs(FormProvider, { ...form, children: [showSectionHeading && (_jsx(WizardSectionHeader, { title: t("ldapSearchingAndUpdatingSettings"), description: t("ldapSearchingAndUpdatingSettingsDescription"), showDescription: showSectionDescription })), _jsxs(FormAccess, { role: "manage-realm", isHorizontal: true, children: [_jsx(SelectControl, { id: "editMode", name: "config.editMode[0]", label: t("editMode"), labelIcon: t("editModeLdapHelp"), controller: {
defaultValue: "",
rules: {
required: { value: true, message: t("validateEditMode") },
},
}, options: ["", "READ_ONLY", "WRITABLE", "UNSYNCED"] }), _jsx(TextControl, { name: "config.usersDn.0", label: t("usersDN"), labelIcon: t("usersDNHelp"), rules: {
required: t("validateUsersDn"),
} }), _jsx(TextControl, { name: "config.usernameLDAPAttribute.0", label: t("usernameLdapAttribute"), labelIcon: t("usernameLdapAttributeHelp"), defaultValue: "cn", rules: {
required: t("validateUsernameLDAPAttribute"),
} }), _jsx(TextControl, { name: "config.rdnLDAPAttribute.0", label: t("rdnLdapAttribute"), labelIcon: t("rdnLdapAttributeHelp"), defaultValue: "cn", rules: {
required: t("validateRdnLdapAttribute"),
} }), _jsx(TextControl, { name: "config.uuidLDAPAttribute.0", label: t("uuidLdapAttribute"), labelIcon: t("uuidLdapAttributeHelp"), defaultValue: "objectGUID", rules: {
required: t("validateUuidLDAPAttribute"),
} }), _jsx(TextControl, { name: "config.userObjectClasses.0", label: t("userObjectClasses"), labelIcon: t("userObjectClassesHelp"), defaultValue: "person, organizationalPerson, user", rules: {
required: t("validateUserObjectClasses"),
} }), _jsx(TextControl, { name: "config.customUserSearchFilter.0", label: t("userLdapFilter"), labelIcon: t("userLdapFilterHelp"), rules: {
pattern: {
value: /(\(.*\))$/,
message: t("validateCustomUserSearchFilter"),
},
} }), _jsx(SelectControl, { id: "kc-search-scope", name: "config.searchScope[0]", label: t("searchScope"), labelIcon: t("searchScopeHelp"), controller: {
defaultValue: "1",
}, options: [
{ key: "1", value: t("oneLevel") },
{ key: "2", value: t("subtree") },
] }), _jsx(TextControl, { name: "config.readTimeout.0", label: t("readTimeout"), labelIcon: t("readTimeoutHelp"), type: "number", min: 0 }), _jsx(FormGroup, { label: t("pagination"), labelIcon: _jsx(HelpItem, { helpText: t("paginationHelp"), fieldLabelId: "pagination" }), fieldId: "kc-ui-pagination", hasNoPaddingTop: true, children: _jsx(Controller, { name: "config.pagination", defaultValue: ["false"], control: form.control, render: ({ field }) => (_jsx(Switch, { id: "kc-ui-pagination", "data-testid": "ui-pagination", isDisabled: false, onChange: (_event, value) => field.onChange([`${value}`]), isChecked: field.value[0] === "true", label: t("on"), labelOff: t("off"), "aria-label": t("pagination") })) }) }), _jsx(SelectControl, { name: "config.referral.0", label: t("referral"), labelIcon: t("referralHelp"), controller: {
defaultValue: "",
}, options: ["ignore", "follow"] })] })] }));
};
//# sourceMappingURL=LdapSettingsSearching.js.map