chore: bump yup version
This commit is contained in:
parent
c213f9b295
commit
167f9f45a8
7 changed files with 90 additions and 1153 deletions
1207
new-lamassu-admin/package-lock.json
generated
1207
new-lamassu-admin/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -5,7 +5,7 @@
|
|||
"type": "module",
|
||||
"dependencies": {
|
||||
"@apollo/react-hooks": "^3.1.3",
|
||||
"@lamassu/coins": "v1.5.1",
|
||||
"@lamassu/coins": "v1.5.3",
|
||||
"@material-ui/core": "4.12.4",
|
||||
"@material-ui/icons": "4.11.2",
|
||||
"@material-ui/lab": "^4.0.0-alpha.61",
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
"react-virtualized": "^9.21.2",
|
||||
"ua-parser-js": "^1.0.2",
|
||||
"uuid": "^8.3.2",
|
||||
"yup": "0.32.9"
|
||||
"yup": "1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-react-swc": "^3.7.2",
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ const ETable = ({
|
|||
|
||||
setSaving(true)
|
||||
|
||||
const it = validationSchema.cast(value)
|
||||
const it = validationSchema.cast(value, { assert: 'ignore-optionality'})
|
||||
const index = R.findIndex(R.propEq('id', it.id))(data)
|
||||
const list = index !== -1 ? R.update(index, it, data) : R.prepend(it, data)
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ const CryptoBalanceOverrides = ({ section }) => {
|
|||
.label('Low balance')
|
||||
.when(HIGH_BALANCE_KEY, {
|
||||
is: HIGH_BALANCE_KEY => !HIGH_BALANCE_KEY,
|
||||
then: Yup.number().required()
|
||||
then: schema => schema.required()
|
||||
})
|
||||
.transform(transformNumber)
|
||||
.integer()
|
||||
|
|
@ -76,7 +76,7 @@ const CryptoBalanceOverrides = ({ section }) => {
|
|||
.label('High balance')
|
||||
.when(LOW_BALANCE_KEY, {
|
||||
is: LOW_BALANCE_KEY => !LOW_BALANCE_KEY,
|
||||
then: Yup.number().required()
|
||||
then: schema => schema.required()
|
||||
})
|
||||
.transform(transformNumber)
|
||||
.integer()
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const buildTestValidation = (id, passphrase) => {
|
|||
.max(100, 'Too long')
|
||||
.when(id, {
|
||||
is: isDefined,
|
||||
then: Yup.string().test(secretTest(passphrase))
|
||||
then: schema => schema.test(secretTest(passphrase))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ const validationSchema = Yup.lazy(values => {
|
|||
.required(),
|
||||
inputLength: Yup.number().when('constraintType', {
|
||||
is: 'length',
|
||||
then: Yup.number()
|
||||
then: schema => schema
|
||||
.min(0)
|
||||
.required('The number of digits is required'),
|
||||
else: Yup.mixed().notRequired()
|
||||
otherwise: schema => schema.mixed().notRequired()
|
||||
})
|
||||
})
|
||||
case 'text':
|
||||
|
|
@ -61,10 +61,10 @@ const validationSchema = Yup.lazy(values => {
|
|||
.required(),
|
||||
inputLabel2: Yup.string().when('constraintType', {
|
||||
is: 'spaceSeparation',
|
||||
then: Yup.string()
|
||||
then: schema => schema
|
||||
.label('Second word label')
|
||||
.required(),
|
||||
else: Yup.mixed().notRequired()
|
||||
otherwise: schema => schema.mixed().notRequired()
|
||||
})
|
||||
})
|
||||
case 'choiceList':
|
||||
|
|
|
|||
|
|
@ -484,24 +484,22 @@ const requirementSchema = Yup.object()
|
|||
requirement: Yup.string().required(),
|
||||
suspensionDays: Yup.number().when('requirement', {
|
||||
is: value => value === 'suspend',
|
||||
then: Yup.number()
|
||||
then: schema => schema
|
||||
.nullable()
|
||||
.transform(transformNumber),
|
||||
otherwise: Yup.number()
|
||||
otherwise: schema => schema
|
||||
.nullable()
|
||||
.transform(() => null)
|
||||
}),
|
||||
customInfoRequestId: Yup.string().when('requirement', {
|
||||
is: value => value === 'custom',
|
||||
then: Yup.string(),
|
||||
otherwise: Yup.string()
|
||||
is: value => value !== 'custom',
|
||||
then: schema => schema
|
||||
.nullable()
|
||||
.transform(() => '')
|
||||
}),
|
||||
externalService: Yup.string().when('requirement', {
|
||||
is: value => value === 'external',
|
||||
then: Yup.string(),
|
||||
otherwise: Yup.string()
|
||||
is: value => value !== 'external',
|
||||
then: schema => schema
|
||||
.nullable()
|
||||
.transform(() => '')
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue