fix: pr requested changes
This commit is contained in:
parent
5a6b995508
commit
b72956f92f
3 changed files with 31 additions and 33 deletions
|
|
@ -8,6 +8,7 @@ import { NumberInput } from 'src/components/inputs/formik'
|
||||||
import Autocomplete from 'src/components/inputs/formik/Autocomplete.js'
|
import Autocomplete from 'src/components/inputs/formik/Autocomplete.js'
|
||||||
import { ReactComponent as TxInIcon } from 'src/styling/icons/direction/cash-in.svg'
|
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 TxOutIcon } from 'src/styling/icons/direction/cash-out.svg'
|
||||||
|
import { primaryColor, secondaryColorDark } from 'src/styling/variables'
|
||||||
|
|
||||||
const ALL_MACHINES = {
|
const ALL_MACHINES = {
|
||||||
name: 'All Machines',
|
name: 'All Machines',
|
||||||
|
|
@ -363,33 +364,34 @@ const createCommissions = (cryptoCode, deviceId, isDefault, config) => {
|
||||||
const getCommissions = (cryptoCode, deviceId, config) => {
|
const getCommissions = (cryptoCode, deviceId, config) => {
|
||||||
const overrides = R.prop('overrides', config)
|
const overrides = R.prop('overrides', config)
|
||||||
|
|
||||||
if (overrides && !R.isEmpty(overrides)) {
|
if (!overrides && R.isEmpty(overrides)) {
|
||||||
const specificOverride = R.find(
|
return createCommissions(cryptoCode, deviceId, true, config)
|
||||||
it =>
|
|
||||||
it.machine === deviceId && _.includes(cryptoCode)(it.cryptoCurrencies)
|
|
||||||
)(overrides)
|
|
||||||
|
|
||||||
if (specificOverride !== undefined)
|
|
||||||
return createCommissions(cryptoCode, deviceId, false, specificOverride)
|
|
||||||
|
|
||||||
const machineOverride = R.find(
|
|
||||||
it =>
|
|
||||||
it.machine === deviceId && _.includes('ALL_COINS')(it.cryptoCurrencies)
|
|
||||||
)(overrides)
|
|
||||||
|
|
||||||
if (machineOverride !== undefined)
|
|
||||||
return createCommissions(cryptoCode, deviceId, false, machineOverride)
|
|
||||||
|
|
||||||
const coinOverride = R.find(
|
|
||||||
it =>
|
|
||||||
it.machine === 'ALL_MACHINES' &&
|
|
||||||
_.includes(cryptoCode)(it.cryptoCurrencies)
|
|
||||||
)(overrides)
|
|
||||||
|
|
||||||
if (coinOverride !== undefined)
|
|
||||||
return createCommissions(cryptoCode, deviceId, false, coinOverride)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const specificOverride = R.find(
|
||||||
|
it => it.machine === deviceId && _.includes(cryptoCode)(it.cryptoCurrencies)
|
||||||
|
)(overrides)
|
||||||
|
|
||||||
|
if (specificOverride !== undefined)
|
||||||
|
return createCommissions(cryptoCode, deviceId, false, specificOverride)
|
||||||
|
|
||||||
|
const machineOverride = R.find(
|
||||||
|
it =>
|
||||||
|
it.machine === deviceId && _.includes('ALL_COINS')(it.cryptoCurrencies)
|
||||||
|
)(overrides)
|
||||||
|
|
||||||
|
if (machineOverride !== undefined)
|
||||||
|
return createCommissions(cryptoCode, deviceId, false, machineOverride)
|
||||||
|
|
||||||
|
const coinOverride = R.find(
|
||||||
|
it =>
|
||||||
|
it.machine === 'ALL_MACHINES' &&
|
||||||
|
_.includes(cryptoCode)(it.cryptoCurrencies)
|
||||||
|
)(overrides)
|
||||||
|
|
||||||
|
if (coinOverride !== undefined)
|
||||||
|
return createCommissions(cryptoCode, deviceId, false, coinOverride)
|
||||||
|
|
||||||
return createCommissions(cryptoCode, deviceId, true, config)
|
return createCommissions(cryptoCode, deviceId, true, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -425,7 +427,7 @@ const getListCommissionsSchema = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTextStyle = (obj, isEditing) => {
|
const getTextStyle = (obj, isEditing) => {
|
||||||
return { color: obj.default ? '#1b2559' : '#44e188' }
|
return { color: obj.default ? primaryColor : secondaryColorDark }
|
||||||
}
|
}
|
||||||
|
|
||||||
const commissionsList = (auxData, currency, auxElements) => {
|
const commissionsList = (auxData, currency, auxElements) => {
|
||||||
|
|
@ -436,10 +438,6 @@ const commissionsList = (auxData, currency, auxElements) => {
|
||||||
|
|
||||||
const getListCommissionsFields = (getData, currency, defaults) => {
|
const getListCommissionsFields = (getData, currency, defaults) => {
|
||||||
const machineData = [ALL_MACHINES].concat(getData(['machines']))
|
const machineData = [ALL_MACHINES].concat(getData(['machines']))
|
||||||
// const rawCryptos = getData(['cryptoCurrencies'])
|
|
||||||
// const cryptoData = R.map(it => ({ display: it.code, code: it.code }))(
|
|
||||||
// rawCryptos ?? []
|
|
||||||
// )
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import {
|
||||||
import { Info3 } from 'src/components/typography'
|
import { Info3 } from 'src/components/typography'
|
||||||
import typographyStyles from 'src/components/typography/styles'
|
import typographyStyles from 'src/components/typography/styles'
|
||||||
import { offColor } from 'src/styling/variables'
|
import { offColor } from 'src/styling/variables'
|
||||||
import { toFirstUpper } from 'src/utils/string'
|
import { startCase } from 'src/utils/string'
|
||||||
|
|
||||||
import logsStyles from './Logs.styles'
|
import logsStyles from './Logs.styles'
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ const Logs = () => {
|
||||||
R.concat(defaultLogLevels),
|
R.concat(defaultLogLevels),
|
||||||
R.map(it => ({
|
R.map(it => ({
|
||||||
code: R.path(['logLevel'])(it),
|
code: R.path(['logLevel'])(it),
|
||||||
display: toFirstUpper(R.path(['logLevel'])(it))
|
display: startCase(R.path(['logLevel'])(it))
|
||||||
})),
|
})),
|
||||||
R.path(['serverLogs'])
|
R.path(['serverLogs'])
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,4 @@ const startCase = R.compose(
|
||||||
splitOnUpper
|
splitOnUpper
|
||||||
)
|
)
|
||||||
|
|
||||||
export { startCase, toFirstUpper, onlyFirstToUpper, formatLong }
|
export { startCase, onlyFirstToUpper, formatLong }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue