fix: hide lamassu screens and initial wizard steps on pazuz

This commit is contained in:
José Oliveira 2022-04-22 14:37:45 +01:00
parent fe18b4990f
commit 8090756eec
2 changed files with 16 additions and 19 deletions

View file

@ -2,6 +2,7 @@ import { useQuery } from '@apollo/react-hooks'
import { makeStyles, Dialog, DialogContent } from '@material-ui/core' import { makeStyles, Dialog, DialogContent } from '@material-ui/core'
import classnames from 'classnames' import classnames from 'classnames'
import gql from 'graphql-tag' import gql from 'graphql-tag'
import * as R from 'ramda'
import React, { useState, useContext } from 'react' import React, { useState, useContext } from 'react'
import { useHistory } from 'react-router-dom' import { useHistory } from 'react-router-dom'
@ -52,6 +53,18 @@ const Wizard = ({ fromAuthRegister }) => {
const [footerExp, setFooterExp] = useState(false) const [footerExp, setFooterExp] = useState(false)
const getSteps = STEPS => {
const buildTarget = process.env.REACT_APP_BUILD_TARGET
if (buildTarget === 'PAZUZ') {
return R.filter(step => step.id !== 'wallet' && step.id !== 'twilio')(
STEPS
)
}
return STEPS
}
const steps = getSteps(STEPS)
if (loading) { if (loading) {
return <></> return <></>
} }
@ -78,7 +91,7 @@ const Wizard = ({ fromAuthRegister }) => {
} }
const doContinue = () => { const doContinue = () => {
if (step >= STEPS.length - 1) { if (step >= steps.length - 1) {
setOpen(false) setOpen(false)
history.push('/') history.push('/')
} }
@ -89,7 +102,7 @@ const Wizard = ({ fromAuthRegister }) => {
setStep(nextStep) setStep(nextStep)
} }
const current = STEPS[step] const current = steps[step]
return ( return (
<Dialog fullScreen open={open}> <Dialog fullScreen open={open}>
@ -99,7 +112,7 @@ const Wizard = ({ fromAuthRegister }) => {
{!isWelcome && ( {!isWelcome && (
<Footer <Footer
currentStep={step} currentStep={step}
steps={STEPS.length - 1} steps={steps.length - 1}
exImage={current.exImage} exImage={current.exImage}
subtitle={current.subtitle} subtitle={current.subtitle}
text={current.text} text={current.text}

View file

@ -9,7 +9,6 @@ import Blacklist from 'src/pages/Blacklist'
import Cashout from 'src/pages/Cashout' import Cashout from 'src/pages/Cashout'
import Commissions from 'src/pages/Commissions' import Commissions from 'src/pages/Commissions'
import { Customers, CustomerProfile } from 'src/pages/Customers' import { Customers, CustomerProfile } from 'src/pages/Customers'
import Funding from 'src/pages/Funding'
import Locales from 'src/pages/Locales' import Locales from 'src/pages/Locales'
import IndividualDiscounts from 'src/pages/LoyaltyPanel/IndividualDiscounts' import IndividualDiscounts from 'src/pages/LoyaltyPanel/IndividualDiscounts'
import PromoCodes from 'src/pages/LoyaltyPanel/PromoCodes' import PromoCodes from 'src/pages/LoyaltyPanel/PromoCodes'
@ -23,7 +22,6 @@ import ReceiptPrinting from 'src/pages/OperatorInfo/ReceiptPrinting'
import SMSNotices from 'src/pages/OperatorInfo/SMSNotices/SMSNotices' import SMSNotices from 'src/pages/OperatorInfo/SMSNotices/SMSNotices'
import TermsConditions from 'src/pages/OperatorInfo/TermsConditions' import TermsConditions from 'src/pages/OperatorInfo/TermsConditions'
import ServerLogs from 'src/pages/ServerLogs' import ServerLogs from 'src/pages/ServerLogs'
import Services from 'src/pages/Services/Services'
import SessionManagement from 'src/pages/SessionManagement/SessionManagement' import SessionManagement from 'src/pages/SessionManagement/SessionManagement'
import Transactions from 'src/pages/Transactions/Transactions' import Transactions from 'src/pages/Transactions/Transactions'
import Triggers from 'src/pages/Triggers' import Triggers from 'src/pages/Triggers'
@ -56,13 +54,6 @@ const getPazuzRoutes = () => [
allowedRoles: [ROLES.USER, ROLES.SUPERUSER], allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: CashCassettes component: CashCassettes
}, },
{
key: 'funding',
label: 'Funding',
route: '/maintenance/funding',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Funding
},
{ {
key: 'logs', key: 'logs',
label: 'Machine Logs', label: 'Machine Logs',
@ -130,13 +121,6 @@ const getPazuzRoutes = () => [
allowedRoles: [ROLES.USER, ROLES.SUPERUSER], allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Notifications component: Notifications
}, },
{
key: 'services',
label: '3rd Party Services',
route: '/settings/3rd-party-services',
allowedRoles: [ROLES.USER, ROLES.SUPERUSER],
component: Services
},
{ {
key: namespaces.OPERATOR_INFO, key: namespaces.OPERATOR_INFO,
label: 'Operator Info', label: 'Operator Info',