Pull request: 4962 trim client upstream field whitespace

Updates #4962

Squashed commit of the following:

commit d1382e197455987cf1539b28a09da7b5377dd784
Merge: 510d80bd 0ddd8e3d
Author: Ildar Kamalov <ik@adguard.com>
Date:   Wed Dec 21 12:26:05 2022 +0300

    Merge branch 'master' into 4962-trim-whitespace

commit 510d80bde01fb027f72b2371bda35c62c6b02ca6
Author: Ildar Kamalov <ik@adguard.com>
Date:   Tue Dec 20 13:57:13 2022 +0300

    4962 trim client upstream field whitespace
This commit is contained in:
Ildar Kamalov 2022-12-21 12:38:51 +03:00
parent 0ddd8e3dcc
commit 0c03063c8a
1 changed files with 4 additions and 2 deletions

View File

@ -11,12 +11,13 @@ import Select from 'react-select';
import i18n from '../../../i18n'; import i18n from '../../../i18n';
import Tabs from '../../ui/Tabs'; import Tabs from '../../ui/Tabs';
import Examples from '../Dns/Upstream/Examples'; import Examples from '../Dns/Upstream/Examples';
import { toggleAllServices } from '../../../helpers/helpers'; import { toggleAllServices, trimLinesAndRemoveEmpty } from '../../../helpers/helpers';
import { import {
renderInputField, renderInputField,
renderGroupField, renderGroupField,
CheckboxField, CheckboxField,
renderServiceField, renderServiceField,
renderTextareaField,
} from '../../../helpers/form'; } from '../../../helpers/form';
import { validateClientId, validateRequiredValue } from '../../../helpers/validators'; import { validateClientId, validateRequiredValue } from '../../../helpers/validators';
import { CLIENT_ID_LINK, FORM_NAME } from '../../../helpers/constants'; import { CLIENT_ID_LINK, FORM_NAME } from '../../../helpers/constants';
@ -230,10 +231,11 @@ let Form = (props) => {
<Field <Field
id="upstreams" id="upstreams"
name="upstreams" name="upstreams"
component="textarea" component={renderTextareaField}
type="text" type="text"
className="form-control form-control--textarea mb-5" className="form-control form-control--textarea mb-5"
placeholder={t('upstream_dns')} placeholder={t('upstream_dns')}
normalizeOnBlur={trimLinesAndRemoveEmpty}
/> />
<Examples /> <Examples />
</div>, </div>,