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-27 18:46:13 +04:00
parent fb68cefffe
commit 9fcb1baed6
2 changed files with 32 additions and 30 deletions

View File

@ -39,7 +39,7 @@ const LdapFieldComponent = (props) => {
name, name,
onChange, onChange,
isPassword, isPassword,
...prop ...rest
} = props; } = props;
const onChangeFn = (e) => { const onChangeFn = (e) => {
@ -54,12 +54,12 @@ const LdapFieldComponent = (props) => {
onChange && onChange(e); onChange && onChange(e);
}; };
const onFocus = (e) => { // const onFocus = (e) => {
const name = e.target.name; // const name = e.target.name;
if (errors[name]) { // if (errors[name]) {
removeErrorField(name); // removeErrorField(name);
} // }
}; // };
const onBlur = (e) => { const onBlur = (e) => {
if (e.target.value.trim() === "") { if (e.target.value.trim() === "") {
@ -68,16 +68,16 @@ const LdapFieldComponent = (props) => {
}; };
if (isTextArea) if (isTextArea)
return <Textarea name={name} onChange={onChangeFn} {...prop} />; return <Textarea name={name} onChange={onChangeFn} {...rest} />;
if (isPassword) if (isPassword)
return ( return (
<PasswordInput <PasswordInput
name={name} inputName={name}
onBlur={onBlur} onBlur={onBlur}
onFocus={onFocus} //onFocus={onFocus}
onChange={onChangeFn} onChange={onChangeFn}
{...prop} {...rest}
/> />
); );
@ -85,9 +85,9 @@ const LdapFieldComponent = (props) => {
<TextInput <TextInput
name={name} name={name}
onBlur={onBlur} onBlur={onBlur}
onFocus={onFocus} //onFocus={onFocus}
onChange={onChangeFn} onChange={onChangeFn}
{...prop} {...rest}
/> />
); );
}; };

View File

@ -160,23 +160,25 @@ const InputBlock = ({
forwardedRef={forwardedRef} forwardedRef={forwardedRef}
/> />
<div className="append"> {!isDisabled && (
<StyledIconBlock <div className="append">
className={`input-block-icon ${iconButtonClassName}`} <StyledIconBlock
onClick={onIconClickAction} className={`input-block-icon ${iconButtonClassName}`}
isClickable={!!onIconClick} onClick={onIconClickAction}
> isClickable={!!onIconClick}
<IconButton >
size={iconButtonSize} <IconButton
iconNode={iconNode} size={iconButtonSize}
iconName={iconName || ""} iconNode={iconNode}
isFill={isIconFill} iconName={iconName || ""}
isClickable={typeof onIconClick === "function"} isFill={isIconFill}
color={iconColor} isClickable={typeof onIconClick === "function"}
hoverColor={hoverColor} color={iconColor}
/> hoverColor={hoverColor}
</StyledIconBlock> />
</div> </StyledIconBlock>
</div>
)}
</StyledInputGroup> </StyledInputGroup>
); );
}; };