diff --git a/client/src/components/Filters/Form.js b/client/src/components/Filters/Form.js
index 9b2787d2..39791a5f 100644
--- a/client/src/components/Filters/Form.js
+++ b/client/src/components/Filters/Form.js
@@ -5,7 +5,7 @@ import { withTranslation } from 'react-i18next';
import flow from 'lodash/flow';
import classNames from 'classnames';
import { validatePath, validateRequiredValue } from '../../helpers/validators';
-import { renderCheckboxField, renderInputField } from '../../helpers/form';
+import { CheckboxField, renderInputField } from '../../helpers/form';
import { MODAL_OPEN_TIMEOUT, MODAL_TYPE, FORM_NAME } from '../../helpers/constants';
const filtersCatalog = require('../../helpers/filters/filters.json');
@@ -34,6 +34,22 @@ const renderIcons = (iconsData) => iconsData.map(({
);
+const renderCheckboxField = (
+ props,
+) => ;
+
+renderCheckboxField.propTypes = {
+ // https://redux-form.com/8.3.0/docs/api/field.md/#props
+ input: PropTypes.object.isRequired,
+ disabled: PropTypes.bool.isRequired,
+};
+
const renderFilters = ({ categories, filters }, selectedSources, t) => Object.keys(categories)
.map((categoryId) => {
const category = categories[categoryId];
@@ -60,12 +76,11 @@ const renderFilters = ({ categories, filters }, selectedSources, t) => Object.ke
return
{renderIcons(iconsData)}
;
diff --git a/client/src/components/Settings/Clients/Form.js b/client/src/components/Settings/Clients/Form.js
index 2142b1a5..28f8a59c 100644
--- a/client/src/components/Settings/Clients/Form.js
+++ b/client/src/components/Settings/Clients/Form.js
@@ -15,7 +15,7 @@ import { toggleAllServices } from '../../../helpers/helpers';
import {
renderInputField,
renderGroupField,
- renderCheckboxField,
+ CheckboxField,
renderServiceField,
} from '../../../helpers/form';
import { validateClientId, validateRequiredValue } from '../../../helpers/validators';
@@ -151,7 +151,7 @@ let Form = (props) => {
{
@@ -138,7 +138,7 @@ let Form = (props) => {
{
@@ -49,7 +49,7 @@ const Form = (props) => {
name="enabled"
type="checkbox"
modifier="checkbox--settings"
- component={renderCheckboxField}
+ component={CheckboxField}
placeholder={t('block_domain_use_filters_and_hosts')}
subtitle={t('filters_block_toggle_hint')}
onChange={handleChange}
diff --git a/client/src/components/Settings/LogsConfig/Form.js b/client/src/components/Settings/LogsConfig/Form.js
index a89c89db..17c5c45b 100644
--- a/client/src/components/Settings/LogsConfig/Form.js
+++ b/client/src/components/Settings/LogsConfig/Form.js
@@ -4,7 +4,7 @@ import { Field, reduxForm } from 'redux-form';
import { Trans, withTranslation } from 'react-i18next';
import flow from 'lodash/flow';
-import { renderCheckboxField, renderRadioField, toNumber } from '../../../helpers/form';
+import { CheckboxField, renderRadioField, toNumber } from '../../../helpers/form';
import { FORM_NAME, QUERY_LOG_INTERVALS_DAYS } from '../../../helpers/constants';
import '../FormButton.css';
@@ -36,7 +36,7 @@ const Form = (props) => {
@@ -45,7 +45,7 @@ const Form = (props) => {
data
&& y === 0) ? 62 : 15,
right: 0,
bottom: 1,
left: 20,
diff --git a/client/src/helpers/form.js b/client/src/helpers/form.js
index a52dbb6a..bf6db7f6 100644
--- a/client/src/helpers/form.js
+++ b/client/src/helpers/form.js
@@ -156,31 +156,24 @@ renderRadioField.propTypes = {
}).isRequired,
};
-export const renderCheckboxField = ({
+export const CheckboxField = ({
input,
placeholder,
subtitle,
disabled,
onClick,
modifier = 'checkbox--form',
- checked,
meta: { touched, error },
}) => <>
{!disabled
&& touched
@@ -188,7 +181,7 @@ export const renderCheckboxField = ({
&& {error}}
>;
-renderCheckboxField.propTypes = {
+CheckboxField.propTypes = {
input: PropTypes.object.isRequired,
placeholder: PropTypes.string,
subtitle: PropTypes.string,