import { FormGroup, Select, SelectOption, SelectVariant, Switch, TextInput, } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import React, { useState } from "react"; import { HelpItem } from "../../components/help-enabler/HelpItem"; import { UseFormMethods, Controller } from "react-hook-form"; import { FormAccess } from "../../components/form-access/FormAccess"; import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader"; export type LdapSettingsSearchingProps = { form: UseFormMethods; showSectionHeading?: boolean; showSectionDescription?: boolean; }; export const LdapSettingsSearching = ({ form, showSectionHeading = false, showSectionDescription = false, }: LdapSettingsSearchingProps) => { const { t } = useTranslation("user-federation"); const helpText = useTranslation("user-federation-help").t; const [isSearchScopeDropdownOpen, setIsSearchScopeDropdownOpen] = useState( false ); const [isEditModeDropdownOpen, setIsEditModeDropdownOpen] = useState(false); return ( <> {showSectionHeading && ( )} } fieldId="kc-edit-mode" > ( )} > } fieldId="kc-console-users-dn" isRequired > {form.errors.config && form.errors.config.usersDn && form.errors.config.usersDn[0] && (
{form.errors.config.usersDn[0].message}
)}
} fieldId="kc-username-ldap-attribute" isRequired > {form.errors.config && form.errors.config.usernameLDAPAttribute && form.errors.config.usernameLDAPAttribute[0] && (
{form.errors.config.usernameLDAPAttribute[0].message}
)}
} fieldId="kc-rdn-ldap-attribute" isRequired > {form.errors.config && form.errors.config.rdnLDAPAttribute && form.errors.config.rdnLDAPAttribute[0] && (
{form.errors.config.rdnLDAPAttribute[0].message}
)}
} fieldId="kc-uuid-ldap-attribute" isRequired > {form.errors.config && form.errors.config.uuidLDAPAttribute && form.errors.config.uuidLDAPAttribute[0] && (
{form.errors.config.uuidLDAPAttribute[0].message}
)}
} fieldId="kc-user-object-classes" isRequired > {form.errors.config && form.errors.config.userObjectClasses && form.errors.config.userObjectClasses[0] && (
{form.errors.config.userObjectClasses[0].message}
)}
} fieldId="kc-user-ldap-filter" > {form.errors.config && form.errors.config.customUserSearchFilter && form.errors.config.customUserSearchFilter[0] && (
{form.errors.config.customUserSearchFilter[0].message}
)}
} fieldId="kc-search-scope" > ( )} > } fieldId="kc-read-timeout" > } fieldId="kc-console-pagination" hasNoPaddingTop > ( onChange([`${value}`])} isChecked={value[0] === "true"} label={t("common:on")} labelOff={t("common:off")} /> )} >
); };