Fix Bug 69733 - [LDAP] No option to validate entered data in Password field when configuring LDAP

This commit is contained in:
Alexey Safronov 2024-08-19 12:46:31 +04:00
parent 7bf1b1c5ba
commit 5fc6b7a5fe
2 changed files with 20 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import { HelpButton } from "@docspace/shared/components/help-button";
import { FieldContainer } from "@docspace/shared/components/field-container"; import { FieldContainer } from "@docspace/shared/components/field-container";
import { ToggleButton } from "@docspace/shared/components/toggle-button"; import { ToggleButton } from "@docspace/shared/components/toggle-button";
import LdapFieldComponent from "./LdapFieldComponent"; import LdapFieldComponent from "./LdapFieldComponent";
import { InputSize, InputType } from "@docspace/shared/components/text-input";
const LOGIN = "login", const LOGIN = "login",
PASSWORD = "password"; PASSWORD = "password";
@ -109,6 +110,7 @@ const AuthenticationContainer = ({
isRequired isRequired
> >
<LdapFieldComponent <LdapFieldComponent
isPassword
name={PASSWORD} name={PASSWORD}
type="password" type="password"
hasError={errors.password} hasError={errors.password}
@ -117,6 +119,11 @@ const AuthenticationContainer = ({
isDisabled={!isLdapEnabled || isUIDisabled || !authentication} isDisabled={!isLdapEnabled || isUIDisabled || !authentication}
scale scale
tabIndex={19} tabIndex={19}
simpleView
size={InputSize.small}
autoComplete="current-password"
inputType={InputType.password}
isDisableTooltip
/> />
</FieldContainer> </FieldContainer>
</Box> </Box>

View File

@ -28,6 +28,7 @@ import React from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { TextInput } from "@docspace/shared/components/text-input"; import { TextInput } from "@docspace/shared/components/text-input";
import { Textarea } from "@docspace/shared/components/textarea"; import { Textarea } from "@docspace/shared/components/textarea";
import { PasswordInput } from "@docspace/shared/components/password-input";
const LdapFieldComponent = (props) => { const LdapFieldComponent = (props) => {
const { const {
@ -37,6 +38,7 @@ const LdapFieldComponent = (props) => {
setErrorField, setErrorField,
name, name,
onChange, onChange,
isPassword,
...prop ...prop
} = props; } = props;
@ -68,6 +70,17 @@ const LdapFieldComponent = (props) => {
if (isTextArea) if (isTextArea)
return <Textarea name={name} onChange={onChangeFn} {...prop} />; return <Textarea name={name} onChange={onChangeFn} {...prop} />;
if (isPassword)
return (
<PasswordInput
name={name}
onBlur={onBlur}
onFocus={onFocus}
onChange={onChangeFn}
{...prop}
/>
);
return ( return (
<TextInput <TextInput
name={name} name={name}