[MM-54836] Convert LocalizedInput of 'compliance_reports.tsx' to regular input component (#25014)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
df727947d1
Коммит
fe6131caed
@@ -2,7 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {FormattedDate, FormattedMessage, FormattedTime} from 'react-intl';
|
import {FormattedDate, FormattedMessage, FormattedTime, type IntlShape, injectIntl} from 'react-intl';
|
||||||
|
|
||||||
import type {Compliance} from '@mattermost/types/compliance';
|
import type {Compliance} from '@mattermost/types/compliance';
|
||||||
import type {UserProfile} from '@mattermost/types/users';
|
import type {UserProfile} from '@mattermost/types/users';
|
||||||
@@ -10,11 +10,8 @@ import type {UserProfile} from '@mattermost/types/users';
|
|||||||
import {Client4} from 'mattermost-redux/client';
|
import {Client4} from 'mattermost-redux/client';
|
||||||
|
|
||||||
import LoadingScreen from 'components/loading_screen';
|
import LoadingScreen from 'components/loading_screen';
|
||||||
import LocalizedInput from 'components/localized_input/localized_input';
|
|
||||||
import ReloadIcon from 'components/widgets/icons/fa_reload_icon';
|
import ReloadIcon from 'components/widgets/icons/fa_reload_icon';
|
||||||
|
|
||||||
import {t} from 'utils/i18n';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -40,6 +37,8 @@ type Props = {
|
|||||||
|
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
|
|
||||||
|
intl: IntlShape;
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -59,7 +58,7 @@ type State = {
|
|||||||
runningReport?: boolean;
|
runningReport?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class ComplianceReports extends React.PureComponent<Props, State> {
|
class ComplianceReports extends React.PureComponent<Props, State> {
|
||||||
private descInput: React.RefObject<HTMLInputElement>;
|
private descInput: React.RefObject<HTMLInputElement>;
|
||||||
private emailsInput: React.RefObject<HTMLInputElement>;
|
private emailsInput: React.RefObject<HTMLInputElement>;
|
||||||
private fromInput: React.RefObject<HTMLInputElement>;
|
private fromInput: React.RefObject<HTMLInputElement>;
|
||||||
@@ -345,12 +344,12 @@ export default class ComplianceReports extends React.PureComponent<Props, State>
|
|||||||
defaultMessage='Job Name:'
|
defaultMessage='Job Name:'
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<LocalizedInput
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
className='form-control'
|
className='form-control'
|
||||||
id='desc'
|
id='desc'
|
||||||
ref={this.descInput}
|
ref={this.descInput}
|
||||||
placeholder={{id: t('admin.compliance_reports.desc_placeholder'), defaultMessage: 'E.g. "Audit 445 for HR"'}}
|
placeholder={this.props.intl.formatMessage({id: 'admin.compliance_reports.desc_placeholder', defaultMessage: 'E.g. "Audit 445 for HR"'})}
|
||||||
disabled={this.props.readOnly}
|
disabled={this.props.readOnly}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -361,12 +360,12 @@ export default class ComplianceReports extends React.PureComponent<Props, State>
|
|||||||
defaultMessage='From:'
|
defaultMessage='From:'
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<LocalizedInput
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
className='form-control'
|
className='form-control'
|
||||||
id='from'
|
id='from'
|
||||||
ref={this.fromInput}
|
ref={this.fromInput}
|
||||||
placeholder={{id: t('admin.compliance_reports.from_placeholder'), defaultMessage: 'E.g. "2016-03-11"'}}
|
placeholder={this.props.intl.formatMessage({id: 'admin.compliance_reports.from_placeholder', defaultMessage: 'E.g. "2016-03-11"'})}
|
||||||
disabled={this.props.readOnly}
|
disabled={this.props.readOnly}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -377,12 +376,12 @@ export default class ComplianceReports extends React.PureComponent<Props, State>
|
|||||||
defaultMessage='To:'
|
defaultMessage='To:'
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<LocalizedInput
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
className='form-control'
|
className='form-control'
|
||||||
id='to'
|
id='to'
|
||||||
ref={this.toInput}
|
ref={this.toInput}
|
||||||
placeholder={{id: t('admin.compliance_reports.to_placeholder'), defaultMessage: 'E.g. "2016-03-15"'}}
|
placeholder={this.props.intl.formatMessage({id: 'admin.compliance_reports.to_placeholder', defaultMessage: 'E.g. "2016-03-15"'})}
|
||||||
disabled={this.props.readOnly}
|
disabled={this.props.readOnly}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -395,12 +394,12 @@ export default class ComplianceReports extends React.PureComponent<Props, State>
|
|||||||
defaultMessage='Emails:'
|
defaultMessage='Emails:'
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<LocalizedInput
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
className='form-control'
|
className='form-control'
|
||||||
id='emails'
|
id='emails'
|
||||||
ref={this.emailsInput}
|
ref={this.emailsInput}
|
||||||
placeholder={{id: t('admin.compliance_reports.emails_placeholder'), defaultMessage: 'E.g. "bill@example.com, bob@example.com"'}}
|
placeholder={this.props.intl.formatMessage({id: 'admin.compliance_reports.emails_placeholder', defaultMessage: 'E.g. "bill@example.com, bob@example.com"'})}
|
||||||
disabled={this.props.readOnly}
|
disabled={this.props.readOnly}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -411,12 +410,12 @@ export default class ComplianceReports extends React.PureComponent<Props, State>
|
|||||||
defaultMessage='Keywords:'
|
defaultMessage='Keywords:'
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<LocalizedInput
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
className='form-control'
|
className='form-control'
|
||||||
id='keywords'
|
id='keywords'
|
||||||
ref={this.keywordsInput}
|
ref={this.keywordsInput}
|
||||||
placeholder={{id: t('admin.compliance_reports.keywords_placeholder'), defaultMessage: 'E.g. "shorting stock"'}}
|
placeholder={this.props.intl.formatMessage({id: 'admin.compliance_reports.keywords_placeholder', defaultMessage: 'E.g. "shorting stock"'})}
|
||||||
disabled={this.props.readOnly}
|
disabled={this.props.readOnly}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -466,3 +465,5 @@ const style: Record<string, React.CSSProperties> = {
|
|||||||
date: {whiteSpace: 'nowrap'},
|
date: {whiteSpace: 'nowrap'},
|
||||||
serverError: {marginTop: '10px'},
|
serverError: {marginTop: '10px'},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default injectIntl(ComplianceReports);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user