[MM 24831] Convert LocalizedInput of 'email_to_oauth.tsx' to regular input component (#24973)

This commit is contained in:
js029 2023-10-18 14:28:10 +02:00 committed by GitHub
parent 52fe06db4e
commit 4b766c09d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,13 +3,12 @@
import classNames from 'classnames';
import React, {useState, useRef} from 'react';
import {FormattedMessage} from 'react-intl';
import {FormattedMessage, useIntl} from 'react-intl';
import type {AuthChangeResponse} from '@mattermost/types/users';
import {emailToOAuth} from 'actions/admin_actions.jsx';
import LocalizedInput from 'components/localized_input/localized_input';
import LoginMfa from 'components/login/login_mfa';
import Constants, {ClaimErrors} from 'utils/constants';
@ -26,6 +25,8 @@ type Props = {
}
const EmailToOAuth = (props: Props) => {
const {formatMessage} = useIntl();
const [showMfa, setShowMfa] = useState(false);
const [password, setPassword] = useState('');
const [serverError, setServerError] = useState<string>('');
@ -75,7 +76,6 @@ const EmailToOAuth = (props: Props) => {
id: t('claim.email_to_oauth.title'),
defaultMessage: 'Switch Email/Password Account to {uiType}',
};
const placeholderPasswordMessage = {id: t('claim.email_to_oauth.pwd'), defaultMessage: 'Password'};
if (showMfa) {
return (
@ -119,12 +119,12 @@ const EmailToOAuth = (props: Props) => {
/>
</p>
<div className={classNames('form-group', {'has-error': serverError})}>
<LocalizedInput
<input
type='password'
className='form-control'
name='password'
ref={passwordInput}
placeholder={placeholderPasswordMessage}
placeholder={formatMessage({id: 'claim.email_to_oauth.pwd', defaultMessage: 'Password'})}
spellCheck='false'
/>
</div>