diff --git a/new-lamassu-admin/eslint.config.js b/new-lamassu-admin/eslint.config.js
index 55115a18..9cf79edd 100644
--- a/new-lamassu-admin/eslint.config.js
+++ b/new-lamassu-admin/eslint.config.js
@@ -13,13 +13,20 @@ export default [
process: 'readonly'
}
},
+ settings: {
+ react: {
+ version: '16'
+ }
+ }
},
pluginJs.configs.recommended,
pluginReact.configs.flat.recommended,
{
rules: {
'react/prop-types': 'off',
- 'react/display-name': 'off'
+ 'react/display-name': 'off',
+ 'react/no-unescaped-entities': 'off',
+ 'no-unused-vars': 'off',
}
}
]
\ No newline at end of file
diff --git a/new-lamassu-admin/src/components/buttons/SimpleButton.jsx b/new-lamassu-admin/src/components/buttons/SimpleButton.jsx
deleted file mode 100644
index 7e7bce12..00000000
--- a/new-lamassu-admin/src/components/buttons/SimpleButton.jsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import { makeStyles } from '@material-ui/core/styles'
-import classnames from 'classnames'
-import React, { memo } from 'react'
-
-import baseButtonStyles from './BaseButton.styles'
-
-const { baseButton, primary } = baseButtonStyles
-
-const styles = {
- button: {
- extend: baseButton,
- borderRadius: baseButton.height / 2,
- outline: 0,
- padding: '0 20px'
- },
- primary,
- buttonIcon: {
- marginTop: 4,
- marginRight: 4,
- '& svg': {
- width: 20,
- height: 20,
- overflow: 'visible'
- }
- },
- buttonIconActive: {} // required to extend primary
-}
-
-const useStyles = makeStyles(styles)
-
-const SimpleButton = memo(
- ({ className, Icon, InverseIcon, children, color, size, ...props }) => {
- const classes = useStyles()
-
- return (
-
- )
- }
-)
-
-export default SimpleButton
diff --git a/new-lamassu-admin/src/components/editableTable/Row.jsx b/new-lamassu-admin/src/components/editableTable/Row.jsx
index 67aa6a6f..7c474f58 100644
--- a/new-lamassu-admin/src/components/editableTable/Row.jsx
+++ b/new-lamassu-admin/src/components/editableTable/Row.jsx
@@ -165,8 +165,9 @@ const ECol = ({ editing, focus, config, extraPaddingRight, extraPadding }) => {
return (
- {R.map(f => (
+ {fields.map((f, idx) => (
{
)}
{isHidden(values) && }
|
- ))(fields)}
+ ))}
)
}
diff --git a/new-lamassu-admin/src/components/layout/Header.jsx b/new-lamassu-admin/src/components/layout/Header.jsx
index 9cceb438..f7c6b19a 100644
--- a/new-lamassu-admin/src/components/layout/Header.jsx
+++ b/new-lamassu-admin/src/components/layout/Header.jsx
@@ -141,7 +141,7 @@ const Header = memo(({ tree, user }) => {
className={classnames(classes.link, classes.whiteLink)}
activeClassName={classes.activeLink}>
-
+
{it.label}
diff --git a/new-lamassu-admin/src/components/layout/Header.styles.js b/new-lamassu-admin/src/components/layout/Header.styles.js
index a1489a90..6c254594 100644
--- a/new-lamassu-admin/src/components/layout/Header.styles.js
+++ b/new-lamassu-admin/src/components/layout/Header.styles.js
@@ -90,7 +90,7 @@ const styles = {
textAlign: 'center',
'&:after': {
display: 'block',
- content: 'attr(forcesize)',
+ content: 'attr(data-forcesize)',
fontWeight: 700,
height: 0,
overflow: 'hidden',
diff --git a/new-lamassu-admin/src/components/layout/Sidebar.jsx b/new-lamassu-admin/src/components/layout/Sidebar.jsx
index d1a6db5e..277ea343 100644
--- a/new-lamassu-admin/src/components/layout/Sidebar.jsx
+++ b/new-lamassu-admin/src/components/layout/Sidebar.jsx
@@ -26,7 +26,7 @@ const Sidebar = ({
{loading && Loading...
}
{!loading &&
data?.map((it, idx) => (
- onClick(it)}>
+
onClick(it)}>
+ editable={editable}>{children}
)
}
@@ -506,12 +505,11 @@ const CustomerData = ({
title={title}
key={idx}
state={state}
- children={children}
initialValues={initialValues}
titleIcon={titleIcon}
editable={false}
hasImage={hasImage}
- fields={fields}>
+ fields={fields}>{children}
)
}
@@ -522,23 +520,24 @@ const CustomerData = ({
{'Customer data'}
{// TODO: Remove false condition for next release
- false && (
- <>
- setListView(false)}
- />
- setListView(true)}>
- >
- )}
+ // false && (
+ // <>
+ // setListView(false)}
+ // />
+ // setListView(true)}>
+ // >
+ // )
+ }
{!listView && customer && (
diff --git a/new-lamassu-admin/src/pages/Customers/CustomerNotes.jsx b/new-lamassu-admin/src/pages/Customers/CustomerNotes.jsx
index 82b00226..57d6f81a 100644
--- a/new-lamassu-admin/src/pages/Customers/CustomerNotes.jsx
+++ b/new-lamassu-admin/src/pages/Customers/CustomerNotes.jsx
@@ -58,16 +58,15 @@ const CustomerNotes = ({
{R.isNil(editing) && (
- {R.map(
- it => (
+ {customerNotes.map((it, idx) => (
- ),
- customerNotes
+ )
)}
)}
diff --git a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.jsx b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.jsx
index ac12cce2..ba0f0b25 100644
--- a/new-lamassu-admin/src/pages/Customers/CustomerPhotos.jsx
+++ b/new-lamassu-admin/src/pages/Customers/CustomerPhotos.jsx
@@ -28,7 +28,7 @@ const CustomerPhotos = ({ photosData, timezone }) => {
{photosData.map((elem, idx) => (
}, countryCodes)
return R.any(it => it === true, validMap)
- } catch (e) {}
+ } catch (e) {
+ return false
+ }
})
.trim()
})
diff --git a/new-lamassu-admin/src/pages/Customers/components/CustomerSidebar.jsx b/new-lamassu-admin/src/pages/Customers/components/CustomerSidebar.jsx
index 5b0441c1..e4e90871 100644
--- a/new-lamassu-admin/src/pages/Customers/components/CustomerSidebar.jsx
+++ b/new-lamassu-admin/src/pages/Customers/components/CustomerSidebar.jsx
@@ -45,8 +45,9 @@ const CustomerSidebar = ({ isSelected, onClick }) => {
return (
- {sideBarOptions?.map(({ Icon, InverseIcon, display, code }) => (
+ {sideBarOptions?.map(({ Icon, InverseIcon, display, code }, idx) => (
- {false && (
-
deleteEditedData()}>
- Delete
-
- )}
+ {/*{false && (*/}
+ {/*
deleteEditedData()}>*/}
+ {/* Delete*/}
+ {/* */}
+ {/*)}*/}
{!hasAdditionalData && (
{
{!upload &&
!isCustomInfoRequirement &&
- elements.options.map(({ label, name }) => (
+ elements.options.map(({ label, name }, idx) => (
{
*/}
- {R.map(
- it => (
-
+ {R.times(R.identity, maxNumberOfCassettes).map((it, idx) => (
+
{it + 1}
- ),
- R.times(R.identity, maxNumberOfCassettes)
+ )
)}
@@ -143,21 +141,19 @@ const MachinesTable = ({ machines = [], numToRender }) => {
- {R.map(
- it =>
+ {R.range(1, maxNumberOfCassettes + 1).map((it, idx) =>
machine.numberOfCassettes >= it ? (
-
+
{makePercentageText(
it,
machine.cashUnits[`cassette${it}`]
)}
) : (
-
+
{`— %`}
- ),
- R.range(1, maxNumberOfCassettes + 1)
+ )
)}
)
diff --git a/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx b/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx
index 4596c9d8..8596cd19 100644
--- a/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx
+++ b/new-lamassu-admin/src/pages/Maintenance/CashUnitDetails.jsx
@@ -106,12 +106,12 @@ const CashUnitDetails = ({
Cash box
{R.isEmpty(billCount) && Empty}
- {R.map(it => (
-
+ {(R.keys(billCount)).map((it, idx) => (
+
{billCount[it]}
- ))(R.keys(billCount))}
+ ))}
{machine.numberOfRecyclers === 0 &&
@@ -149,8 +149,9 @@ const CashUnitDetails = ({
noMargin
className={classes.label}>{`Loading boxes`}
- {R.map(it => (
+ {(R.range(1, machine.numberOfCassettes + 1)).map((it, idx) => (
- ))(R.range(1, machine.numberOfCassettes + 1))}
+ ))}
diff --git a/new-lamassu-admin/src/pages/Maintenance/helper.jsx b/new-lamassu-admin/src/pages/Maintenance/helper.jsx
index ec721889..866a9f17 100644
--- a/new-lamassu-admin/src/pages/Maintenance/helper.jsx
+++ b/new-lamassu-admin/src/pages/Maintenance/helper.jsx
@@ -1,3 +1,4 @@
+import React from 'react'
import * as R from 'ramda'
import { CashIn, CashOutLite } from 'src/components/inputs/cashbox/Cashbox'
import EditIcon from 'src/styling/icons/action/edit/enabled.svg?react'
@@ -56,8 +57,9 @@ const getElements = (
return (
- {R.map(it => (
+ {(R.range(1, m.numberOfCassettes + 1)).map((it, idx) => (
- ))(R.range(1, m.numberOfCassettes + 1))}
+ ))}
{R.map(it => (
diff --git a/new-lamassu-admin/src/pages/Notifications/sections/Setup.jsx b/new-lamassu-admin/src/pages/Notifications/sections/Setup.jsx
index 1fc28103..67ad5c7a 100644
--- a/new-lamassu-admin/src/pages/Notifications/sections/Setup.jsx
+++ b/new-lamassu-admin/src/pages/Notifications/sections/Setup.jsx
@@ -132,8 +132,9 @@ const Setup = ({ wizard, forceDisable }) => {
))}
- {namespaces.map(namespace => (
+ {namespaces.map((namespace, idx) => (
value?.match(/#code/g || [])?.length > 0
+ test: value => value?.match(/#code/g)?.length > 0
})
.test({
name: 'has-single-code',
message: 'There should be a single confirmation code!',
exclusive: false,
- test: value => value?.match(/#code/g || [])?.length === 1
+ test: value => value?.match(/#code/g)?.length === 1
})
},
cashOutDispenseReady: {
@@ -155,12 +155,13 @@ const SMSNoticesModal = ({
Values to attach
)}
- {R.map(
- it => (
-
- {R.map(
- ite => (
+ {R.splitEvery(3, CHIPS[sms?.event]).map(
+ (it, idx) => (
+
+ {it.map(
+ (ite, idx2) => (
- ),
- it
+ )
)}
),
- R.splitEvery(3, CHIPS[sms?.event])
)}
diff --git a/new-lamassu-admin/src/pages/Transactions/DetailsCard.jsx b/new-lamassu-admin/src/pages/Transactions/DetailsCard.jsx
index 5e66953c..b0719b74 100644
--- a/new-lamassu-admin/src/pages/Transactions/DetailsCard.jsx
+++ b/new-lamassu-admin/src/pages/Transactions/DetailsCard.jsx
@@ -202,9 +202,9 @@ const DetailsRow = ({ it: tx, timezone }) => {
const walletScoreEl = (
{
in={true}
mountOnEnter
unmountOnExit
- children={
+ >
- }
- />
+
@@ -141,19 +140,18 @@ const Routes = () => {
in={!!matchPath(location.pathname, { path: route })}
mountOnEnter
unmountOnExit
- children={
-
- }
- />
+ >
+
+
- ))}
-
+ ))}
+
-
+
)