[MM-54839] Convert LocalizedInput of 'email_to_ldap.tsx' to regular input component (#24837)

Этот коммит содержится в:
js029
2023-10-11 08:15:13 +02:00
коммит произвёл GitHub
родитель 8ae1cb2c37
Коммит 463945e8cc

Просмотреть файл

@@ -3,13 +3,12 @@
import classNames from 'classnames';
import React, {useRef} from 'react';
import {FormattedMessage} from 'react-intl';
import {FormattedMessage, useIntl} from 'react-intl';
import type {AuthChangeResponse} from '@mattermost/types/users';
import {emailToLdap} from 'actions/admin_actions.jsx';
import LocalizedInput from 'components/localized_input/localized_input';
import LoginMfa from 'components/login/login_mfa';
import {ClaimErrors} from 'utils/constants';
@@ -33,6 +32,8 @@ export type SubmitOptions = {
}
const EmailToLDAP = ({email, siteName, ldapLoginFieldName}: Props) => {
const {formatMessage} = useIntl();
const emailPasswordInput = useRef<HTMLInputElement>(null);
const ldapIdInput = useRef<HTMLInputElement>(null);
const ldapPasswordInput = useRef<HTMLInputElement>(null);
@@ -127,8 +128,6 @@ const EmailToLDAP = ({email, siteName, ldapLoginFieldName}: Props) => {
const loginPlaceholder = ldapLoginFieldName || localizeMessage('claim.email_to_ldap.ldapId', 'AD/LDAP ID');
const titleMessage = {id: t('claim.email_to_ldap.title'), defaultMessage: 'Switch Email/Password Account to AD/LDAP'};
const placeholderPasswordMessage = {id: t('claim.email_to_ldap.pwd'), defaultMessage: 'Password'};
const placeholderLdapMessage = {id: t('claim.email_to_ldap.ldapPwd'), defaultMessage: 'AD/LDAP Password'};
if (showMfa) {
return (
@@ -177,13 +176,13 @@ const EmailToLDAP = ({email, siteName, ldapLoginFieldName}: Props) => {
name='fakeusernameremembered'
/>
<div className={classNames('form-group', {'has-error': passwordError})}>
<LocalizedInput
<input
type='password'
className='form-control'
name='emailPassword'
ref={emailPasswordInput}
autoComplete='off'
placeholder={placeholderPasswordMessage}
placeholder={formatMessage({id: 'claim.email_to_ldap.pwd', defaultMessage: 'Password'})}
spellCheck='false'
/>
</div>
@@ -207,13 +206,13 @@ const EmailToLDAP = ({email, siteName, ldapLoginFieldName}: Props) => {
</div>
<ErrorLabel errorText={ldapError}/>
<div className={classNames('form-group', {'has-error': ldapPasswordError})}>
<LocalizedInput
<input
type='password'
className='form-control'
name='ldapPassword'
ref={ldapPasswordInput}
autoComplete='off'
placeholder={placeholderLdapMessage}
placeholder={formatMessage({id: t('claim.email_to_ldap.ldapPwd'), defaultMessage: 'AD/LDAP Password'})}
spellCheck='false'
/>
</div>