Loading...
} {!loading && data?.map((it, idx) => ( -Available balance
-Total balance in wallets
-Total assets
-ATM Wallets
-Pazuz fiat balance
-Hedging reserve
-Available balance
-{it.extraInfo}
-Fiat balance history
-{title}
-{'Customer data'}
- {// TODO: Remove false condition for next release - false && ( - <> - {
InverseIcon={CardIdInverseIcon}>
@@ -323,7 +314,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
Icon={CamIdIcon}
InverseIcon={CamIdInverseIcon}>
@@ -334,7 +325,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
Icon={CamIdIcon}
InverseIcon={CamIdInverseIcon}>
diff --git a/new-lamassu-admin/src/pages/Transactions/Transactions.js b/new-lamassu-admin/src/pages/Transactions/Transactions.jsx
similarity index 94%
rename from new-lamassu-admin/src/pages/Transactions/Transactions.js
rename to new-lamassu-admin/src/pages/Transactions/Transactions.jsx
index 8fe9c986..b8afa09a 100644
--- a/new-lamassu-admin/src/pages/Transactions/Transactions.js
+++ b/new-lamassu-admin/src/pages/Transactions/Transactions.jsx
@@ -1,23 +1,23 @@
import { useQuery } from '@apollo/react-hooks'
-import { utils as coinUtils } from '@lamassu/coins'
+import { toUnit, formatCryptoAddress } from '@lamassu/coins/lightUtils'
import { makeStyles } from '@material-ui/core'
import BigNumber from 'bignumber.js'
import gql from 'graphql-tag'
import * as R from 'ramda'
import React, { useEffect, useState } from 'react'
import { useHistory } from 'react-router-dom'
-
import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper'
import SearchBox from 'src/components/SearchBox'
import SearchFilter from 'src/components/SearchFilter'
import Title from 'src/components/Title'
import { HelpTooltip } from 'src/components/Tooltip'
-import { SupportLinkButton } from 'src/components/buttons'
import DataTable from 'src/components/tables/DataTable'
-import { ReactComponent as TxInIcon } from 'src/styling/icons/direction/cash-in.svg'
-import { ReactComponent as TxOutIcon } from 'src/styling/icons/direction/cash-out.svg'
-import { ReactComponent as CustomerLinkIcon } from 'src/styling/icons/month arrows/right.svg'
-import { ReactComponent as CustomerLinkWhiteIcon } from 'src/styling/icons/month arrows/right_white.svg'
+import TxInIcon from 'src/styling/icons/direction/cash-in.svg?react'
+import TxOutIcon from 'src/styling/icons/direction/cash-out.svg?react'
+import CustomerLinkIcon from 'src/styling/icons/month arrows/right.svg?react'
+import CustomerLinkWhiteIcon from 'src/styling/icons/month arrows/right_white.svg?react'
+
+import { SupportLinkButton } from 'src/components/buttons'
import { errorColor } from 'src/styling/variables'
import * as Customer from 'src/utils/customer'
import { formatDate } from 'src/utils/timezones'
@@ -214,13 +214,13 @@ const Transactions = () => {
textAlign: 'right',
size: 'sm',
view: it =>
- `${coinUtils.toUnit(new BigNumber(it.cryptoAtoms), it.cryptoCode)} ${
+ `${toUnit(new BigNumber(it.cryptoAtoms), it.cryptoCode)} ${
it.cryptoCode
}`
},
{
header: 'Address',
- view: it => coinUtils.formatCryptoAddress(it.cryptoCode, it.toAddress),
+ view: it => formatCryptoAddress(it.cryptoCode, it.toAddress),
className: classes.overflowTd,
size: 'sm',
width: 140
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/CustomInfoRequests.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/CustomInfoRequests.jsx
similarity index 97%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/CustomInfoRequests.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/CustomInfoRequests.jsx
index d478a842..079a6756 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/CustomInfoRequests.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/CustomInfoRequests.jsx
@@ -4,13 +4,13 @@ import classnames from 'classnames'
import gql from 'graphql-tag'
import * as R from 'ramda'
import React, { useState } from 'react'
-
import { DeleteDialog } from 'src/components/DeleteDialog'
-import { IconButton, Button, Link } from 'src/components/buttons'
import DataTable from 'src/components/tables/DataTable'
import { Info1, Info3, P } from 'src/components/typography'
-import { ReactComponent as DeleteIcon } from 'src/styling/icons/action/delete/enabled.svg'
-import { ReactComponent as EditIcon } from 'src/styling/icons/action/edit/enabled.svg'
+import DeleteIcon from 'src/styling/icons/action/delete/enabled.svg?react'
+import EditIcon from 'src/styling/icons/action/edit/enabled.svg?react'
+
+import { IconButton, Button, Link } from 'src/components/buttons'
import { fromNamespace, namespaces, toNamespace } from 'src/utils/config'
import styles from './CustomInfoRequests.styles'
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/DetailsCard.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/DetailsCard.jsx
similarity index 99%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/DetailsCard.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/DetailsCard.jsx
index dda9bb4c..9d056395 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/DetailsCard.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/DetailsCard.jsx
@@ -1,7 +1,6 @@
import { makeStyles } from '@material-ui/core'
import classnames from 'classnames'
import React from 'react'
-
import { Label1, Info2 } from 'src/components/typography'
const styles = {
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/ChooseType.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/ChooseType.jsx
similarity index 83%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/ChooseType.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/ChooseType.jsx
index 2efeea83..c70b732c 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/ChooseType.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/ChooseType.jsx
@@ -1,12 +1,12 @@
import { Field } from 'formik'
import React from 'react'
-import * as Yup from 'yup'
-
import ToggleButtonGroup from 'src/components/inputs/formik/ToggleButtonGroup'
import { H4 } from 'src/components/typography'
-import { ReactComponent as Keyboard } from 'src/styling/icons/compliance/keyboard.svg'
-import { ReactComponent as Keypad } from 'src/styling/icons/compliance/keypad.svg'
-import { ReactComponent as List } from 'src/styling/icons/compliance/list.svg'
+import Keyboard from 'src/styling/icons/compliance/keyboard.svg?react'
+import Keypad from 'src/styling/icons/compliance/keypad.svg?react'
+import List from 'src/styling/icons/compliance/list.svg?react'
+import * as Yup from 'yup'
+
import { zircon } from 'src/styling/variables'
const MakeIcon = IconSvg => (
@@ -65,9 +65,7 @@ const ChooseType = () => {
}
const validationSchema = Yup.object().shape({
- inputType: Yup.string()
- .label('Input type')
- .required()
+ inputType: Yup.string().label('Input type').required()
})
const defaultValues = {
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/NameOfRequirement.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/NameOfRequirement.jsx
similarity index 99%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/NameOfRequirement.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/NameOfRequirement.jsx
index a9ef4593..1f0b9b14 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/NameOfRequirement.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/NameOfRequirement.jsx
@@ -1,10 +1,9 @@
import { Field } from 'formik'
import * as R from 'ramda'
import React from 'react'
-import * as Yup from 'yup'
-
import TextInputFormik from 'src/components/inputs/formik/TextInput'
import { H4, P } from 'src/components/typography'
+import * as Yup from 'yup'
const NameOfRequirement = () => {
return (
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen1Information.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen1Information.jsx
similarity index 87%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen1Information.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen1Information.jsx
index c7f0de6d..4e338d5f 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen1Information.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen1Information.jsx
@@ -1,9 +1,8 @@
import { Field } from 'formik'
import React from 'react'
-import * as Yup from 'yup'
-
import TextInputFormik from 'src/components/inputs/formik/TextInput'
import { H4, P } from 'src/components/typography'
+import * as Yup from 'yup'
const Screen1Information = () => {
return (
@@ -32,12 +31,8 @@ const Screen1Information = () => {
}
const validationSchema = Yup.object().shape({
- screen1Title: Yup.string()
- .label('Screen title')
- .required(),
- screen1Text: Yup.string()
- .label('Screen text')
- .required()
+ screen1Title: Yup.string().label('Screen title').required(),
+ screen1Text: Yup.string().label('Screen text').required()
})
const defaultValues = {
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen2Information.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen2Information.jsx
similarity index 86%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen2Information.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen2Information.jsx
index 0003dd1c..0f455cb5 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen2Information.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/Screen2Information.jsx
@@ -1,9 +1,8 @@
import { Field } from 'formik'
import React from 'react'
-import * as Yup from 'yup'
-
import TextInputFormik from 'src/components/inputs/formik/TextInput'
import { H4, P } from 'src/components/typography'
+import * as Yup from 'yup'
const ScreenInformation = () => {
return (
@@ -30,12 +29,8 @@ const ScreenInformation = () => {
}
const validationSchema = Yup.object().shape({
- screen2Title: Yup.string()
- .label('Screen title')
- .required(),
- screen2Text: Yup.string()
- .label('Screen text')
- .required()
+ screen2Title: Yup.string().label('Screen title').required(),
+ screen2Text: Yup.string().label('Screen text').required()
})
const defaultValues = {
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/ChoiceList.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/ChoiceList.jsx
similarity index 94%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/ChoiceList.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/ChoiceList.jsx
index 20a82f82..91f66b19 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/ChoiceList.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/ChoiceList.jsx
@@ -3,13 +3,12 @@ import classnames from 'classnames'
import { Field, useFormikContext, FieldArray } from 'formik'
import * as R from 'ramda'
import React, { useEffect, useRef } from 'react'
-
import Button from 'src/components/buttons/ActionButton'
import RadioGroup from 'src/components/inputs/formik/RadioGroup'
import TextInput from 'src/components/inputs/formik/TextInput'
import { H4 } from 'src/components/typography'
-import { ReactComponent as AddIconInverse } from 'src/styling/icons/button/add/white.svg'
-import { ReactComponent as AddIcon } from 'src/styling/icons/button/add/zodiac.svg'
+import AddIconInverse from 'src/styling/icons/button/add/white.svg?react'
+import AddIcon from 'src/styling/icons/button/add/zodiac.svg?react'
import styles from './formStyles.styles'
const useStyles = makeStyles(styles)
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/NumericalEntry.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/NumericalEntry.jsx
similarity index 99%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/NumericalEntry.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/NumericalEntry.jsx
index 7f68c8ee..49985224 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/NumericalEntry.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/NumericalEntry.jsx
@@ -3,7 +3,6 @@ import classnames from 'classnames'
import { Field, useFormikContext } from 'formik'
import * as R from 'ramda'
import React from 'react'
-
import NumberInput from 'src/components/inputs/formik/NumberInput'
import RadioGroup from 'src/components/inputs/formik/RadioGroup'
import { TL1, H4 } from 'src/components/typography'
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/TextEntry.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/TextEntry.jsx
similarity index 99%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/TextEntry.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/TextEntry.jsx
index 27bfb226..f5baec02 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/TextEntry.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/TextEntry.jsx
@@ -3,7 +3,6 @@ import classnames from 'classnames'
import { Field, useFormikContext } from 'formik'
import * as R from 'ramda'
import React from 'react'
-
import RadioGroup from 'src/components/inputs/formik/RadioGroup'
import TextInput from 'src/components/inputs/formik/TextInput'
import { H4 } from 'src/components/typography'
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/index.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/index.jsx
similarity index 71%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/index.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/index.jsx
index 2516d37e..a8d15192 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/index.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Forms/TypeFields/index.jsx
@@ -40,38 +40,27 @@ const validationSchema = Yup.lazy(values => {
switch (values.inputType) {
case 'numerical':
return Yup.object({
- constraintType: Yup.string()
- .label('Constraint type')
- .required(),
+ constraintType: Yup.string().label('Constraint type').required(),
inputLength: Yup.number().when('constraintType', {
is: 'length',
- then: Yup.number()
- .min(0)
- .required('The number of digits is required'),
- else: Yup.mixed().notRequired()
+ then: schema =>
+ schema.min(0).required('The number of digits is required'),
+ otherwise: schema => schema.mixed().notRequired()
})
})
case 'text':
return Yup.object({
- constraintType: Yup.string()
- .label('Constraint type')
- .required(),
- inputLabel1: Yup.string()
- .label('Text entry label')
- .required(),
+ constraintType: Yup.string().label('Constraint type').required(),
+ inputLabel1: Yup.string().label('Text entry label').required(),
inputLabel2: Yup.string().when('constraintType', {
is: 'spaceSeparation',
- then: Yup.string()
- .label('Second word label')
- .required(),
- else: Yup.mixed().notRequired()
+ then: schema => schema.label('Second word label').required(),
+ otherwise: schema => schema.mixed().notRequired()
})
})
case 'choiceList':
return Yup.object({
- constraintType: Yup.string()
- .label('Constraint type')
- .required(),
+ constraintType: Yup.string().label('Constraint type').required(),
listChoices: Yup.array().test(
'has-2-or-more',
'Choice list needs to have two or more non empty fields',
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Wizard.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Wizard.jsx
similarity index 100%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Wizard.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Wizard.jsx
index ddb020d9..e4d75857 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Wizard.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/Wizard.jsx
@@ -2,10 +2,10 @@ import { makeStyles } from '@material-ui/core'
import { Form, Formik } from 'formik'
import * as R from 'ramda'
import React, { useState } from 'react'
-
import ErrorMessage from 'src/components/ErrorMessage'
import Modal from 'src/components/Modal'
import Stepper from 'src/components/Stepper'
+
import { Button } from 'src/components/buttons'
import ChooseType, {
diff --git a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/WizardSplash.js b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/WizardSplash.jsx
similarity index 93%
rename from new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/WizardSplash.js
rename to new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/WizardSplash.jsx
index 494d5775..17352b54 100644
--- a/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/WizardSplash.js
+++ b/new-lamassu-admin/src/pages/Triggers/CustomInfoRequests/WizardSplash.jsx
@@ -1,9 +1,9 @@
import { makeStyles } from '@material-ui/core'
import React from 'react'
+import { H1, P } from 'src/components/typography'
+import CustomReqLogo from 'src/styling/icons/compliance/custom-requirement.svg?react'
import { Button } from 'src/components/buttons'
-import { H1, P } from 'src/components/typography'
-import { ReactComponent as CustomReqLogo } from 'src/styling/icons/compliance/custom-requirement.svg'
const styles = {
logo: {
diff --git a/new-lamassu-admin/src/pages/Triggers/TriggerView.js b/new-lamassu-admin/src/pages/Triggers/TriggerView.jsx
similarity index 100%
rename from new-lamassu-admin/src/pages/Triggers/TriggerView.js
rename to new-lamassu-admin/src/pages/Triggers/TriggerView.jsx
index 5333184a..4034580a 100644
--- a/new-lamassu-admin/src/pages/Triggers/TriggerView.js
+++ b/new-lamassu-admin/src/pages/Triggers/TriggerView.jsx
@@ -3,11 +3,11 @@ import { makeStyles, Box } from '@material-ui/core'
import gql from 'graphql-tag'
import * as R from 'ramda'
import React, { useState } from 'react'
+import { H2 } from 'src/components/typography'
import { v4 } from 'uuid'
import { Button } from 'src/components/buttons'
import { Table as EditableTable } from 'src/components/editableTable'
-import { H2 } from 'src/components/typography'
import { fromNamespace, namespaces } from 'src/utils/config'
import styles from './Triggers.styles'
diff --git a/new-lamassu-admin/src/pages/Triggers/Triggers.js b/new-lamassu-admin/src/pages/Triggers/Triggers.jsx
similarity index 94%
rename from new-lamassu-admin/src/pages/Triggers/Triggers.js
rename to new-lamassu-admin/src/pages/Triggers/Triggers.jsx
index 02a9fc49..bb57dc26 100644
--- a/new-lamassu-admin/src/pages/Triggers/Triggers.js
+++ b/new-lamassu-admin/src/pages/Triggers/Triggers.jsx
@@ -4,19 +4,19 @@ import classnames from 'classnames'
import gql from 'graphql-tag'
import * as R from 'ramda'
import React, { useState } from 'react'
-
import Modal from 'src/components/Modal'
import { HelpTooltip } from 'src/components/Tooltip'
-import { Link, SupportLinkButton } from 'src/components/buttons'
-import { Switch } from 'src/components/inputs'
import TitleSection from 'src/components/layout/TitleSection'
import { P, Label2 } from 'src/components/typography'
import FormRenderer from 'src/pages/Services/FormRenderer'
+import ReverseCustomInfoIcon from 'src/styling/icons/circle buttons/filter/white.svg?react'
+import CustomInfoIcon from 'src/styling/icons/circle buttons/filter/zodiac.svg?react'
+import ReverseSettingsIcon from 'src/styling/icons/circle buttons/settings/white.svg?react'
+import SettingsIcon from 'src/styling/icons/circle buttons/settings/zodiac.svg?react'
+
+import { Link, SupportLinkButton } from 'src/components/buttons'
+import { Switch } from 'src/components/inputs'
import twilioSchema from 'src/pages/Services/schemas/twilio'
-import { ReactComponent as ReverseCustomInfoIcon } from 'src/styling/icons/circle buttons/filter/white.svg'
-import { ReactComponent as CustomInfoIcon } from 'src/styling/icons/circle buttons/filter/zodiac.svg'
-import { ReactComponent as ReverseSettingsIcon } from 'src/styling/icons/circle buttons/settings/white.svg'
-import { ReactComponent as SettingsIcon } from 'src/styling/icons/circle buttons/settings/zodiac.svg'
import { fromNamespace, toNamespace } from 'src/utils/config'
import CustomInfoRequests from './CustomInfoRequests'
@@ -65,9 +65,8 @@ const Triggers = () => {
const classes = useStyles()
const [wizardType, setWizard] = useState(false)
const { data, loading: configLoading, refetch } = useQuery(GET_CONFIG)
- const { data: customInfoReqData, loading: customInfoLoading } = useQuery(
- GET_CUSTOM_REQUESTS
- )
+ const { data: customInfoReqData, loading: customInfoLoading } =
+ useQuery(GET_CUSTOM_REQUESTS)
const [error, setError] = useState(null)
const [subMenu, setSubMenu] = useState(false)
diff --git a/new-lamassu-admin/src/pages/Triggers/Wizard.js b/new-lamassu-admin/src/pages/Triggers/Wizard.jsx
similarity index 100%
rename from new-lamassu-admin/src/pages/Triggers/Wizard.js
rename to new-lamassu-admin/src/pages/Triggers/Wizard.jsx
index 8b978410..4b0b0002 100644
--- a/new-lamassu-admin/src/pages/Triggers/Wizard.js
+++ b/new-lamassu-admin/src/pages/Triggers/Wizard.jsx
@@ -2,12 +2,12 @@ import { makeStyles } from '@material-ui/core'
import { Form, Formik, useFormikContext } from 'formik'
import * as R from 'ramda'
import React, { useState, Fragment, useEffect } from 'react'
-
import ErrorMessage from 'src/components/ErrorMessage'
import Modal from 'src/components/Modal'
import Stepper from 'src/components/Stepper'
-import { Button } from 'src/components/buttons'
import { H5, Info3 } from 'src/components/typography'
+
+import { Button } from 'src/components/buttons'
import { comet } from 'src/styling/variables'
import { singularOrPlural } from 'src/utils/string'
diff --git a/new-lamassu-admin/src/pages/Triggers/components/AdvancedTriggers.js b/new-lamassu-admin/src/pages/Triggers/components/AdvancedTriggers.jsx
similarity index 98%
rename from new-lamassu-admin/src/pages/Triggers/components/AdvancedTriggers.js
rename to new-lamassu-admin/src/pages/Triggers/components/AdvancedTriggers.jsx
index 038a6825..dbb86200 100644
--- a/new-lamassu-admin/src/pages/Triggers/components/AdvancedTriggers.js
+++ b/new-lamassu-admin/src/pages/Triggers/components/AdvancedTriggers.jsx
@@ -2,9 +2,9 @@ import { useMutation, useQuery } from '@apollo/react-hooks'
import gql from 'graphql-tag'
import * as R from 'ramda'
import React, { memo, useState } from 'react'
+import Section from 'src/components/layout/Section'
import { Table as EditableTable } from 'src/components/editableTable'
-import Section from 'src/components/layout/Section'
import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
import {
@@ -45,9 +45,8 @@ const AdvancedTriggersSettings = memo(() => {
const [isEditingOverrides, setEditingOverrides] = useState(false)
const { data, loading: configLoading } = useQuery(GET_INFO)
- const { data: customInfoReqData, loading: customInfoLoading } = useQuery(
- GET_CUSTOM_REQUESTS
- )
+ const { data: customInfoReqData, loading: customInfoLoading } =
+ useQuery(GET_CUSTOM_REQUESTS)
const customInfoRequests =
R.path(['customInfoRequests'])(customInfoReqData) ?? []
diff --git a/new-lamassu-admin/src/pages/Triggers/components/helper.js b/new-lamassu-admin/src/pages/Triggers/components/helper.js
index 1ab870b8..f1ab47b3 100644
--- a/new-lamassu-admin/src/pages/Triggers/components/helper.js
+++ b/new-lamassu-admin/src/pages/Triggers/components/helper.js
@@ -1,8 +1,7 @@
import * as R from 'ramda'
-import * as Yup from 'yup'
-
-import Autocomplete from 'src/components/inputs/formik/Autocomplete.js'
+import Autocomplete from 'src/components/inputs/formik/Autocomplete'
import { getView } from 'src/pages/Triggers/helper'
+import * as Yup from 'yup'
const buildAdvancedRequirementOptions = customInfoRequests => {
const base = [
@@ -31,9 +30,7 @@ const displayRequirement = (code, customInfoRequests) => {
}
const defaultSchema = Yup.object().shape({
- expirationTime: Yup.string()
- .label('Expiration time')
- .required(),
+ expirationTime: Yup.string().label('Expiration time').required(),
automation: Yup.string()
.label('Automation')
.matches(/(Manual|Automatic)/)
@@ -61,9 +58,7 @@ const getOverridesSchema = (values, customInfoRequests) => {
return true
}
}),
- expirationTime: Yup.string()
- .label('Expiration time')
- .required(),
+ expirationTime: Yup.string().label('Expiration time').required(),
automation: Yup.string()
.label('Automation')
.matches(/(Manual|Automatic)/)
diff --git a/new-lamassu-admin/src/pages/Triggers/helper.js b/new-lamassu-admin/src/pages/Triggers/helper.jsx
similarity index 95%
rename from new-lamassu-admin/src/pages/Triggers/helper.js
rename to new-lamassu-admin/src/pages/Triggers/helper.jsx
index 7ede67b2..a0e613ee 100644
--- a/new-lamassu-admin/src/pages/Triggers/helper.js
+++ b/new-lamassu-admin/src/pages/Triggers/helper.jsx
@@ -3,16 +3,16 @@ import classnames from 'classnames'
import { Field, useFormikContext } from 'formik'
import * as R from 'ramda'
import React, { memo } from 'react'
+import { H4, Label2, Label1, Info1, Info2 } from 'src/components/typography'
import * as Yup from 'yup'
import { NumberInput, RadioGroup, Dropdown } from 'src/components/inputs/formik'
-import { H4, Label2, Label1, Info1, Info2 } from 'src/components/typography'
import { errorColor } from 'src/styling/variables'
import { transformNumber } from 'src/utils/number'
import { onlyFirstToUpper } from 'src/utils/string'
-// import { ReactComponent as TxInIcon } from 'src/styling/icons/direction/cash-in.svg'
-// import { ReactComponent as TxOutIcon } from 'src/styling/icons/direction/cash-out.svg'
+// import TxInIcon from 'src/styling/icons/direction/cash-in.svg?react'
+// import TxOutIcon from 'src/styling/icons/direction/cash-out.svg?react'
const useStyles = makeStyles({
radioLabel: {
@@ -110,9 +110,7 @@ const threshold = Yup.object().shape({
const requirement = Yup.object().shape({
requirement: Yup.string().required(),
- suspensionDays: Yup.number()
- .transform(transformNumber)
- .nullable()
+ suspensionDays: Yup.number().transform(transformNumber).nullable()
})
const Schema = Yup.object()
@@ -266,12 +264,8 @@ const typeSchema = Yup.object()
'The trigger type is required'
),
threshold: Yup.object({
- threshold: Yup.number()
- .transform(transformNumber)
- .nullable(),
- thresholdDays: Yup.number()
- .transform(transformNumber)
- .nullable()
+ threshold: Yup.number().transform(transformNumber).nullable(),
+ thresholdDays: Yup.number().transform(transformNumber).nullable()
})
})
.test(({ threshold, triggerType }, context) => {
@@ -327,13 +321,8 @@ const typeOptions = [
const Type = ({ ...props }) => {
const classes = useStyles()
- const {
- errors,
- touched,
- values,
- setTouched,
- handleChange
- } = useFormikContext()
+ const { errors, touched, values, setTouched, handleChange } =
+ useFormikContext()
const typeClass = {
[classes.error]: errors.triggerType && touched.triggerType
@@ -484,26 +473,16 @@ const requirementSchema = Yup.object()
requirement: Yup.string().required(),
suspensionDays: Yup.number().when('requirement', {
is: value => value === 'suspend',
- then: Yup.number()
- .nullable()
- .transform(transformNumber),
- otherwise: Yup.number()
- .nullable()
- .transform(() => null)
+ then: schema => schema.nullable().transform(transformNumber),
+ otherwise: schema => schema.nullable().transform(() => null)
}),
customInfoRequestId: Yup.string().when('requirement', {
- is: value => value === 'custom',
- then: Yup.string(),
- otherwise: Yup.string()
- .nullable()
- .transform(() => '')
+ is: value => value !== 'custom',
+ then: schema => schema.nullable().transform(() => '')
}),
externalService: Yup.string().when('requirement', {
- is: value => value === 'external',
- then: Yup.string(),
- otherwise: Yup.string()
- .nullable()
- .transform(() => '')
+ is: value => value !== 'external',
+ then: schema => schema.nullable().transform(() => '')
})
}).required()
})
@@ -585,13 +564,8 @@ const Requirement = ({
customInfoRequests = []
}) => {
const classes = useStyles()
- const {
- touched,
- errors,
- values,
- handleChange,
- setTouched
- } = useFormikContext()
+ const { touched, errors, values, handleChange, setTouched } =
+ useFormikContext()
const isSuspend = values?.requirement?.requirement === 'suspend'
const isCustom = values?.requirement?.requirement === 'custom'
@@ -768,9 +742,9 @@ const RequirementInput = ({ customInfoRequests = [] }) => {
R.path(['requirement', 'customInfoRequestId'])(values) ?? ''
const isSuspend = requirement === 'suspend'
const display = customRequestId
- ? R.path(['customRequest', 'name'])(
+ ? (R.path(['customRequest', 'name'])(
R.find(customReqIdMatches(customRequestId))(customInfoRequests)
- ) ?? ''
+ ) ?? '')
: getView(requirementOptions, 'display')(requirement)
return (
@@ -800,12 +774,12 @@ const RequirementView = ({
const classes = useStyles()
const display =
requirement === 'custom'
- ? R.path(['customRequest', 'name'])(
+ ? (R.path(['customRequest', 'name'])(
R.find(customReqIdMatches(customInfoRequestId))(customInfoRequests)
- ) ?? ''
+ ) ?? '')
: requirement === 'external'
- ? `External verification (${onlyFirstToUpper(externalService)})`
- : getView(requirementOptions, 'display')(requirement)
+ ? `External verification (${onlyFirstToUpper(externalService)})`
+ : getView(requirementOptions, 'display')(requirement)
const isSuspend = requirement === 'suspend'
return (