fix: component behavior for obfuscated fields
This commit is contained in:
parent
fcfe16d5eb
commit
54a19b25c1
13 changed files with 233 additions and 42 deletions
|
|
@ -3,9 +3,12 @@ import * as Yup from 'yup'
|
|||
import SecretInputFormik from 'src/components/inputs/formik/SecretInput'
|
||||
import TextInputFormik from 'src/components/inputs/formik/TextInput'
|
||||
|
||||
import secretTest from './helper'
|
||||
|
||||
export default {
|
||||
code: 'infura',
|
||||
name: 'Infura',
|
||||
hasSecret: true,
|
||||
title: 'Infura (Wallet)',
|
||||
elements: [
|
||||
{
|
||||
|
|
@ -37,5 +40,19 @@ export default {
|
|||
endpoint: Yup.string()
|
||||
.max(100, 'Too long')
|
||||
.required()
|
||||
})
|
||||
}),
|
||||
getValidationSchema: account => {
|
||||
const schema = {
|
||||
apiKey: Yup.string()
|
||||
.max(100, 'Too long')
|
||||
.required(),
|
||||
apiSecret: Yup.string()
|
||||
.max(100, 'Too long')
|
||||
.test(secretTest(account?.apiSecret)),
|
||||
endpoint: Yup.string()
|
||||
.max(100, 'Too long')
|
||||
.required()
|
||||
}
|
||||
return Yup.object().shape(schema)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue