From b07c0e180a6a63e640c847c63780e8de8533adfd Mon Sep 17 00:00:00 2001 From: Taranto Date: Sat, 8 Aug 2020 08:31:23 +0100 Subject: [PATCH] fix: general screen fixes --- .../components/inputs/formik/Autocomplete.js | 2 +- .../src/components/wizard/Wizard.js | 94 ------------------- .../src/components/wizard/Wizard.styles.js | 41 -------- .../src/components/wizard/index.js | 3 - .../Customers/components/TransactionsList.js | 2 + .../src/pages/Maintenance/Cashboxes.js | 5 +- .../src/pages/OperatorInfo/ContactInfo.js | 1 + .../src/pages/Services/schemas/index.js | 2 - .../src/pages/Services/schemas/strike.js | 23 ----- new-lamassu-admin/todo.md | 85 +++++------------ 10 files changed, 32 insertions(+), 226 deletions(-) delete mode 100644 new-lamassu-admin/src/components/wizard/Wizard.js delete mode 100644 new-lamassu-admin/src/components/wizard/Wizard.styles.js delete mode 100644 new-lamassu-admin/src/components/wizard/index.js delete mode 100644 new-lamassu-admin/src/pages/Services/schemas/strike.js diff --git a/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js b/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js index 7901d10a..90e06e5a 100644 --- a/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js +++ b/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js @@ -29,7 +29,7 @@ const AutocompleteFormik = ({ options, ...props }) => { error={error} open={open} options={innerOptions} - onOpen={() => setOpen(value.length !== props.limit)} + onOpen={() => setOpen(value?.length !== props?.limit)} onClose={() => setOpen(false)} {...props} /> diff --git a/new-lamassu-admin/src/components/wizard/Wizard.js b/new-lamassu-admin/src/components/wizard/Wizard.js deleted file mode 100644 index fad882a4..00000000 --- a/new-lamassu-admin/src/components/wizard/Wizard.js +++ /dev/null @@ -1,94 +0,0 @@ -import { makeStyles } from '@material-ui/core' -import React, { useState } from 'react' - -import { Button } from 'src/components/buttons' -import { ReactComponent as CompleteIcon } from 'src/styling/icons/stage/spring/complete.svg' -import { ReactComponent as CurrentIcon } from 'src/styling/icons/stage/spring/current.svg' -import { ReactComponent as EmptyIcon } from 'src/styling/icons/stage/spring/empty.svg' - -import { mainStyles } from './Wizard.styles' - -const useStyles = makeStyles(mainStyles) - -const Wizard = ({ header, nextStepText, finalStepText, finish, children }) => { - const [currentStepIndex, setCurrentStepIndex] = useState(0) - - const classes = useStyles() - - const handleMoveToNextStep = nextStepIndex => { - const finalStepIndex = children.length - 1 - - if (nextStepIndex > finalStepIndex) { - finish() - } else { - setCurrentStepIndex(nextStepIndex) - } - } - - const currentStep = children[currentStepIndex] - const finalStepIndex = children.length - 1 - const isFinalStep = currentStepIndex === finalStepIndex - - return ( - <> -
{header}
-
-
- {/* TODO: wizard steps icons are a little strange... */} -
- {children.map((e, i) => { - const elementToRender = [] - - if (i < currentStepIndex) - elementToRender.push( - - ) - else if (i === currentStepIndex) - elementToRender.push( - - ) - else - elementToRender.push( - - ) - - if (i < currentStepIndex) - elementToRender.push( -
- ) - else if (i < finalStepIndex) - elementToRender.push( -
- ) - - return elementToRender - })} -
- {currentStep} -
- -
-
-
- - ) -} - -export default Wizard diff --git a/new-lamassu-admin/src/components/wizard/Wizard.styles.js b/new-lamassu-admin/src/components/wizard/Wizard.styles.js deleted file mode 100644 index 79258103..00000000 --- a/new-lamassu-admin/src/components/wizard/Wizard.styles.js +++ /dev/null @@ -1,41 +0,0 @@ -import { disabledColor, secondaryColor } from 'src/styling/variables' - -const mainStyles = { - columnWrapper: { - display: 'flex', - flexDirection: 'column', - height: '100%', - width: '100%' - }, - bottomRightAligned: { - alignSelf: 'flex-end', - marginLeft: 'auto', - marginTop: 'auto' - }, - body: { - display: 'flex', - height: '100%' - }, - wizardStepsWrapper: { - display: 'flex', - alignItems: 'center', - position: 'relative', - flex: 'wrap' - }, - wizardStepIcon: { - width: 24, - height: 24 - }, - unreachedStepLine: { - width: 24, - height: 2, - border: `solid 1px ${disabledColor}` - }, - reachedStepLine: { - width: 24, - height: 2, - border: `solid 1px ${secondaryColor}` - } -} - -export { mainStyles } diff --git a/new-lamassu-admin/src/components/wizard/index.js b/new-lamassu-admin/src/components/wizard/index.js deleted file mode 100644 index 89e0e0f9..00000000 --- a/new-lamassu-admin/src/components/wizard/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import Wizard from './Wizard' - -export { Wizard } diff --git a/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js b/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js index 7f87c62a..51f5c5c7 100644 --- a/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js +++ b/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js @@ -44,6 +44,7 @@ const TransactionsList = ({ data }) => { { header: 'Cash', width: 146, + textAlign: 'right', view: it => ( <> {`${Number.parseFloat(it.fiat)} `} @@ -54,6 +55,7 @@ const TransactionsList = ({ data }) => { { header: 'Crypto', width: 142, + textAlign: 'right', view: it => ( <> {`${toUnit(new BigNumber(it.cryptoAtoms), it.cryptoCode).toFormat( diff --git a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js b/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js index e90073b9..0d1a0fc1 100644 --- a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js +++ b/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js @@ -78,7 +78,6 @@ const Cashboxes = () => { name: 'name', header: 'Machine', width: 254, - textAlign: 'left', view: name => <>{name}, input: ({ field: { value: name } }) => <>{name} }, @@ -86,7 +85,7 @@ const Cashboxes = () => { name: 'cassette1', header: 'Cash-out 1', width: 265, - textAlign: 'left', + textAlign: 'right', input: NumberInput, inputProps: { decimalPlaces: 0 @@ -96,7 +95,7 @@ const Cashboxes = () => { name: 'cassette2', header: 'Cash-out 2', width: 265, - textAlign: 'left', + textAlign: 'right', input: NumberInput, inputProps: { decimalPlaces: 0 diff --git a/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js b/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js index 3c864efc..ea637cb0 100644 --- a/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js +++ b/new-lamassu-admin/src/pages/OperatorInfo/ContactInfo.js @@ -166,6 +166,7 @@ const ContactInfo = () => { name: 'phone', label: 'Phone number', value: + info.phone && parsePhoneNumberFromString( info.phone, locale.country diff --git a/new-lamassu-admin/src/pages/Services/schemas/index.js b/new-lamassu-admin/src/pages/Services/schemas/index.js index e3dd4cd4..ac51c92f 100644 --- a/new-lamassu-admin/src/pages/Services/schemas/index.js +++ b/new-lamassu-admin/src/pages/Services/schemas/index.js @@ -5,7 +5,6 @@ import infura from './infura' import itbit from './itbit' import kraken from './kraken' import mailgun from './mailgun' -import strike from './strike' import twilio from './twilio' export default { @@ -16,6 +15,5 @@ export default { [itbit.code]: itbit, [kraken.code]: kraken, [mailgun.code]: mailgun, - [strike.code]: strike, [twilio.code]: twilio } diff --git a/new-lamassu-admin/src/pages/Services/schemas/strike.js b/new-lamassu-admin/src/pages/Services/schemas/strike.js deleted file mode 100644 index 44cb94be..00000000 --- a/new-lamassu-admin/src/pages/Services/schemas/strike.js +++ /dev/null @@ -1,23 +0,0 @@ -import * as Yup from 'yup' - -import TextInputFormik from 'src/components/inputs/formik/TextInput' - -export default { - code: 'strike', - name: 'Strike', - title: 'Strike (Lightning Payments)', - elements: [ - { - code: 'token', - display: 'API Token', - component: TextInputFormik, - face: true, - long: true - } - ], - validationSchema: Yup.object().shape({ - token: Yup.string() - .max(100, 'Too long') - .required('Required') - }) -} diff --git a/new-lamassu-admin/todo.md b/new-lamassu-admin/todo.md index f295327f..fbf11b51 100644 --- a/new-lamassu-admin/todo.md +++ b/new-lamassu-admin/todo.md @@ -1,81 +1,48 @@ Overall: -- caching the page -- validation is bad rn, negatives being allowed -- right aligned numbers on all tables -- locale based mil separators 1.000 1,000 - -Cashboxes: -- right aligned number + - caching the page + - transitions + - error handling + - validation is bad rn, negatives being allowed + - locale based mil separators 1.000 1,000 + - Table should be loaded on slow internet (we want to load the table with no data) + - font sizes could be better + - tooltip like components should close on esc + - saving should be a one time thing. disable buttons so user doesnt spam it + - disable edit on non-everrides => overrides + - splash screens and home + - maybe a indication that there's more to search on dropdown + - required signifier on form fields - (required) or * + - stop line breaking on multi select + - input width should be enough to hold values without cutting text Locale: -- Only allow one override per machine + - Only allow one override per machine Notifications: -- one of the crypto balance alerts has to be optional because of migration - -UI: -- tooltip like components should close on esc -- saving should be a one time thing. disable buttons so user doesnt spam it -- transitions -- error handling -- select components -- talk with nunu + neal: Hover css for edit buttons + first first cancel later -- disable edit on non-everrides => overrides -- splash screens and home -- maybe a indication that there's more to search on dropdown -- required signifier on form fields - (required) or * -- USD should show as a suffix (validate all screens) -- stop line breaking on multi select -- input width should be enough to hold values without cutting text -- font sizes could be better -- min height in virtualized table (rows get hidden if not enough height in browser) + - one of the crypto balance alerts has to be optional because of migration Machine status: -- font-size of the 'write to confirm' - -Migrate: -- Need to write config migration. -- Rewrite config validate -- remove apply defaults - -Cash out: -- ask nuno about zero conf limit + - font-size of the 'write to confirm' Server: -- Takes too long to load. Investigate - -Review slow internet loading: -- Table should be loaded (we want to load the table with no data) - -3rd party services: -- remove strike -- ask neal anyone uses itbit - -Wallet: -- ask neal and nuno how to handle unconfigured third party services on the table edit + - Takes too long to load. Investigate Operator Info: -- That should be paginated with routes! + - That should be paginated with routes! CoinATMRadar: -- relay facephoto info -- we should show the highest amount that requires a requirement + - relay facephoto info + - we should show the highest amount that per requirement Customers: -- add status -- cash-in cash-out are reversed - -Sms/email: -- There's no place to pick a third party provider anymore. (sms.js, email.js) neal + nuno + - add status Machine name: -- update the db with whatever name is on the old config -- where to change name of the mahcines NUNO + NEAL + - update the db with whatever name is on the old config (check 1509439657189-add_machine_name_to_devices) Compliance: -- Reject Address Reuse missing (MAKE BLACKLIST SCREEN AND PUT IT THERE) -- Currently admin only handles { type: 'amount', direction: 'both' } -- Sanctions should have more care in customers.js, currently just looking if is active as if old config + - Currently admin only handles { type: 'amount', direction: 'both' } + - Sanctions should have more care in customers.js, currently just looking if is active as if old config Ideas - Transactions could have a link to the customer