fix: make table fields show a '-' instead of an empty string when the

col content is null

fix: make all notifications fields optional

fix: make the notifications overrides fields valid only if the machine/
cryptocurrency and at least one of the other options are filled
This commit is contained in:
Liordino Neto 2020-10-06 17:59:27 -03:00 committed by Josh Harvey
parent bbf98b4d52
commit f9be68f98a
6 changed files with 74 additions and 32 deletions

View file

@ -10,6 +10,7 @@ import { Cashbox } from '../../../components/inputs/cashbox/Cashbox'
import NotificationsCtx from '../NotificationsContext'
import Header from '../components/EditHeader'
import EditableNumber from '../components/EditableNumber'
import { transformNumber } from '../helper'
import styles from './FiatBalanceAlerts.styles.js'
@ -19,6 +20,7 @@ const NAME = 'fiatBalanceAlerts'
const FiatBalance = ({
section,
min = 0,
max = Number.MAX_SAFE_INTEGER,
fieldWidth = 80
}) => {
@ -31,15 +33,17 @@ const FiatBalance = ({
const schema = Yup.object().shape({
fiatBalanceCassette1: Yup.number()
.transform(transformNumber)
.integer()
.min(0)
.min(min)
.max(max)
.required(),
.nullable(),
fiatBalanceCassette2: Yup.number()
.transform(transformNumber)
.integer()
.min(0)
.min(min)
.max(max)
.required()
.nullable()
})
const fiatBalanceCassette1Percent =