+ client: handle logs configuration

This commit is contained in:
Ildar Kamalov
2019-09-04 17:39:35 +03:00
committed by Simon Zolin
parent 27f895cf46
commit a753ae86cc
19 changed files with 401 additions and 229 deletions

View File

@@ -4,15 +4,15 @@ import { withNamespaces, Trans } from 'react-i18next';
import debounce from 'lodash/debounce';
import { DEBOUNCE_TIMEOUT } from '../../../helpers/constants';
import Form from './Form';
import Card from '../../ui/Card';
import Form from './Form';
class StatsConfig extends Component {
handleFormChange = debounce((values) => {
this.props.setStatsConfig(values);
}, DEBOUNCE_TIMEOUT);
handleReset = () => {
handleStatsReset = () => {
const { t, resetStats } = this.props;
// eslint-disable-next-line no-alert
if (window.confirm(t('statistics_clear_confirm'))) {
@@ -26,7 +26,7 @@ class StatsConfig extends Component {
} = this.props;
return (
<Card title={t('statistics_logs')} bodyType="card-body box-body--settings">
<Card title={t('statistics_configuration')} bodyType="card-body box-body--settings">
<div className="form">
<Form
initialValues={{
@@ -39,8 +39,8 @@ class StatsConfig extends Component {
<button
type="button"
className="btn btn-outline-secondary btn-sm mt-3"
onClick={this.handleReset}
className="btn btn-outline-secondary btn-sm"
onClick={this.handleStatsReset}
disabled={processingReset}
>
<Trans>statistics_clear</Trans>