feat: cashbox field should now be both visible and editable

This commit is contained in:
Sérgio Salgado 2021-02-09 17:39:13 +00:00 committed by Josh Harvey
parent f780d00f4b
commit 5e7ea24d7c

View file

@ -1,6 +1,7 @@
import { useQuery, useMutation } from '@apollo/react-hooks' import { useQuery, useMutation } from '@apollo/react-hooks'
import { makeStyles } from '@material-ui/core' import { makeStyles } from '@material-ui/core'
import gql from 'graphql-tag' import gql from 'graphql-tag'
import * as R from 'ramda'
import React from 'react' import React from 'react'
import * as Yup from 'yup' import * as Yup from 'yup'
@ -112,7 +113,6 @@ const CashCassettes = () => {
name: 'cashbox', name: 'cashbox',
header: 'Cashbox', header: 'Cashbox',
width: 240, width: 240,
stripe: true,
view: value => ( view: value => (
<CashIn currency={{ code: fiatCurrency }} notes={value} total={0} /> <CashIn currency={{ code: fiatCurrency }} notes={value} total={0} />
), ),
@ -159,6 +159,8 @@ const CashCassettes = () => {
} }
] ]
const isAnyStripeFalse = () => !!R.find(R.propEq('stripe', false))(elements)
return ( return (
<> <>
<TitleSection title="Cash Cassettes" /> <TitleSection title="Cash Cassettes" />
@ -168,7 +170,7 @@ const CashCassettes = () => {
name="cashboxes" name="cashboxes"
enableEdit enableEdit
stripeWhen={isCashOutDisabled} stripeWhen={isCashOutDisabled}
disableRowEdit={isCashOutDisabled} disableRowEdit={!isAnyStripeFalse}
elements={elements} elements={elements}
data={data && data.machines} data={data && data.machines}
save={onSave} save={onSave}