chore: reformat code

This commit is contained in:
Rafael Taranto 2025-05-12 14:49:39 +01:00
parent 3d930aa73b
commit aedabcbdee
509 changed files with 6030 additions and 4266 deletions

View file

@ -37,7 +37,7 @@ const getLamassuRoutes = () => [
label: 'Transactions',
route: '/transactions',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Transactions
component: Transactions,
},
{
key: 'maintenance',
@ -53,44 +53,44 @@ const getLamassuRoutes = () => [
label: 'Cash units',
route: '/maintenance/cash-units',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: CashUnits
component: CashUnits,
},
{
key: 'funding',
label: 'Funding',
route: '/maintenance/funding',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Funding
component: Funding,
},
{
key: 'logs',
label: 'Machine logs',
route: '/maintenance/logs',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: MachineLogs
component: MachineLogs,
},
{
key: 'machine-status',
label: 'Machine status',
route: '/maintenance/machine-status',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: MachineStatus
component: MachineStatus,
},
{
key: 'server-logs',
label: 'Server',
route: '/maintenance/server-logs',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: ServerLogs
}
]
component: ServerLogs,
},
],
},
{
key: 'analytics',
label: 'Analytics',
route: '/analytics',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Analytics
component: Analytics,
},
{
key: 'settings',
@ -106,42 +106,42 @@ const getLamassuRoutes = () => [
label: 'Commissions',
route: '/settings/commissions',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Commissions
component: Commissions,
},
{
key: namespaces.LOCALE,
label: 'Locales',
route: '/settings/locale',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Locales
component: Locales,
},
{
key: namespaces.CASH_OUT,
label: 'Cash-out',
route: '/settings/cash-out',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Cashout
component: Cashout,
},
{
key: namespaces.NOTIFICATIONS,
label: 'Notifications',
route: '/settings/notifications',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Notifications
component: Notifications,
},
{
key: 'services',
label: 'Third-party services',
route: '/settings/3rd-party-services',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Services
component: Services,
},
{
key: namespaces.WALLETS,
label: 'Wallet',
route: '/settings/wallet-settings',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: WalletSettings
component: WalletSettings,
},
{
key: namespaces.OPERATOR_INFO,
@ -154,7 +154,7 @@ const getLamassuRoutes = () => [
<Redirect
to={{
pathname: this.children[0].route,
state: { prev: this.state?.prev }
state: { prev: this.state?.prev },
}}
/>
)
@ -165,46 +165,46 @@ const getLamassuRoutes = () => [
label: 'Contact information',
route: '/settings/operator-info/contact-info',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: ContactInfo
component: ContactInfo,
},
{
key: 'receipt-printing',
label: 'Receipt',
route: '/settings/operator-info/receipt-printing',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: ReceiptPrinting
component: ReceiptPrinting,
},
{
key: 'sms-notices',
label: 'SMS notices',
route: '/settings/operator-info/sms-notices',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: SMSNotices
component: SMSNotices,
},
{
key: 'coin-atm-radar',
label: 'Coin ATM Radar',
route: '/settings/operator-info/coin-atm-radar',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: CoinAtmRadar
component: CoinAtmRadar,
},
{
key: 'terms-conditions',
label: 'Terms & Conditions',
route: '/settings/operator-info/terms-conditions',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: TermsConditions
component: TermsConditions,
},
{
key: 'machine-screens',
label: 'Machine screens',
route: '/settings/operator-info/machine-screens',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: MachineScreens
}
]
}
]
component: MachineScreens,
},
],
},
],
},
{
key: 'compliance',
@ -220,21 +220,21 @@ const getLamassuRoutes = () => [
label: 'Triggers',
route: '/compliance/triggers',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Triggers
component: Triggers,
},
{
key: 'customers',
label: 'Customers',
route: '/compliance/customers',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Customers
component: Customers,
},
{
key: 'blacklist',
label: 'Blacklist',
route: '/compliance/blacklist',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Blacklist
component: Blacklist,
},
{
key: 'loyalty',
@ -247,7 +247,7 @@ const getLamassuRoutes = () => [
<Redirect
to={{
pathname: this.children[0].route,
state: { prev: this.state?.prev }
state: { prev: this.state?.prev },
}}
/>
)
@ -258,24 +258,24 @@ const getLamassuRoutes = () => [
label: 'Individual discounts',
route: '/compliance/loyalty/individual-discounts',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: IndividualDiscounts
component: IndividualDiscounts,
},
{
key: 'promo-codes',
label: 'Promo codes',
route: '/compliance/loyalty/codes',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: PromoCodes
}
]
component: PromoCodes,
},
],
},
{
key: 'customer',
route: '/compliance/customer/:id',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: CustomerProfile
}
]
component: CustomerProfile,
},
],
},
{
key: 'system',
@ -291,17 +291,17 @@ const getLamassuRoutes = () => [
label: 'User management',
route: '/system/user-management',
allowedRoles: [ROLES.SUPERUSER],
component: UserManagement
component: UserManagement,
},
{
key: 'session-management',
label: 'Session management',
route: '/system/session-management',
allowedRoles: [ROLES.SUPERUSER],
component: SessionManagement
}
]
}
component: SessionManagement,
},
],
},
]
export default getLamassuRoutes

View file

@ -7,7 +7,7 @@ import {
Redirect,
Switch,
useHistory,
useLocation
useLocation,
} from 'react-router-dom'
import Login from 'src/pages/Authentication/Login'
import Register from 'src/pages/Authentication/Register'
@ -30,7 +30,7 @@ const tree = getLamassuRoutes()
const map = R.map(R.when(R.has('children'), R.prop('children')))
const mappedRoutes = R.compose(R.flatten, map)(tree)
const parentRoutes = R.filter(R.has('children'))(mappedRoutes).concat(
R.filter(R.has('children'))(tree)
R.filter(R.has('children'))(tree),
)
const leafRoutes = R.compose(R.flatten, map)(mappedRoutes)
@ -41,8 +41,8 @@ const hasSidebar = route =>
R.compose(
R.flatten,
R.map(R.prop('children')),
R.filter(R.has('children'))
)(mappedRoutes)
R.filter(R.has('children')),
)(mappedRoutes),
)
const getParent = route =>
@ -51,9 +51,9 @@ const getParent = route =>
'route',
R.dropLast(
1,
R.dropLastWhile(x => x !== '/', route)
)
)
R.dropLastWhile(x => x !== '/', route),
),
),
)(flattened)
const Routes = () => {
@ -68,7 +68,7 @@ const Routes = () => {
'/login',
'/register',
'/resetpassword',
'/reset2fa'
'/reset2fa',
]
if (!wizardTested && !R.contains(location.pathname)(dontTriggerPages)) {
@ -94,7 +94,7 @@ const Routes = () => {
R.findIndex(R.propEq('route', location.state.prev))(leafRoutes) >
R.findIndex(R.propEq('route', location.pathname))(leafRoutes)
? 'right'
: 'left'
: 'left',
}
: { timeout: 400 }

View file

@ -7,5 +7,5 @@ export const isLoggedIn = userData =>
export const ROLES = {
USER: 'user',
SUPERUSER: 'superuser'
SUPERUSER: 'superuser',
}