fix: component behavior for obfuscated fields

This commit is contained in:
José Oliveira 2021-02-12 16:02:54 +00:00 committed by Josh Harvey
parent fcfe16d5eb
commit 54a19b25c1
13 changed files with 233 additions and 42 deletions

View file

@ -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: 'itbit',
name: 'itBit',
hasSecret: true,
title: 'itBit (Exchange)',
elements: [
{
@ -46,5 +49,22 @@ export default {
clientSecret: Yup.string()
.max(100, 'Too long')
.required()
})
}),
getValidationSchema: account => {
const schema = {
userId: Yup.string()
.max(100, 'Too long')
.required(),
walletId: Yup.string()
.max(100, 'Too long')
.required(),
clientKey: Yup.string()
.max(100, 'Too long')
.required(),
clientSecret: Yup.string()
.max(100, 'Too long')
.test(secretTest(account?.clientSecret))
}
return Yup.object().shape(schema)
}
}