import { FormGroup } from "@patternfly/react-core"; import { useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { HelpItem } from "ui-shared"; import { KeycloakTextInput } from "../../components/keycloak-text-input/KeycloakTextInput"; import { MultiLineInput } from "../../components/multi-line-input/MultiLineInput"; import { useRealm } from "../../context/realm-context/RealmContext"; import environment from "../../environment"; import { convertAttributeNameToForm } from "../../util"; import { FormFields } from "../ClientDetails"; type LoginSettingsProps = { protocol?: string; isDisabled?: boolean; }; export const LoginSettings = ({ protocol = "openid-connect", ...rest }: LoginSettingsProps) => { const { t } = useTranslation("clients"); const { register, watch } = useFormContext(); const { realm } = useRealm(); const idpInitiatedSsoUrlName: string = watch( "attributes.saml_idp_initiated_sso_url_name" ); return ( <> } > } > } > } > {protocol === "saml" && ( <> } helperText={ idpInitiatedSsoUrlName !== "" && t("idpInitiatedSsoUrlNameHelp", { url: `${environment.authServerUrl}/realms/${realm}/protocol/saml/clients/${idpInitiatedSsoUrlName}`, }) } > } > } > )} {protocol !== "saml" && ( } > )} ); };