From b997e9ecf06cb1ed58ca8d1ee42cc4729e44cea4 Mon Sep 17 00:00:00 2001 From: Liordino Neto Date: Thu, 24 Sep 2020 21:12:45 -0300 Subject: [PATCH] fix: allow text on company number fix: data wasn't updated after saving fix: fixed switches on all of the operator info pages --- .../OperatorInfo/CoinATMRadar/CoinATMRadar.js | 8 ++++--- .../src/pages/OperatorInfo/ContactInfo.js | 8 +++---- .../ReceiptPrinting/ReceiptPrinting.js | 2 +- .../src/pages/OperatorInfo/TermsConditions.js | 23 +++++++++---------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/new-lamassu-admin/src/pages/OperatorInfo/CoinATMRadar/CoinATMRadar.js b/new-lamassu-admin/src/pages/OperatorInfo/CoinATMRadar/CoinATMRadar.js index 4bdf6d4e..5ab2e063 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/CoinATMRadar/CoinATMRadar.js +++ b/new-lamassu-admin/src/pages/OperatorInfo/CoinATMRadar/CoinATMRadar.js @@ -51,6 +51,8 @@ const CoinATMRadar = memo(() => { refetchQueries: ['getData'] }) + const classes = useStyles() + const save = it => saveConfig({ variables: { config: toNamespace(namespaces.COIN_ATM_RADAR, it) } @@ -81,7 +83,7 @@ const CoinATMRadar = memo(() => { save({ active: value })} label={coinAtmRadarConfig.active ? 'Yes' : 'No'} /> @@ -89,13 +91,13 @@ const CoinATMRadar = memo(() => { save({ commissions: value })} /> save({ limitsAndVerification: value })} /> diff --git a/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js b/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js index 541a55d1..471f6b68 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js +++ b/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js @@ -143,7 +143,7 @@ const ContactInfo = () => { .email('Please enter a valid email address') .required(), website: Yup.string(), - companyNumber: Yup.number() + companyNumber: Yup.string() }) const fields = [ @@ -181,7 +181,7 @@ const ContactInfo = () => { name: 'companyNumber', label: 'Company number', value: info.companyNumber ?? '', - component: NumberInput + component: TextInput } ] @@ -194,7 +194,7 @@ const ContactInfo = () => { initialValues: { active: info.active, name: findValue('name'), - phone: info.phone ?? '', + phone: findValue('phone'), email: findValue('email'), website: findValue('website'), companyNumber: findValue('companyNumber') @@ -210,7 +210,7 @@ const ContactInfo = () => {

Info card enabled?

save({ active: event.target.checked diff --git a/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js b/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js index b48a2787..9b901e1a 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js +++ b/new-lamassu-admin/src/pages/OperatorInfo/ReceiptPrinting/ReceiptPrinting.js @@ -52,7 +52,7 @@ const ReceiptPrinting = memo(() => {

Share information?

saveConfig({ variables: { diff --git a/new-lamassu-admin/src/pages/OperatorInfo/TermsConditions.js b/new-lamassu-admin/src/pages/OperatorInfo/TermsConditions.js index c468a925..a9efd402 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/TermsConditions.js +++ b/new-lamassu-admin/src/pages/OperatorInfo/TermsConditions.js @@ -110,19 +110,10 @@ const TermsConditions = () => { const formData = termsAndConditions ?? {} const showOnScreen = termsAndConditions?.active ?? false - const save = it => { - setError(null) - return saveConfig({ + const save = it => + saveConfig({ variables: { config: toNamespace(namespaces.TERMS_CONDITIONS, it) } }) - } - - const handleEnable = () => { - const s = !showOnScreen - save({ active: s }) - } - - if (!formData) return null const fields = [ { @@ -186,7 +177,14 @@ const TermsConditions = () => {
Show on screen - + + save({ + active: event.target.checked + }) + } + /> {showOnScreen ? 'Yes' : 'No'}
@@ -200,6 +198,7 @@ const TermsConditions = () => { )}
save(values)}