Pull request: 3313 statistics settings UI
Closes #3313
Squashed commit of the following:
commit 6f2ff98a8282789e2dbb16694ca87a1f4cc8c076
Merge: 1221f02f f4dde3f2
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Wed Jul 14 15:53:18 2021 +0300
Merge branch 'master' into 3313-statistics
commit 1221f02f40628964febd22967d85d5185f87b08d
Author: Ildar Kamalov <ik@adguard.com>
Date: Wed Jul 14 15:23:09 2021 +0300
client: make client names clickable
commit 99770ec065e14ce2522a59820f9851d79001923c
Author: Ildar Kamalov <ik@adguard.com>
Date: Wed Jul 14 15:06:30 2021 +0300
client: decreasing interval confirm, disabled stats message
This commit is contained in:
@@ -7,9 +7,13 @@ import Form from './Form';
|
||||
|
||||
class StatsConfig extends Component {
|
||||
handleFormSubmit = (values) => {
|
||||
const { t } = this.props;
|
||||
// eslint-disable-next-line no-alert
|
||||
if (window.confirm(t('statistics_retention_confirm'))) {
|
||||
const { t, interval: prevInterval } = this.props;
|
||||
|
||||
if (values.interval < prevInterval) {
|
||||
if (window.confirm(t('statistics_retention_confirm'))) {
|
||||
this.props.setStatsConfig(values);
|
||||
}
|
||||
} else {
|
||||
this.props.setStatsConfig(values);
|
||||
}
|
||||
};
|
||||
@@ -28,7 +32,11 @@ class StatsConfig extends Component {
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Card title={t('statistics_configuration')} bodyType="card-body box-body--settings">
|
||||
<Card
|
||||
title={t('statistics_configuration')}
|
||||
bodyType="card-body box-body--settings"
|
||||
id="stats-config"
|
||||
>
|
||||
<div className="form">
|
||||
<Form
|
||||
initialValues={{ interval }}
|
||||
|
||||
Reference in New Issue
Block a user