Add lenght requirements for safe/owner naming when creating or loading a safe (#1357)
This commit is contained in:
parent
f1916e92f1
commit
0d7fc80924
|
@ -10,7 +10,13 @@ import { StepperPageFormProps } from 'src/components/Stepper'
|
|||
import AddressInput from 'src/components/forms/AddressInput'
|
||||
import Field from 'src/components/forms/Field'
|
||||
import TextField from 'src/components/forms/TextField'
|
||||
import { mustBeEthereumAddress, noErrorsOn, required } from 'src/components/forms/validator'
|
||||
import {
|
||||
mustBeEthereumAddress,
|
||||
noErrorsOn,
|
||||
required,
|
||||
composeValidators,
|
||||
minMaxLength,
|
||||
} from 'src/components/forms/validator'
|
||||
import Block from 'src/components/layout/Block'
|
||||
import Col from 'src/components/layout/Col'
|
||||
import Paragraph from 'src/components/layout/Paragraph'
|
||||
|
@ -109,7 +115,7 @@ const DetailsForm = ({ errors, form }: DetailsFormProps): React.ReactElement =>
|
|||
placeholder="Name of the Safe"
|
||||
text="Safe name"
|
||||
type="text"
|
||||
validate={required}
|
||||
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||
testId="load-safe-name-field"
|
||||
/>
|
||||
</Col>
|
||||
|
|
|
@ -8,7 +8,7 @@ import Identicon from 'src/components/Identicon'
|
|||
import OpenPaper from 'src/components/Stepper/OpenPaper'
|
||||
import Field from 'src/components/forms/Field'
|
||||
import TextField from 'src/components/forms/TextField'
|
||||
import { required } from 'src/components/forms/validator'
|
||||
import { composeValidators, minMaxLength, required } from 'src/components/forms/validator'
|
||||
import Block from 'src/components/layout/Block'
|
||||
import Col from 'src/components/layout/Col'
|
||||
import Hairline from 'src/components/layout/Hairline'
|
||||
|
@ -132,7 +132,7 @@ const OwnerListComponent = (props) => {
|
|||
placeholder="Owner Name*"
|
||||
text="Owner Name"
|
||||
type="text"
|
||||
validate={required}
|
||||
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||
testId={`load-safe-owner-name-${index}`}
|
||||
/>
|
||||
</Col>
|
||||
|
|
|
@ -4,7 +4,7 @@ import * as React from 'react'
|
|||
import OpenPaper from 'src/components/Stepper/OpenPaper'
|
||||
import Field from 'src/components/forms/Field'
|
||||
import TextField from 'src/components/forms/TextField'
|
||||
import { required } from 'src/components/forms/validator'
|
||||
import { composeValidators, minMaxLength, required } from 'src/components/forms/validator'
|
||||
import Block from 'src/components/layout/Block'
|
||||
import Paragraph from 'src/components/layout/Paragraph'
|
||||
import { FIELD_NAME } from 'src/routes/open/components/fields'
|
||||
|
@ -44,7 +44,7 @@ const SafeName = ({ classes, safeName }) => (
|
|||
placeholder="Name of the new Safe"
|
||||
text="Safe name"
|
||||
type="text"
|
||||
validate={required}
|
||||
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||
testId="create-safe-name-field"
|
||||
/>
|
||||
</Block>
|
||||
|
|
|
@ -16,7 +16,14 @@ import AddressInput from 'src/components/forms/AddressInput'
|
|||
import Field from 'src/components/forms/Field'
|
||||
import SelectField from 'src/components/forms/SelectField'
|
||||
import TextField from 'src/components/forms/TextField'
|
||||
import { composeValidators, minValue, mustBeInteger, noErrorsOn, required } from 'src/components/forms/validator'
|
||||
import {
|
||||
composeValidators,
|
||||
minValue,
|
||||
mustBeInteger,
|
||||
noErrorsOn,
|
||||
required,
|
||||
minMaxLength,
|
||||
} from 'src/components/forms/validator'
|
||||
import Block from 'src/components/layout/Block'
|
||||
import Button from 'src/components/layout/Button'
|
||||
import Col from 'src/components/layout/Col'
|
||||
|
@ -129,7 +136,7 @@ const SafeOwners = (props) => {
|
|||
placeholder="Owner Name*"
|
||||
text="Owner Name"
|
||||
type="text"
|
||||
validate={required}
|
||||
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||
testId={`create-safe-owner-name-field-${index}`}
|
||||
/>
|
||||
</Col>
|
||||
|
|
Loading…
Reference in New Issue