import { Button, FormGroup, InputGroup, 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 { Controller, UseFormMethods } from "react-hook-form"; import { EyeIcon, EyeSlashIcon } from "@patternfly/react-icons"; import { FormAccess } from "../../components/form-access/FormAccess"; import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader"; export type LdapSettingsConnectionProps = { form: UseFormMethods; showSectionHeading?: boolean; showSectionDescription?: boolean; }; export const LdapSettingsConnection = ({ form, showSectionHeading = false, showSectionDescription = false, }: LdapSettingsConnectionProps) => { const { t } = useTranslation("user-federation"); const helpText = useTranslation("user-federation-help").t; const [ isTruststoreSpiDropdownOpen, setIsTruststoreSpiDropdownOpen, ] = useState(false); const [isBindTypeDropdownOpen, setIsBindTypeDropdownOpen] = useState(false); const [isPasswordVisible, setIsPasswordVisible] = useState(false); return ( <> {showSectionHeading && ( )} } fieldId="kc-console-connection-url" isRequired > {form.errors.config && form.errors.config.connectionUrl && form.errors.config.connectionUrl[0] && (
{form.errors.config.connectionUrl[0].message}
)}
} fieldId="kc-enable-start-tls" hasNoPaddingTop > ( onChange([`${value}`])} isChecked={value[0] === "true"} label={t("common:on")} labelOff={t("common:off")} /> )} > } fieldId="kc-use-truststore-spi" > ( )} > } fieldId="kc-connection-pooling" hasNoPaddingTop > ( onChange([`${value}`])} isChecked={value[0] === "true"} label={t("common:on")} labelOff={t("common:off")} /> )} > } fieldId="kc-console-connection-timeout" > } fieldId="kc-bind-type" isRequired > ( )} > } fieldId="kc-console-bind-dn" > } fieldId="kc-console-bind-credentials" isRequired > {form.errors.config && form.errors.config.bindCredential && form.errors.config.bindCredential[0] && (
{form.errors.config.bindCredential[0].message}
)}
{" "} {/* TODO: whatever this button is supposed to do */}
); };