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