partial: first codemod
This commit is contained in:
parent
58f53d92a8
commit
86e3401cc8
30 changed files with 335 additions and 323 deletions
|
|
@ -6,8 +6,9 @@ import {
|
||||||
StylesProvider,
|
StylesProvider,
|
||||||
jssPreset,
|
jssPreset,
|
||||||
MuiThemeProvider,
|
MuiThemeProvider,
|
||||||
makeStyles
|
StyledEngineProvider,
|
||||||
} from '@mui/material/styles'
|
makeStyles,
|
||||||
|
} from '@mui/material/styles';
|
||||||
import { create } from 'jss'
|
import { create } from 'jss'
|
||||||
import extendJss from 'jss-plugin-extend'
|
import extendJss from 'jss-plugin-extend'
|
||||||
import React, { useContext, useState } from 'react'
|
import React, { useContext, useState } from 'react'
|
||||||
|
|
@ -153,15 +154,17 @@ const App = () => {
|
||||||
<Router>
|
<Router>
|
||||||
<ApolloProvider>
|
<ApolloProvider>
|
||||||
<StylesProvider jss={jss}>
|
<StylesProvider jss={jss}>
|
||||||
<MuiThemeProvider theme={theme}>
|
<StyledEngineProvider injectFirst>
|
||||||
<CssBaseline />
|
<MuiThemeProvider theme={theme}>
|
||||||
<Main />
|
<CssBaseline />
|
||||||
</MuiThemeProvider>
|
<Main />
|
||||||
|
</MuiThemeProvider>
|
||||||
|
</StyledEngineProvider>
|
||||||
</StylesProvider>
|
</StylesProvider>
|
||||||
</ApolloProvider>
|
</ApolloProvider>
|
||||||
</Router>
|
</Router>
|
||||||
</AppContext.Provider>
|
</AppContext.Provider>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App
|
export default App
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,8 @@ const BooleanPropertiesTable = memo(
|
||||||
) : (
|
) : (
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.transparentButton}
|
className={classes.transparentButton}
|
||||||
onClick={() => setEditing(true)}>
|
onClick={() => setEditing(true)}
|
||||||
|
size="large">
|
||||||
{disabled ? <EditIconDisabled /> : <EditIcon />}
|
{disabled ? <EditIconDisabled /> : <EditIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
@ -121,11 +122,11 @@ const BooleanPropertiesTable = memo(
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
</Form>
|
</Form>
|
||||||
)
|
);
|
||||||
}}
|
}}
|
||||||
</Formik>
|
</Formik>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,8 @@ const ActionCol = ({ disabled, editing }) => {
|
||||||
<IconButton
|
<IconButton
|
||||||
disabled={disableEdit}
|
disabled={disableEdit}
|
||||||
className={classes.editButton}
|
className={classes.editButton}
|
||||||
onClick={() => onEdit && onEdit(values.id)}>
|
onClick={() => onEdit && onEdit(values.id)}
|
||||||
|
size="large">
|
||||||
{disableEdit ? <DisabledEditIcon /> : <EditIcon />}
|
{disableEdit ? <DisabledEditIcon /> : <EditIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Td>
|
</Td>
|
||||||
|
|
@ -88,7 +89,8 @@ const ActionCol = ({ disabled, editing }) => {
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDeleteDialog(true)
|
setDeleteDialog(true)
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
{disabled ? <DisabledDeleteIcon /> : <DeleteIcon />}
|
{disabled ? <DisabledDeleteIcon /> : <DeleteIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<DeleteDialog
|
<DeleteDialog
|
||||||
|
|
@ -114,7 +116,7 @@ const ActionCol = ({ disabled, editing }) => {
|
||||||
</Td>
|
</Td>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ECol = ({ editing, focus, config, extraPaddingRight, extraPadding }) => {
|
const ECol = ({ editing, focus, config, extraPaddingRight, extraPadding }) => {
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ const Autocomplete = ({
|
||||||
<Box
|
<Box
|
||||||
width={18}
|
width={18}
|
||||||
height={18}
|
height={18}
|
||||||
borderRadius={6}
|
borderRadius="6px"
|
||||||
bgcolor={warningColors[props.warning]}
|
bgcolor={warningColors[props.warning]}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
@ -134,7 +134,7 @@ const Autocomplete = ({
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Autocomplete
|
export default Autocomplete
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ const SingleRowTable = ({
|
||||||
<THead>
|
<THead>
|
||||||
<Th className={classes.head}>
|
<Th className={classes.head}>
|
||||||
{title}
|
{title}
|
||||||
<IconButton onClick={onEdit} className={classes.button}>
|
<IconButton onClick={onEdit} className={classes.button} size="large">
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Th>
|
</Th>
|
||||||
|
|
@ -62,7 +62,7 @@ const SingleRowTable = ({
|
||||||
</TBody>
|
</TBody>
|
||||||
</Table>
|
</Table>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SingleRowTable
|
export default SingleRowTable
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ const AddMachine = memo(({ close, onPaired }) => {
|
||||||
<div className={classes.wrapper}>
|
<div className={classes.wrapper}>
|
||||||
<div className={classes.headerDiv}>
|
<div className={classes.headerDiv}>
|
||||||
<Title>Add Machine</Title>
|
<Title>Add Machine</Title>
|
||||||
<IconButton disableRipple={true} onClick={close}>
|
<IconButton disableRipple={true} onClick={close} size="large">
|
||||||
<SvgIcon color="error">
|
<SvgIcon color="error">
|
||||||
<CloseIcon />
|
<CloseIcon />
|
||||||
</SvgIcon>
|
</SvgIcon>
|
||||||
|
|
@ -279,7 +279,7 @@ const AddMachine = memo(({ close, onPaired }) => {
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
})
|
})
|
||||||
|
|
||||||
export default AddMachine
|
export default AddMachine
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ const Login = () => {
|
||||||
spacing={0}
|
spacing={0}
|
||||||
direction="column"
|
direction="column"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
justify="center"
|
justifyContent="center"
|
||||||
className={classes.welcomeBackground}>
|
className={classes.welcomeBackground}>
|
||||||
<Grid>
|
<Grid>
|
||||||
<LoginCard />
|
<LoginCard />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Login
|
export default Login
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ const Register = () => {
|
||||||
spacing={0}
|
spacing={0}
|
||||||
direction="column"
|
direction="column"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
justify="center"
|
justifyContent="center"
|
||||||
className={classes.welcomeBackground}>
|
className={classes.welcomeBackground}>
|
||||||
<Grid>
|
<Grid>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -214,7 +214,7 @@ const Register = () => {
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Register
|
export default Register
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ const Reset2FA = () => {
|
||||||
spacing={0}
|
spacing={0}
|
||||||
direction="column"
|
direction="column"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
justify="center"
|
justifyContent="center"
|
||||||
className={classes.welcomeBackground}>
|
className={classes.welcomeBackground}>
|
||||||
<Grid>
|
<Grid>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -205,7 +205,7 @@ const Reset2FA = () => {
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Reset2FA
|
export default Reset2FA
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ const ResetPassword = () => {
|
||||||
spacing={0}
|
spacing={0}
|
||||||
direction="column"
|
direction="column"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
justify="center"
|
justifyContent="center"
|
||||||
className={classes.welcomeBackground}>
|
className={classes.welcomeBackground}>
|
||||||
<Grid>
|
<Grid>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -164,7 +164,7 @@ const ResetPassword = () => {
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ResetPassword
|
export default ResetPassword
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ const BlacklistAdvanced = ({
|
||||||
view: it => (
|
view: it => (
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.deleteButton}
|
className={classes.deleteButton}
|
||||||
onClick={() => setSelectedMessage(it)}>
|
onClick={() => setSelectedMessage(it)}
|
||||||
|
size="large">
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
)
|
||||||
|
|
@ -81,7 +82,8 @@ const BlacklistAdvanced = ({
|
||||||
disabled={
|
disabled={
|
||||||
!R.isNil(R.path(['allowToggle'], it)) &&
|
!R.isNil(R.path(['allowToggle'], it)) &&
|
||||||
!R.path(['allowToggle'], it)
|
!R.path(['allowToggle'], it)
|
||||||
}>
|
}
|
||||||
|
size="large">
|
||||||
{R.path(['allowToggle'], it) ? (
|
{R.path(['allowToggle'], it) ? (
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ const BlacklistTable = ({
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDeleteDialog(true)
|
setDeleteDialog(true)
|
||||||
setToBeDeleted(it)
|
setToBeDeleted(it)
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,7 @@ const ManualDataEntry = ({ selectedValues, customInfoRequirementOptions }) => {
|
||||||
fullWidth
|
fullWidth
|
||||||
label={`Available requests`}
|
label={`Available requests`}
|
||||||
className={classes.picker}
|
className={classes.picker}
|
||||||
getOptionSelected={R.eqProps('code')}
|
isOptionEqualToValue={R.eqProps('code')}
|
||||||
labelProp={'display'}
|
labelProp={'display'}
|
||||||
options={customInfoRequirementOptions}
|
options={customInfoRequirementOptions}
|
||||||
onChange={(evt, it) => {}}
|
onChange={(evt, it) => {}}
|
||||||
|
|
@ -343,7 +343,7 @@ const ManualDataEntry = ({ selectedValues, customInfoRequirementOptions }) => {
|
||||||
}></Upload>
|
}></Upload>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const customElements = {
|
const customElements = {
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,8 @@ const IndividualDiscounts = () => {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDeleteDialog(true)
|
setDeleteDialog(true)
|
||||||
setToBeDeleted({ variables: { discountId: t.id } })
|
setToBeDeleted({ variables: { discountId: t.id } })
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,8 @@ const PromoCodes = () => {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDeleteDialog(true)
|
setDeleteDialog(true)
|
||||||
setToBeDeleted({ variables: { codeId: t.id } })
|
setToBeDeleted({ variables: { codeId: t.id } })
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -200,158 +200,155 @@ const CashCassettes = () => {
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (!dataLoading && (<>
|
||||||
!dataLoading && (
|
<TitleSection
|
||||||
<>
|
title="Cash boxes & cassettes"
|
||||||
<TitleSection
|
buttons={[
|
||||||
title="Cash boxes & cassettes"
|
{
|
||||||
buttons={[
|
text: 'Cash box history',
|
||||||
{
|
icon: HistoryIcon,
|
||||||
text: 'Cash box history',
|
inverseIcon: ReverseHistoryIcon,
|
||||||
icon: HistoryIcon,
|
toggle: setShowHistory
|
||||||
inverseIcon: ReverseHistoryIcon,
|
},
|
||||||
toggle: setShowHistory
|
{
|
||||||
},
|
component: showHistory ? (
|
||||||
{
|
<LogsDowloaderPopover
|
||||||
component: showHistory ? (
|
className={classes.downloadLogsButton}
|
||||||
<LogsDowloaderPopover
|
title="Download logs"
|
||||||
className={classes.downloadLogsButton}
|
name="cashboxHistory"
|
||||||
title="Download logs"
|
query={GET_BATCHES_CSV}
|
||||||
name="cashboxHistory"
|
getLogs={logs => R.path(['cashboxBatchesCsv'])(logs)}
|
||||||
query={GET_BATCHES_CSV}
|
timezone={timezone}
|
||||||
getLogs={logs => R.path(['cashboxBatchesCsv'])(logs)}
|
args={{ timezone }}
|
||||||
timezone={timezone}
|
/>
|
||||||
args={{ timezone }}
|
) : (
|
||||||
/>
|
<></>
|
||||||
) : (
|
)
|
||||||
<></>
|
}
|
||||||
)
|
]}
|
||||||
}
|
iconClassName={classes.listViewButton}
|
||||||
]}
|
className={classes.tableWidth}
|
||||||
iconClassName={classes.listViewButton}
|
appendix={
|
||||||
className={classes.tableWidth}
|
<HelpTooltip width={220}>
|
||||||
appendix={
|
<P>
|
||||||
<HelpTooltip width={220}>
|
For details on configuring cash boxes and cassettes, please read
|
||||||
<P>
|
the relevant knowledgebase article:
|
||||||
For details on configuring cash boxes and cassettes, please read
|
</P>
|
||||||
the relevant knowledgebase article:
|
<SupportLinkButton
|
||||||
|
link="https://support.lamassu.is/hc/en-us/articles/4420839641229-Cash-Boxes-Cassettess"
|
||||||
|
label="Cash Boxes & Cassettes"
|
||||||
|
bottomSpace="1"
|
||||||
|
/>
|
||||||
|
</HelpTooltip>
|
||||||
|
}>
|
||||||
|
{!showHistory && (
|
||||||
|
<Box alignItems="center" justifyContent="flex-end">
|
||||||
|
<Label1 className={classes.cashboxReset}>Cash box resets</Label1>
|
||||||
|
<Box
|
||||||
|
display="flex"
|
||||||
|
alignItems="center"
|
||||||
|
justifyContent="end"
|
||||||
|
mr="-4px">
|
||||||
|
{cashboxReset && (
|
||||||
|
<P className={classes.selection}>
|
||||||
|
{onlyFirstToUpper(cashboxReset)}
|
||||||
</P>
|
</P>
|
||||||
<SupportLinkButton
|
|
||||||
link="https://support.lamassu.is/hc/en-us/articles/4420839641229-Cash-Boxes-Cassettess"
|
|
||||||
label="Cash Boxes & Cassettes"
|
|
||||||
bottomSpace="1"
|
|
||||||
/>
|
|
||||||
</HelpTooltip>
|
|
||||||
}>
|
|
||||||
{!showHistory && (
|
|
||||||
<Box alignItems="center" justifyContent="flex-end">
|
|
||||||
<Label1 className={classes.cashboxReset}>Cash box resets</Label1>
|
|
||||||
<Box
|
|
||||||
display="flex"
|
|
||||||
alignItems="center"
|
|
||||||
justifyContent="end"
|
|
||||||
mr="-4px">
|
|
||||||
{cashboxReset && (
|
|
||||||
<P className={classes.selection}>
|
|
||||||
{onlyFirstToUpper(cashboxReset)}
|
|
||||||
</P>
|
|
||||||
)}
|
|
||||||
<IconButton
|
|
||||||
onClick={() => setEditingSchema(true)}
|
|
||||||
className={classes.button}>
|
|
||||||
<EditIcon />
|
|
||||||
</IconButton>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
</TitleSection>
|
|
||||||
{!showHistory && (
|
|
||||||
<>
|
|
||||||
<DataTable
|
|
||||||
loading={dataLoading}
|
|
||||||
elements={elements}
|
|
||||||
data={machines}
|
|
||||||
Details={InnerCashUnitDetails}
|
|
||||||
emptyText="No machines so far"
|
|
||||||
expandable
|
|
||||||
tableClassName={classes.dataTable}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{data && R.isEmpty(machines) && (
|
|
||||||
<EmptyTable message="No machines so far" />
|
|
||||||
)}
|
)}
|
||||||
</>
|
<IconButton
|
||||||
)}
|
onClick={() => setEditingSchema(true)}
|
||||||
{showHistory && (
|
className={classes.button}
|
||||||
<CashboxHistory
|
size="large">
|
||||||
machines={R.concat(machines, unpairedMachines)}
|
<EditIcon />
|
||||||
currency={fiatCurrency}
|
</IconButton>
|
||||||
timezone={timezone}
|
</Box>
|
||||||
/>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<CashCassettesFooter
|
</TitleSection>
|
||||||
currencyCode={fiatCurrency}
|
{!showHistory && (
|
||||||
machines={machines}
|
<>
|
||||||
config={config}
|
<DataTable
|
||||||
bills={R.path(['bills'])(data)}
|
loading={dataLoading}
|
||||||
deviceIds={deviceIds}
|
elements={elements}
|
||||||
|
data={machines}
|
||||||
|
Details={InnerCashUnitDetails}
|
||||||
|
emptyText="No machines so far"
|
||||||
|
expandable
|
||||||
|
tableClassName={classes.dataTable}
|
||||||
/>
|
/>
|
||||||
{wizard && (
|
|
||||||
<Wizard
|
{data && R.isEmpty(machines) && (
|
||||||
machine={R.find(R.propEq('id', machineId), machines)}
|
<EmptyTable message="No machines so far" />
|
||||||
cashoutSettings={getCashoutSettings(machineId)}
|
|
||||||
onClose={() => {
|
|
||||||
setWizard(false)
|
|
||||||
}}
|
|
||||||
error={error?.message}
|
|
||||||
save={onSave}
|
|
||||||
locale={locale}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{editingSchema && (
|
|
||||||
<Modal
|
|
||||||
title={'Cash box resets'}
|
|
||||||
width={478}
|
|
||||||
handleClose={() => setEditingSchema(null)}
|
|
||||||
open={true}>
|
|
||||||
<P className={classes.descriptions}>
|
|
||||||
We can automatically assume you emptied a bill validator's cash
|
|
||||||
box when the machine detects that it has been removed.
|
|
||||||
</P>
|
|
||||||
<RadioGroup
|
|
||||||
name="set-automatic-reset"
|
|
||||||
value={selectedRadio ?? cashboxReset}
|
|
||||||
options={[radioButtonOptions[0]]}
|
|
||||||
onChange={handleRadioButtons}
|
|
||||||
className={classes.radioButtons}
|
|
||||||
/>
|
|
||||||
<P className={classes.descriptions}>
|
|
||||||
Assume the cash box is emptied whenever it's removed, creating a
|
|
||||||
new batch on the history screen and setting its current balance to
|
|
||||||
zero.
|
|
||||||
</P>
|
|
||||||
<RadioGroup
|
|
||||||
name="set-manual-reset"
|
|
||||||
value={selectedRadio ?? cashboxReset}
|
|
||||||
options={[radioButtonOptions[1]]}
|
|
||||||
onChange={handleRadioButtons}
|
|
||||||
className={classes.radioButtons}
|
|
||||||
/>
|
|
||||||
<P className={classes.descriptions}>
|
|
||||||
Cash boxes won't be assumed emptied when removed, nor their counts
|
|
||||||
modified. Instead, to update the count and create a new batch,
|
|
||||||
you'll click the 'Edit' button on this panel.
|
|
||||||
</P>
|
|
||||||
<DialogActions className={classes.actions}>
|
|
||||||
<Button onClick={() => saveCashboxOption(selectedRadio)}>
|
|
||||||
Confirm
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</Modal>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)}
|
||||||
)
|
{showHistory && (
|
||||||
|
<CashboxHistory
|
||||||
|
machines={R.concat(machines, unpairedMachines)}
|
||||||
|
currency={fiatCurrency}
|
||||||
|
timezone={timezone}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<CashCassettesFooter
|
||||||
|
currencyCode={fiatCurrency}
|
||||||
|
machines={machines}
|
||||||
|
config={config}
|
||||||
|
bills={R.path(['bills'])(data)}
|
||||||
|
deviceIds={deviceIds}
|
||||||
|
/>
|
||||||
|
{wizard && (
|
||||||
|
<Wizard
|
||||||
|
machine={R.find(R.propEq('id', machineId), machines)}
|
||||||
|
cashoutSettings={getCashoutSettings(machineId)}
|
||||||
|
onClose={() => {
|
||||||
|
setWizard(false)
|
||||||
|
}}
|
||||||
|
error={error?.message}
|
||||||
|
save={onSave}
|
||||||
|
locale={locale}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{editingSchema && (
|
||||||
|
<Modal
|
||||||
|
title={'Cash box resets'}
|
||||||
|
width={478}
|
||||||
|
handleClose={() => setEditingSchema(null)}
|
||||||
|
open={true}>
|
||||||
|
<P className={classes.descriptions}>
|
||||||
|
We can automatically assume you emptied a bill validator's cash
|
||||||
|
box when the machine detects that it has been removed.
|
||||||
|
</P>
|
||||||
|
<RadioGroup
|
||||||
|
name="set-automatic-reset"
|
||||||
|
value={selectedRadio ?? cashboxReset}
|
||||||
|
options={[radioButtonOptions[0]]}
|
||||||
|
onChange={handleRadioButtons}
|
||||||
|
className={classes.radioButtons}
|
||||||
|
/>
|
||||||
|
<P className={classes.descriptions}>
|
||||||
|
Assume the cash box is emptied whenever it's removed, creating a
|
||||||
|
new batch on the history screen and setting its current balance to
|
||||||
|
zero.
|
||||||
|
</P>
|
||||||
|
<RadioGroup
|
||||||
|
name="set-manual-reset"
|
||||||
|
value={selectedRadio ?? cashboxReset}
|
||||||
|
options={[radioButtonOptions[1]]}
|
||||||
|
onChange={handleRadioButtons}
|
||||||
|
className={classes.radioButtons}
|
||||||
|
/>
|
||||||
|
<P className={classes.descriptions}>
|
||||||
|
Cash boxes won't be assumed emptied when removed, nor their counts
|
||||||
|
modified. Instead, to update the count and create a new batch,
|
||||||
|
you'll click the 'Edit' button on this panel.
|
||||||
|
</P>
|
||||||
|
<DialogActions className={classes.actions}>
|
||||||
|
<Button onClick={() => saveCashboxOption(selectedRadio)}>
|
||||||
|
Confirm
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</Modal>
|
||||||
|
)}
|
||||||
|
</>));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CashCassettes
|
export default CashCassettes
|
||||||
|
|
|
||||||
|
|
@ -132,10 +132,11 @@ const getElements = (
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
!R.isNil(setMachineId) && setMachineId(m.id ?? m.deviceId)
|
!R.isNil(setMachineId) && setMachineId(m.id ?? m.deviceId)
|
||||||
setWizard(true)
|
setWizard(true)
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ const Header = ({ title, editing, disabled, setEditing }) => {
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => setEditing(true)}
|
onClick={() => setEditing(true)}
|
||||||
className={classes.button}
|
className={classes.button}
|
||||||
disabled={disabled}>
|
disabled={disabled}
|
||||||
|
size="large">
|
||||||
{disabled ? <DisabledEditIcon /> : <EditIcon />}
|
{disabled ? <DisabledEditIcon /> : <EditIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
@ -35,7 +36,7 @@ const Header = ({ title, editing, disabled, setEditing }) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Header
|
export default Header
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,8 @@ const ContactInfo = ({ wizard }) => {
|
||||||
{!editing && (
|
{!editing && (
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.transparentButton}
|
className={classes.transparentButton}
|
||||||
onClick={() => setEditing(true)}>
|
onClick={() => setEditing(true)}
|
||||||
|
size="large">
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
@ -311,7 +312,7 @@ const ContactInfo = ({ wizard }) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ContactInfo
|
export default ContactInfo
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,8 @@ const SMSNotices = () => {
|
||||||
setPreviewOpen(false)
|
setPreviewOpen(false)
|
||||||
setSelectedSMS(it)
|
setSelectedSMS(it)
|
||||||
setShowModal(true)
|
setShowModal(true)
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
)
|
||||||
|
|
@ -221,7 +222,8 @@ const SMSNotices = () => {
|
||||||
R.equals(selectedSMS, it)
|
R.equals(selectedSMS, it)
|
||||||
? setPreviewOpen(!previewOpen)
|
? setPreviewOpen(!previewOpen)
|
||||||
: setPreviewOpen(true)
|
: setPreviewOpen(true)
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
{R.equals(selectedSMS, it) && previewOpen ? (
|
{R.equals(selectedSMS, it) && previewOpen ? (
|
||||||
<ExpandIconOpen />
|
<ExpandIconOpen />
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,8 @@ const TermsConditions = () => {
|
||||||
{!editing && (
|
{!editing && (
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.transparentButton}
|
className={classes.transparentButton}
|
||||||
onClick={() => setEditing(true)}>
|
onClick={() => setEditing(true)}
|
||||||
|
size="large">
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
|
@ -287,7 +288,7 @@ const TermsConditions = () => {
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TermsConditions
|
export default TermsConditions
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,6 @@ export default {
|
||||||
environment: Yup.string('The environment must be a string')
|
environment: Yup.string('The environment must be a string')
|
||||||
.matches(/(prod|test)/)
|
.matches(/(prod|test)/)
|
||||||
.required('The environment is required')
|
.required('The environment is required')
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,6 @@ export default {
|
||||||
endpoint: Yup.string('The endpoint must be a string')
|
endpoint: Yup.string('The endpoint must be a string')
|
||||||
.max(100, 'The endpoint is too long')
|
.max(100, 'The endpoint is too long')
|
||||||
.required('The endpoint is required')
|
.required('The endpoint is required')
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,8 @@ const SessionManagement = () => {
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
deleteSession({ variables: { sid: s.sid } })
|
deleteSession({ variables: { sid: s.sid } })
|
||||||
}}>
|
}}
|
||||||
|
size="large">
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ const CopyToClipboard = ({
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CopyToClipboard
|
export default CopyToClipboard
|
||||||
|
|
|
||||||
|
|
@ -178,121 +178,118 @@ const CustomInfoRequests = ({
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (!configLoading && (<>
|
||||||
!configLoading && (
|
{customRequests.length > 0 && (
|
||||||
<>
|
<DataTable
|
||||||
{customRequests.length > 0 && (
|
emptyText="No custom info requests so far"
|
||||||
<DataTable
|
elements={[
|
||||||
emptyText="No custom info requests so far"
|
{
|
||||||
elements={[
|
header: 'Requirement name',
|
||||||
{
|
width: 300,
|
||||||
header: 'Requirement name',
|
textAlign: 'left',
|
||||||
width: 300,
|
size: 'sm',
|
||||||
textAlign: 'left',
|
view: it => it.customRequest.name
|
||||||
size: 'sm',
|
},
|
||||||
view: it => it.customRequest.name
|
{
|
||||||
},
|
header: 'Data entry type',
|
||||||
{
|
width: 300,
|
||||||
header: 'Data entry type',
|
textAlign: 'left',
|
||||||
width: 300,
|
size: 'sm',
|
||||||
textAlign: 'left',
|
view: it => inputTypeDisplay[it.customRequest.input.type]
|
||||||
size: 'sm',
|
},
|
||||||
view: it => inputTypeDisplay[it.customRequest.input.type]
|
{
|
||||||
},
|
header: 'Constraints',
|
||||||
{
|
width: 300,
|
||||||
header: 'Constraints',
|
textAlign: 'left',
|
||||||
width: 300,
|
size: 'sm',
|
||||||
textAlign: 'left',
|
view: it =>
|
||||||
size: 'sm',
|
constraintTypeDisplay[it.customRequest.input.constraintType]
|
||||||
view: it =>
|
},
|
||||||
constraintTypeDisplay[it.customRequest.input.constraintType]
|
{
|
||||||
},
|
header: 'Edit',
|
||||||
{
|
width: 100,
|
||||||
header: 'Edit',
|
textAlign: 'center',
|
||||||
width: 100,
|
size: 'sm',
|
||||||
textAlign: 'center',
|
view: it => {
|
||||||
size: 'sm',
|
return (
|
||||||
view: it => {
|
<IconButton
|
||||||
return (
|
onClick={() => {
|
||||||
<IconButton
|
setToBeEdited(it)
|
||||||
onClick={() => {
|
return toggleWizard()
|
||||||
setToBeEdited(it)
|
}}
|
||||||
return toggleWizard()
|
size="large">
|
||||||
}}>
|
<EditIcon />
|
||||||
<EditIcon />
|
</IconButton>
|
||||||
</IconButton>
|
);
|
||||||
)
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
header: 'Delete',
|
||||||
header: 'Delete',
|
width: 100,
|
||||||
width: 100,
|
textAlign: 'center',
|
||||||
textAlign: 'center',
|
size: 'sm',
|
||||||
size: 'sm',
|
view: it => {
|
||||||
view: it => {
|
return (
|
||||||
return (
|
<IconButton
|
||||||
<IconButton
|
onClick={() => {
|
||||||
onClick={() => {
|
setToBeDeleted(it.id)
|
||||||
setToBeDeleted(it.id)
|
return setDeleteDialog(true)
|
||||||
return setDeleteDialog(true)
|
}}
|
||||||
}}>
|
size="large">
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
data={customRequests}
|
data={customRequests}
|
||||||
Details={DetailsRow}
|
Details={DetailsRow}
|
||||||
expandable
|
expandable
|
||||||
rowSize="sm"
|
rowSize="sm"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!customRequests.length && (
|
{!customRequests.length && (
|
||||||
<div className={classes.centerItems}>
|
<div className={classes.centerItems}>
|
||||||
<Info1 className={classnames(classes.m0, classes.mb10)}>
|
<Info1 className={classnames(classes.m0, classes.mb10)}>
|
||||||
It seems you haven't added any custom information requests yet.
|
It seems you haven't added any custom information requests yet.
|
||||||
</Info1>
|
</Info1>
|
||||||
<Info3 className={classnames(classes.m0, classes.mb10)}>
|
<Info3 className={classnames(classes.m0, classes.mb10)}>
|
||||||
Please read our{' '}
|
Please read our{' '}
|
||||||
<a href="https://support.lamassu.is/hc/en-us/sections/115000817232-Compliance">
|
<a href="https://support.lamassu.is/hc/en-us/sections/115000817232-Compliance">
|
||||||
<Link>Support Article</Link>
|
<Link>Support Article</Link>
|
||||||
</a>{' '}
|
</a>{' '}
|
||||||
on Compliance before adding new information requests.
|
on Compliance before adding new information requests.
|
||||||
</Info3>
|
</Info3>
|
||||||
<Button onClick={() => toggleWizard()}>
|
<Button onClick={() => toggleWizard()}>
|
||||||
Add custom information request
|
Add custom information request
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{showWizard && (
|
{showWizard && (
|
||||||
<Wizard
|
<Wizard
|
||||||
hasError={hasError}
|
hasError={hasError}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setToBeEdited(null)
|
setToBeEdited(null)
|
||||||
setHasError(false)
|
setHasError(false)
|
||||||
toggleWizard()
|
toggleWizard()
|
||||||
}}
|
}}
|
||||||
toBeEdited={toBeEdited}
|
toBeEdited={toBeEdited}
|
||||||
onSave={(...args) => handleSave(...args)}
|
onSave={(...args) => handleSave(...args)}
|
||||||
existingRequirements={customRequests}
|
existingRequirements={customRequests}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
<DeleteDialog
|
||||||
<DeleteDialog
|
errorMessage={hasError ? 'Failed to delete' : ''}
|
||||||
errorMessage={hasError ? 'Failed to delete' : ''}
|
open={deleteDialog}
|
||||||
open={deleteDialog}
|
onDismissed={() => {
|
||||||
onDismissed={() => {
|
setDeleteDialog(false)
|
||||||
setDeleteDialog(false)
|
setHasError(false)
|
||||||
setHasError(false)
|
}}
|
||||||
}}
|
item={`custom information request`}
|
||||||
item={`custom information request`}
|
extraMessage={detailedDeleteMsg}
|
||||||
extraMessage={detailedDeleteMsg}
|
onConfirmed={() => handleDelete(toBeDeleted)}
|
||||||
onConfirmed={() => handleDelete(toBeDeleted)}
|
/>
|
||||||
/>
|
</>));
|
||||||
</>
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CustomInfoRequests
|
export default CustomInfoRequests
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ const getOverridesSchema = (values, customInfoRequests) => {
|
||||||
.label('Automation')
|
.label('Automation')
|
||||||
.matches(/(Manual|Automatic)/)
|
.matches(/(Manual|Automatic)/)
|
||||||
.required()
|
.required()
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDefaultSettings = () => {
|
const getDefaultSettings = () => {
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ const WizardStep = ({
|
||||||
fullWidth
|
fullWidth
|
||||||
label={`Select ${displayName}`}
|
label={`Select ${displayName}`}
|
||||||
className={classes.picker}
|
className={classes.picker}
|
||||||
getOptionSelected={R.eqProps('code')}
|
isOptionEqualToValue={R.eqProps('code')}
|
||||||
labelProp={'display'}
|
labelProp={'display'}
|
||||||
options={unfilled}
|
options={unfilled}
|
||||||
onChange={(evt, it) => {
|
onChange={(evt, it) => {
|
||||||
|
|
@ -194,7 +194,7 @@ const WizardStep = ({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default WizardStep
|
export default WizardStep
|
||||||
|
|
|
||||||
|
|
@ -52,13 +52,13 @@ function Footer({ currentStep, steps, subtitle, text, exImage, open, start }) {
|
||||||
variant={'persistent'}
|
variant={'persistent'}
|
||||||
classes={{ paperAnchorDockedBottom: classes.drawer }}>
|
classes={{ paperAnchorDockedBottom: classes.drawer }}>
|
||||||
<div className={classnames(wrapperClassNames)}>
|
<div className={classnames(wrapperClassNames)}>
|
||||||
<Grid container direction="row" justify="center" alignItems="baseline">
|
<Grid container direction="row" justifyContent="center" alignItems="baseline">
|
||||||
<Grid
|
<Grid
|
||||||
item
|
item
|
||||||
xs={5}
|
xs={5}
|
||||||
container
|
container
|
||||||
direction={open ? 'column' : 'row'}
|
direction={open ? 'column' : 'row'}
|
||||||
justify="flex-start"
|
justifyContent="flex-start"
|
||||||
alignItems="baseline">
|
alignItems="baseline">
|
||||||
<H2 className={classes.title}>Setup Lamassu Admin</H2>
|
<H2 className={classes.title}>Setup Lamassu Admin</H2>
|
||||||
<Info2 className={classes.subtitle}>{subtitle}</Info2>
|
<Info2 className={classes.subtitle}>{subtitle}</Info2>
|
||||||
|
|
@ -69,7 +69,7 @@ function Footer({ currentStep, steps, subtitle, text, exImage, open, start }) {
|
||||||
xs={4}
|
xs={4}
|
||||||
container
|
container
|
||||||
direction="column"
|
direction="column"
|
||||||
justify="flex-start"
|
justifyContent="flex-start"
|
||||||
alignItems="flex-end"
|
alignItems="flex-end"
|
||||||
spacing={5}>
|
spacing={5}>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
|
|
@ -83,14 +83,14 @@ function Footer({ currentStep, steps, subtitle, text, exImage, open, start }) {
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
direction="row"
|
direction="row"
|
||||||
justify="center"
|
justifyContent="center"
|
||||||
alignItems="baseline">
|
alignItems="baseline">
|
||||||
<Grid
|
<Grid
|
||||||
item
|
item
|
||||||
xs={5}
|
xs={5}
|
||||||
container
|
container
|
||||||
direction="column"
|
direction="column"
|
||||||
justify="flex-start"
|
justifyContent="flex-start"
|
||||||
alignItems="flex-start">
|
alignItems="flex-start">
|
||||||
<Link
|
<Link
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
@ -104,7 +104,7 @@ function Footer({ currentStep, steps, subtitle, text, exImage, open, start }) {
|
||||||
xs={4}
|
xs={4}
|
||||||
container
|
container
|
||||||
direction="column"
|
direction="column"
|
||||||
justify="flex-start"
|
justifyContent="flex-start"
|
||||||
alignItems="flex-end"
|
alignItems="flex-end"
|
||||||
spacing={5}>
|
spacing={5}>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
|
|
@ -129,7 +129,7 @@ function Footer({ currentStep, steps, subtitle, text, exImage, open, start }) {
|
||||||
<img width={1152} src={exImage} alt="" />
|
<img width={1152} src={exImage} alt="" />
|
||||||
</Modal>
|
</Modal>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Footer
|
export default Footer
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { createTheme } from '@mui/material/styles'
|
import { createTheme, adaptV4Theme } from '@mui/material/styles';
|
||||||
|
|
||||||
import typographyStyles from 'src/components/typography/styles'
|
import typographyStyles from 'src/components/typography/styles'
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
|
|
||||||
const { p } = typographyStyles
|
const { p } = typographyStyles
|
||||||
|
|
||||||
export default createTheme({
|
export default createTheme(adaptV4Theme({
|
||||||
typography: {
|
typography: {
|
||||||
fontFamily: inputFontFamily,
|
fontFamily: inputFontFamily,
|
||||||
body1: { ...p }
|
body1: { ...p }
|
||||||
|
|
@ -158,4 +158,4 @@ export default createTheme({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue