fix: disable cash cassettes when no cash-out
This commit is contained in:
parent
a710a1b33a
commit
e822737af6
2 changed files with 9 additions and 3 deletions
|
|
@ -88,7 +88,8 @@ const CashCassettes = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDenomination = id => fromNamespace(id)(cashout)
|
const getCashoutSettings = id => fromNamespace(id)(cashout)
|
||||||
|
const isCashOutDisabled = ({ id }) => !getCashoutSettings(id).active
|
||||||
|
|
||||||
const elements = [
|
const elements = [
|
||||||
{
|
{
|
||||||
|
|
@ -102,10 +103,11 @@ const CashCassettes = () => {
|
||||||
name: 'cassette1',
|
name: 'cassette1',
|
||||||
header: 'Cash-out 1',
|
header: 'Cash-out 1',
|
||||||
width: 265,
|
width: 265,
|
||||||
|
stripe: true,
|
||||||
view: (value, { id }) => (
|
view: (value, { id }) => (
|
||||||
<CashOut
|
<CashOut
|
||||||
className={classes.cashbox}
|
className={classes.cashbox}
|
||||||
denomination={getDenomination(id)?.bottom}
|
denomination={getCashoutSettings(id)?.bottom}
|
||||||
currency={{ code: fiatCurrency }}
|
currency={{ code: fiatCurrency }}
|
||||||
notes={value}
|
notes={value}
|
||||||
/>
|
/>
|
||||||
|
|
@ -119,10 +121,11 @@ const CashCassettes = () => {
|
||||||
name: 'cassette2',
|
name: 'cassette2',
|
||||||
header: 'Cash-out 2',
|
header: 'Cash-out 2',
|
||||||
width: 265,
|
width: 265,
|
||||||
|
stripe: true,
|
||||||
view: (value, { id }) => (
|
view: (value, { id }) => (
|
||||||
<CashOut
|
<CashOut
|
||||||
className={classes.cashbox}
|
className={classes.cashbox}
|
||||||
denomination={getDenomination(id)?.top}
|
denomination={getCashoutSettings(id)?.top}
|
||||||
currency={{ code: fiatCurrency }}
|
currency={{ code: fiatCurrency }}
|
||||||
notes={value}
|
notes={value}
|
||||||
/>
|
/>
|
||||||
|
|
@ -141,6 +144,8 @@ const CashCassettes = () => {
|
||||||
<EditableTable
|
<EditableTable
|
||||||
name="cashboxes"
|
name="cashboxes"
|
||||||
enableEdit
|
enableEdit
|
||||||
|
stripeWhen={isCashOutDisabled}
|
||||||
|
disableRowEdit={isCashOutDisabled}
|
||||||
elements={elements}
|
elements={elements}
|
||||||
data={data && data.machines}
|
data={data && data.machines}
|
||||||
save={onSave}
|
save={onSave}
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ const Logs = () => {
|
||||||
const getLogLevels = R.compose(
|
const getLogLevels = R.compose(
|
||||||
R.prepend(SHOW_ALL),
|
R.prepend(SHOW_ALL),
|
||||||
R.uniq,
|
R.uniq,
|
||||||
|
R.concat(['error', 'info', 'debug']),
|
||||||
R.map(R.path(['logLevel'])),
|
R.map(R.path(['logLevel'])),
|
||||||
R.path(['serverLogs'])
|
R.path(['serverLogs'])
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue