import { FormGroup, Select, SelectOption, SelectVariant, Switch, } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import { 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"; import { KeycloakTextInput } from "../../components/keycloak-text-input/KeycloakTextInput"; export type LdapSettingsSearchingProps = { form: UseFormMethods; showSectionHeading?: boolean; showSectionDescription?: boolean; }; export const LdapSettingsSearching = ({ form, showSectionHeading = false, showSectionDescription = false, }: LdapSettingsSearchingProps) => { const { t } = useTranslation("user-federation"); const { t: helpText } = useTranslation("user-federation-help"); const [isSearchScopeDropdownOpen, setIsSearchScopeDropdownOpen] = useState(false); const [isEditModeDropdownOpen, setIsEditModeDropdownOpen] = useState(false); return ( <> {showSectionHeading && ( )} } fieldId="kc-edit-mode" isRequired validated={form.errors.config?.editMode?.[0] ? "error" : "default"} helperTextInvalid={form.errors.config?.editMode?.[0].message} > ( )} /> } fieldId="kc-console-users-dn" isRequired validated={form.errors.config?.usersDn?.[0] ? "error" : "default"} helperTextInvalid={form.errors.config?.usersDn?.[0].message} > } fieldId="kc-username-ldap-attribute" isRequired validated={ form.errors.config?.usernameLDAPAttribute?.[0] ? "error" : "default" } helperTextInvalid={ form.errors.config?.usernameLDAPAttribute?.[0].message } > } fieldId="kc-rdn-ldap-attribute" isRequired validated={ form.errors.config?.rdnLDAPAttribute?.[0] ? "error" : "default" } helperTextInvalid={form.errors.config?.rdnLDAPAttribute?.[0].message} > } fieldId="kc-uuid-ldap-attribute" isRequired validated={ form.errors.config?.uuidLDAPAttribute?.[0] ? "error" : "default" } helperTextInvalid={form.errors.config?.uuidLDAPAttribute?.[0].message} > } fieldId="kc-user-object-classes" isRequired validated={ form.errors.config?.userObjectClasses?.[0] ? "error" : "default" } helperTextInvalid={form.errors.config?.userObjectClasses?.[0].message} > } fieldId="kc-user-ldap-filter" validated={ form.errors.config?.customUserSearchFilter?.[0] ? "error" : "default" } helperTextInvalid={ 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")} aria-label={t("pagination")} /> )} > ); };