mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-13 03:24:09 +00:00
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 AddressInput from 'src/components/forms/AddressInput'
|
||||||
import Field from 'src/components/forms/Field'
|
import Field from 'src/components/forms/Field'
|
||||||
import TextField from 'src/components/forms/TextField'
|
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 Block from 'src/components/layout/Block'
|
||||||
import Col from 'src/components/layout/Col'
|
import Col from 'src/components/layout/Col'
|
||||||
import Paragraph from 'src/components/layout/Paragraph'
|
import Paragraph from 'src/components/layout/Paragraph'
|
||||||
@ -109,7 +115,7 @@ const DetailsForm = ({ errors, form }: DetailsFormProps): React.ReactElement =>
|
|||||||
placeholder="Name of the Safe"
|
placeholder="Name of the Safe"
|
||||||
text="Safe name"
|
text="Safe name"
|
||||||
type="text"
|
type="text"
|
||||||
validate={required}
|
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||||
testId="load-safe-name-field"
|
testId="load-safe-name-field"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -8,7 +8,7 @@ import Identicon from 'src/components/Identicon'
|
|||||||
import OpenPaper from 'src/components/Stepper/OpenPaper'
|
import OpenPaper from 'src/components/Stepper/OpenPaper'
|
||||||
import Field from 'src/components/forms/Field'
|
import Field from 'src/components/forms/Field'
|
||||||
import TextField from 'src/components/forms/TextField'
|
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 Block from 'src/components/layout/Block'
|
||||||
import Col from 'src/components/layout/Col'
|
import Col from 'src/components/layout/Col'
|
||||||
import Hairline from 'src/components/layout/Hairline'
|
import Hairline from 'src/components/layout/Hairline'
|
||||||
@ -132,7 +132,7 @@ const OwnerListComponent = (props) => {
|
|||||||
placeholder="Owner Name*"
|
placeholder="Owner Name*"
|
||||||
text="Owner Name"
|
text="Owner Name"
|
||||||
type="text"
|
type="text"
|
||||||
validate={required}
|
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||||
testId={`load-safe-owner-name-${index}`}
|
testId={`load-safe-owner-name-${index}`}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -4,7 +4,7 @@ import * as React from 'react'
|
|||||||
import OpenPaper from 'src/components/Stepper/OpenPaper'
|
import OpenPaper from 'src/components/Stepper/OpenPaper'
|
||||||
import Field from 'src/components/forms/Field'
|
import Field from 'src/components/forms/Field'
|
||||||
import TextField from 'src/components/forms/TextField'
|
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 Block from 'src/components/layout/Block'
|
||||||
import Paragraph from 'src/components/layout/Paragraph'
|
import Paragraph from 'src/components/layout/Paragraph'
|
||||||
import { FIELD_NAME } from 'src/routes/open/components/fields'
|
import { FIELD_NAME } from 'src/routes/open/components/fields'
|
||||||
@ -44,7 +44,7 @@ const SafeName = ({ classes, safeName }) => (
|
|||||||
placeholder="Name of the new Safe"
|
placeholder="Name of the new Safe"
|
||||||
text="Safe name"
|
text="Safe name"
|
||||||
type="text"
|
type="text"
|
||||||
validate={required}
|
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||||
testId="create-safe-name-field"
|
testId="create-safe-name-field"
|
||||||
/>
|
/>
|
||||||
</Block>
|
</Block>
|
||||||
|
@ -16,7 +16,14 @@ import AddressInput from 'src/components/forms/AddressInput'
|
|||||||
import Field from 'src/components/forms/Field'
|
import Field from 'src/components/forms/Field'
|
||||||
import SelectField from 'src/components/forms/SelectField'
|
import SelectField from 'src/components/forms/SelectField'
|
||||||
import TextField from 'src/components/forms/TextField'
|
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 Block from 'src/components/layout/Block'
|
||||||
import Button from 'src/components/layout/Button'
|
import Button from 'src/components/layout/Button'
|
||||||
import Col from 'src/components/layout/Col'
|
import Col from 'src/components/layout/Col'
|
||||||
@ -129,7 +136,7 @@ const SafeOwners = (props) => {
|
|||||||
placeholder="Owner Name*"
|
placeholder="Owner Name*"
|
||||||
text="Owner Name"
|
text="Owner Name"
|
||||||
type="text"
|
type="text"
|
||||||
validate={required}
|
validate={composeValidators(required, minMaxLength(1, 50))}
|
||||||
testId={`create-safe-owner-name-field-${index}`}
|
testId={`create-safe-owner-name-field-${index}`}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user