From f7ea781f4effcf686b8bb4b97aa546ba981ed9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Wed, 2 Mar 2022 16:58:47 +0000 Subject: [PATCH 1/2] fix: disable miners fee overrides field --- .../src/components/inputs/formik/Checkbox.js | 2 +- new-lamassu-admin/src/pages/Wallet/helper.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/new-lamassu-admin/src/components/inputs/formik/Checkbox.js b/new-lamassu-admin/src/components/inputs/formik/Checkbox.js index 5c184ab0..aa1768ad 100644 --- a/new-lamassu-admin/src/components/inputs/formik/Checkbox.js +++ b/new-lamassu-admin/src/components/inputs/formik/Checkbox.js @@ -11,7 +11,7 @@ const CheckboxInput = memo( disabledMessage = '', ...props }) => { - const { name, onChange, value = true } = props.field + const { name, onChange, value } = props.field const settings = { enabled: enabled, diff --git a/new-lamassu-admin/src/pages/Wallet/helper.js b/new-lamassu-admin/src/pages/Wallet/helper.js index 1b341dee..a12f8a73 100644 --- a/new-lamassu-admin/src/pages/Wallet/helper.js +++ b/new-lamassu-admin/src/pages/Wallet/helper.js @@ -38,7 +38,7 @@ const AdvancedWalletSchema = Yup.object().shape({ const OverridesSchema = Yup.object().shape({ cryptoUnits: Yup.string().required(), - feeMultiplier: Yup.string().required(), + feeMultiplier: Yup.string(), cryptoCurrency: Yup.string().required(), allowTransactionBatching: Yup.boolean() }) @@ -100,7 +100,7 @@ const getAdvancedWalletElements = () => { }, { name: 'feeMultiplier', - header: `Miner's Fee`, + header: `BTC Miner's Fee`, size: 'sm', stripe: true, width: 250, @@ -164,13 +164,18 @@ const getAdvancedWalletElementsOverrides = ( size: 'sm', stripe: true, width: 250, - view: viewFeeMultiplier, + view: (_, ite) => { + if (ite.cryptoCurrency !== 'BTC') + return {`Default`} + return viewFeeMultiplier(ite.feeMultiplier) + }, input: Autocomplete, inputProps: { options: feeOptions, valueProp: 'code', labelProp: 'display' - } + }, + editable: it => it.cryptoCurrency === 'BTC' } ] } From 126ee7338e8fb71e11998fcc3b8583c3d5c3f685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Thu, 3 Mar 2022 16:51:48 +0000 Subject: [PATCH 2/2] fix: set default values for miners fee and batching flag --- new-lamassu-admin/src/pages/Wallet/helper.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/new-lamassu-admin/src/pages/Wallet/helper.js b/new-lamassu-admin/src/pages/Wallet/helper.js index a12f8a73..fd56ece5 100644 --- a/new-lamassu-admin/src/pages/Wallet/helper.js +++ b/new-lamassu-admin/src/pages/Wallet/helper.js @@ -38,9 +38,13 @@ const AdvancedWalletSchema = Yup.object().shape({ const OverridesSchema = Yup.object().shape({ cryptoUnits: Yup.string().required(), - feeMultiplier: Yup.string(), + feeMultiplier: Yup.string() + .default(() => '1') + .required(), cryptoCurrency: Yup.string().required(), allowTransactionBatching: Yup.boolean() + .default(() => false) + .required() }) const OverridesDefaults = { @@ -90,9 +94,10 @@ const getAdvancedWalletElements = () => { }, { name: 'allowTransactionBatching', + header: `Allow BTC Transaction Batching`, size: 'sm', stripe: true, - width: 250, + width: 260, view: (_, ite) => { return ite.allowTransactionBatching ? 'Yes' : `No` },