fix: general screen fixes

This commit is contained in:
Taranto 2020-08-08 08:31:23 +01:00 committed by Josh Harvey
parent ea53d782ad
commit b07c0e180a
10 changed files with 32 additions and 226 deletions

View file

@ -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}
/>

View file

@ -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 (
<>
<div>{header}</div>
<div className={classes.body}>
<div className={classes.columnWrapper}>
{/* TODO: wizard steps icons are a little strange... */}
<div className={classes.wizardStepsWrapper}>
{children.map((e, i) => {
const elementToRender = []
if (i < currentStepIndex)
elementToRender.push(
<CompleteIcon
key={elementToRender.length}
className={classes.wizardStepIcon}
/>
)
else if (i === currentStepIndex)
elementToRender.push(
<CurrentIcon
key={elementToRender.length}
className={classes.wizardStepIcon}
/>
)
else
elementToRender.push(
<EmptyIcon
key={elementToRender.length}
className={classes.wizardStepIcon}
/>
)
if (i < currentStepIndex)
elementToRender.push(
<div
className={classes.reachedStepLine}
key={elementToRender.length}
/>
)
else if (i < finalStepIndex)
elementToRender.push(
<div
className={classes.unreachedStepLine}
key={elementToRender.length}
/>
)
return elementToRender
})}
</div>
{currentStep}
<div className={classes.bottomRightAligned}>
<Button onClick={() => handleMoveToNextStep(currentStepIndex + 1)}>
{isFinalStep ? finalStepText : nextStepText}
</Button>
</div>
</div>
</div>
</>
)
}
export default Wizard

View file

@ -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 }

View file

@ -1,3 +0,0 @@
import Wizard from './Wizard'
export { Wizard }

View file

@ -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(

View file

@ -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

View file

@ -166,6 +166,7 @@ const ContactInfo = () => {
name: 'phone',
label: 'Phone number',
value:
info.phone &&
parsePhoneNumberFromString(
info.phone,
locale.country

View file

@ -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
}

View file

@ -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')
})
}

View file

@ -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