Version inicial

develop
unknown 1 year ago
parent c2edebb99a
commit 8507a9b3ed
  1. 2
      .env.development
  2. 2
      .env.production
  3. 2
      .env.qa
  4. 1
      package.json
  5. 3
      src/App.tsx
  6. 8
      src/Components/Corresponsales/Contenedores/SelectContainer.tsx
  7. 7
      src/Components/Corresponsales/Guias/SelectGuias.tsx
  8. 12
      src/Components/Corresponsales/TraficoCorresponsales.tsx
  9. 8
      src/Components/Dashboard/Dashboard.tsx
  10. 113
      src/Components/Dashboard/DashboardTrafico.tsx
  11. 176
      src/Components/Login/ForgotPassword.tsx
  12. 126
      src/Components/Login/PIN.tsx
  13. 190
      src/Components/Login/ResetCredentials.tsx
  14. 213
      src/Components/Login/login.tsx
  15. 180
      src/Components/Reportes/RptCorresponsalesTraficos.tsx
  16. 258
      src/Components/UserControl/UserControl.tsx
  17. 99
      src/Components/resetCredentials/resetCredentials.tsx
  18. 4
      src/DTO/DTOPINUsuario.ts
  19. 4
      src/DTO/DTOResetPassword.ts
  20. 5
      src/DTO/DTOUsuariosShort.ts
  21. 6
      src/Interfaces/IUsuario.ts
  22. 35
      src/Services/Auth/Auth.Service.ts
  23. 29
      src/Services/Catalogos/Usuarios.Services.ts
  24. 19
      src/Services/common/http-common.ts
  25. 54
      src/css/autoComplete.css
  26. 130
      src/css/customerColors.css
  27. 4
      src/css/generic01.css
  28. 101
      src/css/heineken.css
  29. 91
      src/css/heineken1.css
  30. 24
      src/css/printableArea.css
  31. 12
      src/css/reactCaptcha.css
  32. BIN
      src/images/Clean.png
  33. BIN
      src/images/GEMCO_login.png
  34. BIN
      src/images/caret.png
  35. 18
      src/index.tsx
  36. 23
      yarn.lock

@ -1,2 +1,2 @@
REACT_APP_ENVIRONMENT=development REACT_APP_ENVIRONMENT=development
REACT_APP_API=https://localhost:5041/api REACT_APP_API=https://localhost:5051/api

@ -1,2 +1,2 @@
REACT_APP_ENVIRONMENT=production REACT_APP_ENVIRONMENT=production
REACT_APP_API=https://www.gemcousa.mx/CORRESPONSALBackend/api REACT_APP_API=https://corresponsal.gemcousa.mx/CORRESPONSALBackend/api

@ -1,2 +1,2 @@
REACT_APP_ENVIRONMENT=qa REACT_APP_ENVIRONMENT=qa
REACT_APP_API=https://www.gemcousa.solutions/CORRESPONSALBackend/api REACT_APP_API=https://corresponsal.gemcousa.solutions/CORRESPONSALBackend/api

@ -27,6 +27,7 @@
"react": "^18.2.0", "react": "^18.2.0",
"react-apexcharts": "^1.4.0", "react-apexcharts": "^1.4.0",
"react-bootstrap": "^2.7.4", "react-bootstrap": "^2.7.4",
"react-captchaa": "^1.0.13",
"react-currency-format": "^1.1.0", "react-currency-format": "^1.1.0",
"react-data-table-component": "^7.5.3", "react-data-table-component": "^7.5.3",
"react-data-table-component-extensions": "^1.6.0", "react-data-table-component-extensions": "^1.6.0",

@ -96,12 +96,11 @@ function App() {
{!userLogued ? ( {!userLogued ? (
<> <>
<Nav.Link href="/#/login">login</Nav.Link>&nbsp; <Nav.Link href="/#/login">login</Nav.Link>&nbsp;
<Nav.Link href="/#/reset">reset</Nav.Link>
</> </>
) : ( ) : (
<> <>
<Nav.Link href="/#/logout">Logout</Nav.Link> <Nav.Link href="/#/logout">Logout</Nav.Link>
<div style={{ paddingTop: '5px' }}></div> <div style={{ paddingTop: '5px', paddingLeft:'5px' }}></div>
<IconContext.Provider value={{ size: '25px' }}> <IconContext.Provider value={{ size: '25px' }}>
<BsPersonCircle /> <BsPersonCircle />
</IconContext.Provider> </IconContext.Provider>

@ -12,7 +12,9 @@ import {
import { Alert, Button, Col, Form, Modal, Row } from 'react-bootstrap' import { Alert, Button, Col, Form, Modal, Row } from 'react-bootstrap'
import DatePicker from 'react-datepicker' import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css' import 'react-datepicker/dist/react-datepicker.css'
import { isTypeNode } from 'typescript' //Images
import caret from '../../../images/caret.png';
import clean from '../../../images/Clean.png';
interface IProps { interface IProps {
IDTrafico: number IDTrafico: number
@ -110,7 +112,7 @@ export const SelectContainer: FC<IProps> = (props) => {
<input type='hidden' className='form-control' name='IDContenedor' id='IDContenedor' value={IDContenedor} /> <input type='hidden' className='form-control' name='IDContenedor' id='IDContenedor' value={IDContenedor} />
<span className='input-group-addon sorroundImage'> <span className='input-group-addon sorroundImage'>
<img <img
src='http://reportes.gemcousa.com/images/Clean.png' src={clean}
width='28' width='28'
height='28' height='28'
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
@ -137,7 +139,7 @@ export const SelectContainer: FC<IProps> = (props) => {
/> />
<span className='input-group-addon sorroundImage'> <span className='input-group-addon sorroundImage'>
<img <img
src='http://reportes.gemcousa.com/images/caret.png' src={caret}
width='28' width='28'
height='28' height='28'
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}

@ -10,6 +10,9 @@ import {
deleteCorresponsalesGuias, deleteCorresponsalesGuias,
updateCorresponsalesGuias, updateCorresponsalesGuias,
} from '../../../store/features/Corresponsales/CorresponsalesGuiasSlice' } from '../../../store/features/Corresponsales/CorresponsalesGuiasSlice'
//Images
import caret from '../../../images/caret.png';
import clean from '../../../images/Clean.png';
interface IProps { interface IProps {
IDTrafico: number IDTrafico: number
@ -79,7 +82,7 @@ export const SelectGuias: FC<IProps> = (props) => {
<input type='hidden' className='form-control' name='IDGuia' id='IDGuia' value={IDGuia} /> <input type='hidden' className='form-control' name='IDGuia' id='IDGuia' value={IDGuia} />
<span className='input-group-addon sorroundImage'> <span className='input-group-addon sorroundImage'>
<img <img
src='http://reportes.gemcousa.com/images/Clean.png' src={clean}
width='28' width='28'
height='28' height='28'
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
@ -106,7 +109,7 @@ export const SelectGuias: FC<IProps> = (props) => {
/> />
<span className='input-group-addon sorroundImage'> <span className='input-group-addon sorroundImage'>
<img <img
src='http://reportes.gemcousa.com/images/caret.png' src={caret}
width='28' width='28'
height='28' height='28'
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}

@ -1176,7 +1176,7 @@ export default function TraficoCorresponsales (props:IProps) {
<Form.Control <Form.Control
as="select" as="select"
id="CmbCliente" id="CmbCliente"
disabled={Depto !== 'Corresponsalias'} disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')}
onChange={(e) => { onChange={(e) => {
setIDCliente(parseInt(e.target.value)) setIDCliente(parseInt(e.target.value))
}} }}
@ -1198,7 +1198,7 @@ export default function TraficoCorresponsales (props:IProps) {
<Col xs={1}> <Col xs={1}>
<Form.Label <Form.Label
onClick={() => { onClick={() => {
return Depto === 'Corresponsalias' return (Depto === 'Corresponsalias' || Depto === 'Sistemas')
? showModalBox(10) ? showModalBox(10)
: '' : ''
}} }}
@ -1263,7 +1263,7 @@ export default function TraficoCorresponsales (props:IProps) {
setTipoOperacion(parseInt(e.target.value)) setTipoOperacion(parseInt(e.target.value))
} }
value={TipoOperacion} value={TipoOperacion}
disabled={Depto !== 'Corresponsalias'} disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')}
className="form-select form-select-sm" className="form-select form-select-sm"
> >
<option value="1">Importacion</option> <option value="1">Importacion</option>
@ -1276,7 +1276,7 @@ export default function TraficoCorresponsales (props:IProps) {
id="CmbOpEntrada" id="CmbOpEntrada"
onChange={(e) => setOpEntrada(parseInt(e.target.value))} onChange={(e) => setOpEntrada(parseInt(e.target.value))}
value={OpEntrada} value={OpEntrada}
disabled={Depto !== 'Corresponsalias'} disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')}
className="form-select form-select-sm" className="form-select form-select-sm"
> >
<option value="0">- Operacion de Entrada -</option> <option value="0">- Operacion de Entrada -</option>
@ -1292,7 +1292,7 @@ export default function TraficoCorresponsales (props:IProps) {
id="CmbOpSalida" id="CmbOpSalida"
onChange={(e) => setOpSalida(parseInt(e.target.value))} onChange={(e) => setOpSalida(parseInt(e.target.value))}
value={OpSalida} value={OpSalida}
disabled={Depto !== 'Corresponsalias'} disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')}
className="form-select form-select-sm" className="form-select form-select-sm"
> >
<option value="0">- Operacion de Salida -</option> <option value="0">- Operacion de Salida -</option>
@ -1328,7 +1328,7 @@ export default function TraficoCorresponsales (props:IProps) {
}} }}
className="form-select form-select-sm" className="form-select form-select-sm"
value={IDCorresponsal} value={IDCorresponsal}
disabled={Depto !== 'Corresponsalias' ? true : false} disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')}
> >
<option value="0">-Seleccione-</option> <option value="0">-Seleccione-</option>
{mCorresponsales {mCorresponsales

@ -3,8 +3,6 @@ import DashboardCorresponsales from './DashboardCorresponsales'
import { DashboardContabilidad } from './DashboardContabilidad' import { DashboardContabilidad } from './DashboardContabilidad'
import { Col, Container, Row } from 'react-bootstrap' import { Col, Container, Row } from 'react-bootstrap'
import { DashboardFacturacion } from './DashboardFacturacion' import { DashboardFacturacion } from './DashboardFacturacion'
import { DashboardClasificacion } from './DashboardClasificacion'
import DashboardTrafico from './DashboardTrafico'
interface IProps {} interface IProps {}
@ -34,12 +32,6 @@ export default function Dashboard(props: IProps) {
{[['Direcccion', 'Sistemas', 'Facturacion'].includes(Depto) ? <DashboardFacturacion /> : ''].map((item) => { {[['Direcccion', 'Sistemas', 'Facturacion'].includes(Depto) ? <DashboardFacturacion /> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment> return <React.Fragment>{item}</React.Fragment>
})} })}
{[['Direcccion', 'Sistemas', 'Operaciones', 'Clasificacion'].includes(Depto) ? <DashboardClasificacion /> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})}
{[['Direcccion', 'Sistemas', 'Operaciones', 'Trafico'].includes(Depto) ? <DashboardTrafico /> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})}
</Row> </Row>
</Container> </Container>
</div> </div>

@ -1,113 +0,0 @@
import * as React from 'react'
import { useEffect, useState } from 'react'
import { Card, Col, ProgressBar, Row } from 'react-bootstrap'
import { IconContext } from 'react-icons'
import { FaAmazon } from 'react-icons/fa'
import { Link } from 'react-router-dom'
import '../../css/generic01.css'
import DashboardDataService from '../../Services/Dashboard/Dashboard.Clasificacion.Services'
export interface IDashboardTraficoProps {
}
export default function DashboardTrafico (props: IDashboardTraficoProps) {
const [Terminadas, setTerminadas] = useState(0)
const [Pendientes, setPendientes] = useState(0)
const [Total, setTotal] = useState(0)
useEffect(() => {
DashboardDataService.DashboardInvoices(3)
.then((response) => {
setPendientes(response.data.total)
})
.catch((e: Error) => {
return
})
DashboardDataService.DashboardInvoices(4)
.then((response) => {
setTerminadas(response.data.total)
})
.catch((e: Error) => {
return
})
}, [])
useEffect(() => {
setTotal(Pendientes + Terminadas)
}, [Pendientes, Terminadas])
return (
<>
<Col>
<Card style={{ width: '18rem' }} className='blueCardBorder dashboardComponentFont'>
<Card.Header style={{backgroundColor: '#1D6DC2', color: '#ffffff'}}>Trafico</Card.Header>
<Card.Body>
<Card.Title>
Facturas {' '}
<IconContext.Provider value={{ color: '#F6C34F', size:'30%' }}>
<FaAmazon />
</IconContext.Provider>
</Card.Title>
<Row >
<Col xs={6} style={{}}>
<Link
to="../RptAmazonLinkInvoice2Traffic"
style={{
textDecoration: 'none',
float: 'left',
paddingRight: '10px'
}}
>
Terminadas
</Link>
</Col>
<Col xs={6} className="text-center">
<Link
to="../RptAmazonPendingTraficInvoice"
style={{
textDecoration: 'none',
float: 'right',
paddingRight: '10px'
}}
>
Pendientes
</Link>
</Col>
</Row>
<Row>
<Col xs={12}>
<ProgressBar style={{ height: '25px' }}>
<ProgressBar
striped
animated
variant="success"
now={(Terminadas / Total) * 100}
key={1}
/>
<ProgressBar
striped
variant="warning"
now={(Pendientes / Total) * 100}
key={2}
/>
</ProgressBar>
</Col>
</Row>
<Row>
<Col xs={6} style={{ fontSize: '6em' }} className="text-center">
{Terminadas}
</Col>
<Col xs={6} style={{ fontSize: '6em' }} className="text-center">
{Pendientes}
</Col>
</Row>
</Card.Body>
<Card.Footer
style={{ paddingRight: '5px', paddingBottom: '5px' }}
></Card.Footer>
</Card>
</Col>
</>
)
}

@ -0,0 +1,176 @@
import * as React from 'react'
import { Button, Card, Col, Form, Row } from 'react-bootstrap'
import logo from '../../images/GEMCO_login.png'
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import ReactCaptchaa from 'react-captchaa'
import AuthDS from '../../Services/Auth/Auth.Service'
import 'react-captchaa/dist/index.css'
import '../../css/reactCaptcha.css'
import '../../css/customerColors.css'
import ILogin from '../../Interfaces/Ilogin'
import { AxiosError } from 'axios'
import { useNavigate } from 'react-router-dom'
import { useState } from 'react'
export interface IForgotPasswordProps {}
export default function ForgotPassword(props: IForgotPasswordProps) {
const navigate = useNavigate()
const [Usuario, setUsuario] = useState('')
const [Contrasenia, setContrasenia] = useState('')
const [Captcha, setCaptcha] = useState('')
const [CaptchaText, setCaptchaText] = useState('')
const [show, setShow] = useState(false)
const [msg, setMsg] = useState('')
const [header, setHeader] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const validateCaptcha = () => {
if (!Usuario.length) {
setShow(true)
setMsg('El campo usuario no puede estar vacio')
setHeader('Error')
return
}
if (Captcha !== CaptchaText) {
setShow(true)
setMsg('Captcha o usuario incorrecto')
setHeader('Error')
return
}
const data: ILogin = {
Usuario: Usuario,
Contrasena: Contrasenia,
}
AuthDS.forgotPassword(data)
.then((response: any) => {
localStorage.setItem('User', JSON.stringify(Usuario))
navigate('/PIN')
})
.catch((e: AxiosError) => {
setShow(true)
setMsg('Usuario no existe')
setHeader('Error')
})
}
return (
<div>
<Row style={{ paddingTop: '6rem' }}>
<Col xs={12}></Col>
</Row>
<Row>
<Col xs={5}>&nbsp;</Col>
<Col xs={2}>
<div
className='shadow-lg bg-white rounded'
style={{ marginLeft: 'auto', marginRight: 'auto', width:'125%' }}
>
<Card className='Color1'>
<Card.Header>
<Row className='Color2' style={{textAlign:'center'}}>
<Col xs={12}>
<img
src={logo}
alt='Corresponal'
style={{ width: '40%' }}
></img>
</Col>
</Row>
</Card.Header>
<Card.Body>
<Card.Text>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
<Form id='login-form' className='form'>
<Row>
<Col>
<Form.Control
id='Usuario'
className='form-control'
placeholder='Usuario'
value={Usuario}
onChange={(e) => {
setUsuario(e.target.value)
}}
/>
</Col>
</Row>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
<Row>
<Col xs={12}>
<ReactCaptchaa
captchaText={(captchaText: string) => {
setCaptchaText(captchaText)
}}
captchaLength={6}
captchaButtonClick={(e: any) => {}}
onCanvasClick={(e: any) => {}}
height={150}
width={200}
iconName={'FiRefreshCw'}
iconColor={'#fff'}
fontSize={'3em'}
iconSize={'1em'}
containerClassName={'react-captcha'}
iconWrapperClassName={'react-captcha-icon-wrapper'}
canvasClassName={'react-captcha-canvas'}
iconClassName={'react-captcha-icon'}
charactersInclude={
'0123456789abcdefghijklmnopqrstuvwxzABCDEFGHIJKLMNOPQRSTUVWXYZ'
}
/>
</Col>
</Row>
<Row>
<Col xs={12}>
<Form.Control
id='Captcha'
className='form-control'
placeholder='Teclee los caracteres de la imagen'
value={Captcha}
onChange={(e) => {
setCaptcha(e.target.value)
}}
/>
</Col>
</Row>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
</Form>
</Card.Text>
<div className='d-grid gap-1'></div>
<div className='d-grid gap-1'>
<Button
variant='customColor'
size='lg'
onClick={() => {
validateCaptcha()
}}
>
Continuar
</Button>
</div>
</Card.Body>
</Card>
</div>
</Col>
<Col xs={5}>&nbsp;</Col>
</Row>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
time={2000}
closeToast={function (arg: boolean): void {
setShow(false)
}}
/>
</div>
)
}

@ -0,0 +1,126 @@
import * as React from 'react'
import { Button, Card, Col, Form, Row } from 'react-bootstrap'
import logo from '../../images/GEMCO_login.png'
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import AuthDS from '../../Services/Auth/Auth.Service'
import { useState } from 'react'
import { DTOPINUsuario } from '../../DTO/DTOPINUsuario'
import { useNavigate } from 'react-router-dom'
export interface IPINProps {}
export default function PIN(props: IPINProps) {
const navigate = useNavigate()
const [User, setUser] = useState(() => {
const stickyValue = window.localStorage.getItem('User')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [Usuario, setUsuario] = useState(User)
const [PIN, setPIN] = useState('')
const [show, setShow] = useState(false)
const [msg, setMsg] = useState('')
const [header, setHeader] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const validatePIN = () => {
if (!PIN.length) {
setShow(true)
setMsg('El campo PIN no puede estar vacio')
setHeader('Error')
return false
}
const data: DTOPINUsuario = {
pin: parseInt(PIN),
usuario: Usuario,
}
console.log(JSON.stringify(data))
AuthDS.validatePIN(data)
.then((response: any) => {
localStorage.removeItem('User')
localStorage.setItem('PIN', PIN)
navigate('/Reset')
})
.catch((e: any) => {
setShow(true)
setMsg('PIN invalido!')
setHeader('Error')
return false
})
}
return (
<div>
<Row style={{ paddingTop: '6rem' }}>
<Col xs={12}></Col>
</Row>
<Row>
<Col xs={5}>&nbsp;</Col>
<Col xs={2}>
<div className='shadow-lg bg-white rounded'>
<Card style={{ width: '135%' }} className='Color1'>
<Card.Header>
<Row className='Color2' style={{textAlign:'center'}}>
<Col xs={12}>
<img
src={logo}
alt='ZINC Internacional'
style={{ width: '70%' }}
></img>
</Col>
</Row>
</Card.Header>
<Card.Body>
<Card.Text>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
<Form id='login-form' className='form'>
<Row>
<Col xs={12}>
<Form.Control
id='PIN'
className='form-control'
placeholder='PIN'
value={PIN}
onChange={(e) => {
setPIN(e.target.value)
}}
/>
</Col>
</Row>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
</Form>
</Card.Text>
<div className='d-grid gap-1'></div>
<div className='d-grid gap-1'>
<Button
variant='customColor'
size='lg'
onClick={() => {
validatePIN()
}}
>
Continuar
</Button>
</div>
</Card.Body>
</Card>
</div>
</Col>
<Col xs={5}>&nbsp;</Col>
</Row>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
time={2000}
closeToast={function (arg: boolean): void {
setShow(false)
}}
/>
</div>
)
}

@ -0,0 +1,190 @@
import React, { FC, useState } from 'react'
import {
Button,
Card,
Col,
Form,
Row,
Toast,
ToastContainer,
} from 'react-bootstrap'
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import logo from '../../images/GEMCO_login.png'
import AuthDS from '../../Services/Auth/Auth.Service'
import { DTOResetPassword } from '../../DTO/DTOResetPassword'
interface IProps {}
export default function ResetCredentials(props: IProps) {
const [User, setUser] = useState(() => {
const stickyValue = window.localStorage.getItem('User')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [PIN, setPIN] = useState(() => {
const stickyValue = window.localStorage.getItem('PIN')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [header, setHeader] = useState('Error!')
const [msgColor, setMsgColor] = useState('primary')
const [showMsg, setShowMsg] = useState(false)
const [msg, setMsg] = useState('')
const [Usuario, setUsuario] = useState(User)
const [Contrasena, setContrasena] = useState('')
const [ConfirmaContrasena, setConfirmaContrasena] = useState('')
const [show, setShow] = useState(false)
const validaFormulario = () => {
if (Contrasena.length === 0 || ConfirmaContrasena.length === 0) {
setShow(true)
setMsg('La contraseña no puede estar vacia!')
setHeader('Error')
return
}
if (Contrasena !== ConfirmaContrasena) {
setShow(true)
setMsg('Contraseña no coincide con la confirmacion!')
setHeader('Error')
return
}
const data: DTOResetPassword = {
pin: PIN,
contrasena: Contrasena,
}
AuthDS.resetPassword(data)
.then((response) => {
if (response.status == 200) {
setShow(true)
setMsg('La contraseña se cambio exitosamente!')
setHeader('Confirmacion')
return false
}
})
.catch((e: Error) => {
setShow(true)
setMsg('Ocurrio un error')
setHeader('Error')
return false
})
}
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
return (
<div>
<div>
<Row style={{ paddingTop: '6rem' }}>
<Col xs={12}></Col>
</Row>
<Row>
<Col xs={5}>&nbsp;</Col>
<Col xs={2}>
<div className='shadow-lg bg-white rounded'>
<Card style={{ width: '100%' }} className='Color1'>
<Card.Header>
<Row className='Color2' style={{ textAlign: 'center' }}>
<Col xs={12}>
<img
src={logo}
alt='ZINC Internacional'
style={{ width: '70%' }}
></img>
</Col>
</Row>
</Card.Header>
<Card.Body>
<Card.Text>
<Row className='btn-customColor' style={{textAlign:'center'}}>
<Col xs={12}>Proporcione su nueva contraseña?</Col>
</Row>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
<Form id='login-form' className='form'>
<Row style={{ height: '0px' }}>
<Col>
<Form.Control
style={{ visibility: 'hidden' }}
id='PIN'
className='form-control'
placeholder='PIN'
value={PIN}
/>
</Col>
</Row>
<Row>
<Col xs={12}>
<Form.Control
id='Contrasena'
className='form-control'
placeholder='Contraseña'
type='password'
value={Contrasena}
onChange={(e) => {
setContrasena(e.target.value)
}}
/>
</Col>
</Row>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
<Row>
<Col xs={12}>
<Form.Control
id='Contrasena'
className='form-control'
placeholder='Confirme contraseña'
type='password'
value={ConfirmaContrasena}
onChange={(e) => {
setConfirmaContrasena(e.target.value)
}}
/>
</Col>
</Row>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
</Form>
</Card.Text>
<div className='d-grid gap-2'>
<Button
variant='customColor'
size='lg'
onClick={() => {
validaFormulario()
}}
>
reset
</Button>
</div>
</Card.Body>
</Card>
</div>
</Col>
<Col xs={5}>&nbsp;</Col>
</Row>
<MsgInformativo
show={show}
msg={msg}
time={2000}
header={header}
msgColor={msgColor}
closeToast={function (arg: boolean): void {
setShow(false)
}}
/>
</div>
{/* <MsgInformativo
show={showMsg}
time={2000}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={closeToast}
/> */}
</div>
)
}

@ -1,149 +1,187 @@
import * as React from 'react' import * as React from 'react'
import { useNavigate } from 'react-router-dom' import { useNavigate } from 'react-router-dom'
import { Formik, Form, Field } from 'formik'
import { useSelector, useDispatch } from 'react-redux' import { useSelector, useDispatch } from 'react-redux'
//import { RootState } from '../../store/store'
import { logued } from '../../store/features/userStatusSlice/userStatusSlice' import { logued } from '../../store/features/userStatusSlice/userStatusSlice'
import ILogin from '../../Interfaces/Ilogin' import ILogin from '../../Interfaces/Ilogin'
import authDataService from '../../Services/Auth/Auth.Service' import ItemMenu from '../../Interfaces/Catalogos/IItemMenu'
import '../../css/login.css' import '../../css/login.css'
import jwt_decode from 'jwt-decode' import jwt_decode from 'jwt-decode'
import IjwtStructure from '../../Interfaces/IjwtStructure' import IjwtStructure from '../../Interfaces/IjwtStructure'
import { RootState } from '../../store/store' import { RootState } from '../../store/store'
import { AxiosError } from 'axios' import { AxiosError } from 'axios'
import { MsgInformativo } from '../Utils/Toast/msgInformativo' import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import logo from '../../images/GEMCO_mini.png' import logo from '../../images/GEMCO.png'
import Dashboard from '../Dashboard/Dashboard' import Dashboard from '../Dashboard/Dashboard'
import { Alert, Card } from 'react-bootstrap' import { Button, Card, Col, Form, Nav, Row } from 'react-bootstrap'
import AuthDS from '../../Services/Auth/Auth.Service'
import UserDS from '../../Services/Catalogos/Usuarios.Services'
import { useEffect } from 'react'
export const Login: React.FC<{}> = () => { export const Login: React.FC<{}> = () => {
const dispatch = useDispatch() const dispatch = useDispatch()
const navigate = useNavigate() const navigate = useNavigate()
let _menu: ItemMenu[] = []
const [mainMenu, setMainMenu] = React.useState(_menu)
const userLogued = useSelector((state: RootState) => state.userStatus.value) const userLogued = useSelector((state: RootState) => state.userStatus.value)
const [show, setShow] = React.useState(false) const [show, setShow] = React.useState(false)
const [Usuario, setUsuario] = React.useState('')
const [Contrasenia, setContrasenia] = React.useState('')
const [msg, setMsg] = React.useState('') const [msg, setMsg] = React.useState('')
const [header, setHeader] = React.useState('') const [header, setHeader] = React.useState('')
const [msgColor, setMsgColor] = React.useState('primary') const [msgColor, setMsgColor] = React.useState('primary')
const initialValues: ILogin = { Usuario: '', Contrasena: '' } const menu = localStorage.getItem('menu') ? localStorage.getItem('menu') : ''
return ( const login = () => {
<div> const credentials: ILogin = {
{!userLogued ? ( Usuario: Usuario,
<div> Contrasena: Contrasenia,
{/* <div> <Alert variant="warning"> }
<Alert.Heading>Aviso importante!</Alert.Heading> AuthDS.login(credentials)
<p>
Proximanate esteremos reunicando el contenido de este servidor de aplicaciones, al nuevo dominio de aplicaciones: https://www.gemcousa.mx
</p>
</Alert></div> */}
<div id='login'>
<div className='container'>
<div
id='login-row'
className='row justify-content-center align-items-center'
>
<div id='login-column' className='col-md-4'>
<div id='login-box' className='col-md-12'>
<Formik
initialValues={initialValues}
onSubmit={(values: any, actions: any) => {
authDataService
.create(values)
.then((response: any) => { .then((response: any) => {
localStorage.setItem( localStorage.setItem('menu', JSON.stringify(response.data.menu))
'menu',
JSON.stringify(response.data.menu)
)
localStorage.setItem('token', response.data.token) localStorage.setItem('token', response.data.token)
localStorage.setItem( localStorage.setItem(
'tokenInfo', 'tokenInfo',
JSON.stringify(jwt_decode(response.data.token)) JSON.stringify(jwt_decode(response.data.token))
) )
var values: IjwtStructure = jwt_decode( var values: IjwtStructure = jwt_decode(response.data.token)
response.data.token localStorage.setItem('UserId', JSON.stringify(values.UserId))
) localStorage.setItem('User', JSON.stringify(values.Usuario))
localStorage.setItem(
'UserId',
JSON.stringify(values.UserId)
)
localStorage.setItem(
'User',
JSON.stringify(values.Usuario)
)
localStorage.setItem( localStorage.setItem(
'Departamento', 'Departamento',
JSON.stringify(values.Departamento) JSON.stringify(values.Departamento)
) )
localStorage.setItem( localStorage.setItem('UserType', JSON.stringify(values.UserType))
'UserType', localStorage.setItem('Perfil', JSON.stringify(values.Perfil))
JSON.stringify(values.UserType)
)
localStorage.setItem(
'Perfil',
JSON.stringify(values.Perfil)
)
dispatch(logued(true)) dispatch(logued(true))
navigate('/')
}) })
.catch((e: AxiosError) => { .catch((e: AxiosError) => {
localStorage.setItem('menu', '') localStorage.setItem('menu', '')
localStorage.setItem('token', '') localStorage.setItem('token', '')
setShow(true)
setMsg('Credenciales invalidas!')
setHeader('Error') setHeader('Error')
if (e.message.includes('400')) { if (e.message.includes('400')) {
setMsg('Credenciales invalidas!') setMsg('Credenciales invalidas!')
} else if (e.message.includes('401')) { } else if (e.message.includes('401')) {
setMsg( setMsg('Debere cambiar la contraseña, para poder entrar a este sitio')
'Debere cambiar la contraseña, para poder entrar a este sitio' }
) })
}
useEffect(() => {
if (menu && userLogued) {
setMainMenu(JSON.parse(menu))
} else {
setMainMenu([])
}
}, [menu, userLogued])
useEffect(() => {
UserDS.validate()
.then((response) => {
if (response.status === 200) {
dispatch(logued(true))
} }
})
.catch((e: Error) => {
if (!window.location.href.indexOf('login')) {
localStorage.setItem('menu', '')
localStorage.setItem('token', '')
setHeader('Informativo')
setMsg('Su session ha expirado, necesita volver a loguerse')
setShow(true) setShow(true)
navigate('/')
}
}) })
}} }, [dispatch, navigate])
>
<Form id='login-form' className='form'> return (
<div className='text-center'> <div>
{!userLogued ? (
<div>
<Row style={{ paddingTop: '6rem' }}>
<Col xs={12}></Col>
</Row>
<Row>
<Col xs={5}>&nbsp;</Col>
<Col xs={2}>
<div className='shadow-lg bg-white rounded'>
<Card style={{ width: '100%' }} className='Color1'>
<Card.Header>
<Row className='Color2' style={{paddingTop:'5%', paddingBottom:'5%'}}>
<Col xs={12} style={{textAlign:'center'}}>
<img <img
src={logo} src={logo}
alt='GEMCO' alt='ZINC Internacional'
width='150px' style={{ width: '70%' }}
height='150px'
></img> ></img>
</div> </Col>
<br /> </Row>
<h3 className='text-center text-info'>Bienvenido</h3> </Card.Header>
<div className='form-group'> <Card.Body>
<label htmlFor='username'>Usuario</label> <Card.Text>
<Field <Row>
<Col xs={12}>&nbsp;</Col>
</Row>
<Form id='login-form' className='form'>
<Row>
<Col>
<Form.Control
id='Usuario' id='Usuario'
name='Usuario'
className='form-control' className='form-control'
placeholder='Usuario' placeholder='Usuario'
value={Usuario}
onChange={(e) => {
setUsuario(e.target.value)
}}
/> />
</div> </Col>
<div className='form-group'> </Row>
<label htmlFor='password'>Contraseña</label> <Row>
<Field <Col xs={12}>&nbsp;</Col>
</Row>
<Row>
<Col xs={12}>
<Form.Control
id='Contrasena' id='Contrasena'
name='Contrasena'
className='form-control' className='form-control'
placeholder='Contraseña' placeholder='Contraseña'
type='password' type='password'
value={Contrasenia}
onChange={(e) => {
setContrasenia(e.target.value)
}}
/> />
</Col>
</Row>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
</Form>
<Nav.Link style={{color: '#0F5129', textAlign:'center'}} href='/#/forgotPassword'>¿Olvido contraseña?</Nav.Link>
</Card.Text>
<div className='d-grid gap-1'>
</div> </div>
<br /> <div className='d-grid gap-1'>
<div className='text-center'> <Button
<button variant='customColor'
type='submit' size='lg'
className='btn btn-primary btn-lg btn-block' onClick={() => {
login()
}}
> >
login login
</button> </Button>
</div>
</Form>
</Formik>
</div>
</div>
</div> </div>
</Card.Body>
</Card>
</div> </div>
</Col>
<Col xs={5}>&nbsp;</Col>
</Row>
<MsgInformativo <MsgInformativo
show={show} show={show}
msg={msg} msg={msg}
@ -154,9 +192,10 @@ export const Login: React.FC<{}> = () => {
}} }}
/> />
</div> </div>
</div>
) : ( ) : (
<div><Dashboard/></div> <div>
<Dashboard />
</div>
)} )}
</div> </div>
) )

@ -1,27 +1,40 @@
import React, { FC, useEffect, useState } from 'react'
import { useParams } from 'react-router-dom'
import { useDispatch } from 'react-redux'
import { IconContext } from 'react-icons'
import { Button, Card, Col, Form, Modal, Row } from 'react-bootstrap'
import {
BsPlusLg,
BsFileEarmarkExcel,
BsSearch,
BsFillXCircleFill,
BsCheckCircleFill,
} from 'react-icons/bs'
import { RowClickedEvent } from 'ag-grid-community' import { RowClickedEvent } from 'ag-grid-community'
import { AgGridReact } from 'ag-grid-react' import { AgGridReact } from 'ag-grid-react'
import React, { FC, useEffect, useState } from 'react'
import { Button, Card, Form, Modal } from 'react-bootstrap'
import ICorresponsalTrafico from '../../Interfaces/Corresponsales/ICorresponsalTrafico'
import ClientesDataService from '../../Services/Catalogos/Clientes.Services'
import { MsgInformativo } from '../Utils/Toast/msgInformativo' import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import IClientes from '../../Interfaces/Catalogos/IClientes'
import { BsPlusLg, BsFileEarmarkExcel, BsSearch, BsFillXCircleFill, BsCheckCircleFill } from 'react-icons/bs'
import * as XLSX from 'xlsx' import * as XLSX from 'xlsx'
import moment from 'moment'
import { ProgressBar } from './customCells/progressBar'
import TraficoCorresponsales from '../Corresponsales/TraficoCorresponsales' import TraficoCorresponsales from '../Corresponsales/TraficoCorresponsales'
import DTORptCorresponsalesTraficos from '../../DTO/Corresponsales/DTORptCorresponsalesTraficos'
import ICorresponsalTrafico from '../../Interfaces/Corresponsales/ICorresponsalTrafico'
import IClientes from '../../Interfaces/Catalogos/IClientes'
import ICatCorresponsales from '../../Interfaces/Catalogos/ICatCorresponsales' import ICatCorresponsales from '../../Interfaces/Catalogos/ICatCorresponsales'
import ClientesDataService from '../../Services/Catalogos/Clientes.Services'
import CorresponsalesDataService from '../../Services/Catalogos/Corresponsales.Services' import CorresponsalesDataService from '../../Services/Catalogos/Corresponsales.Services'
import reportesServices from '../../Services/Reportes/reportes.services' import reportesServices from '../../Services/Reportes/reportes.services'
import moment from 'moment'
import DTORptCorresponsalesTraficos from '../../DTO/Corresponsales/DTORptCorresponsalesTraficos'
import { InitCorresponsalesFacturas } from '../../store/features/Corresponsales/CorresponsalesFacturasSlice' import { InitCorresponsalesFacturas } from '../../store/features/Corresponsales/CorresponsalesFacturasSlice'
import { InitCorresponsalesFacturasTerceros } from '../../store/features/Corresponsales/CorresponsalesFacturasTercerosSlice' import { InitCorresponsalesFacturasTerceros } from '../../store/features/Corresponsales/CorresponsalesFacturasTercerosSlice'
import { InitCorresponsalesContenedores } from '../../store/features/Corresponsales/CorresponsalesContenedoresSlice' import { InitCorresponsalesContenedores } from '../../store/features/Corresponsales/CorresponsalesContenedoresSlice'
import { useDispatch } from 'react-redux' /* import '../../css/generic01.css' */
import { IconContext } from 'react-icons'
import { ProgressBar } from './customCells/progressBar'
import { useParams } from 'react-router-dom'
import { FaHandSparkles } from 'react-icons/fa'
interface IProps {} interface IProps {}
@ -37,7 +50,9 @@ export default function RptCorresponsalesTraficos (props: IProps) {
}) })
const queryParams = new URLSearchParams(window.location.search) const queryParams = new URLSearchParams(window.location.search)
const status = queryParams.get('status') const status = queryParams.get('status')
const [StatusAnticipos, setStatusAnticipos] = useState(status ? parseInt(status) : 0) const [StatusAnticipos, setStatusAnticipos] = useState(
status ? parseInt(status) : 0
)
const dispatch = useDispatch() const dispatch = useDispatch()
const [IDTrafico, setIDTrafico] = useState(0) const [IDTrafico, setIDTrafico] = useState(0)
const [Data, setData] = useState<ICorresponsalTrafico[]>([]) const [Data, setData] = useState<ICorresponsalTrafico[]>([])
@ -54,7 +69,9 @@ export default function RptCorresponsalesTraficos (props: IProps) {
const [Clientes, setClientes] = useState<Array<IClientes>>() const [Clientes, setClientes] = useState<Array<IClientes>>()
const [filtro, setFiltro] = useState('') const [filtro, setFiltro] = useState('')
const gridRef = React.useRef<any>(null) const gridRef = React.useRef<any>(null)
const [DataCorresponsales, setDataCorresponsales] = useState<ICatCorresponsales[]>([]) const [DataCorresponsales, setDataCorresponsales] = useState<
ICatCorresponsales[]
>([])
const [columnDefs] = useState([ const [columnDefs] = useState([
{ field: 'id', headerName: 'id', width: 70, sortable: true, filter: true }, { field: 'id', headerName: 'id', width: 70, sortable: true, filter: true },
{ {
@ -91,10 +108,30 @@ export default function RptCorresponsalesTraficos (props: IProps) {
sortable: true, sortable: true,
filter: true, filter: true,
}, },
{ field: 'sTipoOperacion', headerName: 'Tipo operacion', sortable: true, filter: true }, {
{ field: 'sOpEntrada', headerName: 'Op Entrada', sortable: true, filter: true }, field: 'sTipoOperacion',
{ field: 'sOpSalida', headerName: 'Op Salida', sortable: true, filter: true }, headerName: 'Tipo operacion',
{ field: 'sCorresponsal', headerName: 'Corresponsal', sortable: true, filter: true }, sortable: true,
filter: true,
},
{
field: 'sOpEntrada',
headerName: 'Op Entrada',
sortable: true,
filter: true,
},
{
field: 'sOpSalida',
headerName: 'Op Salida',
sortable: true,
filter: true,
},
{
field: 'sCorresponsal',
headerName: 'Corresponsal',
sortable: true,
filter: true,
},
{ field: 'patente', sortable: true, filter: true }, { field: 'patente', sortable: true, filter: true },
{ field: 'aduana', sortable: true, filter: true }, { field: 'aduana', sortable: true, filter: true },
{ field: 'pedimento', sortable: true, filter: true }, { field: 'pedimento', sortable: true, filter: true },
@ -181,35 +218,6 @@ export default function RptCorresponsalesTraficos (props: IProps) {
return yyyy + '-' + mm + '-' + dd return yyyy + '-' + mm + '-' + dd
} }
/* useEffect(() => {
if (proc && modo) {
if (status) {
setStatusAnticipos(parseInt(status))
} else setStatusAnticipos(0)
const data: DTORptCorresponsalesTraficos = {
Inicio: '',
Fin: '',
TipoOperacion: 0,
NoCliente: 0,
IdCorresponsal: Corresponsal,
Proceso: proc ? parseInt(proc.replace('proc=','')) : 0,
Modo: modo ? parseInt(modo.replace('modo=','')) : 0,
}
reportesServices
.getRptCorresponsalesTraficos(data)
.then((response) => {
setData(response.data)
setFilteredData(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
}, [proc, modo]) */
useEffect(() => { useEffect(() => {
ClientesDataService.getAllClientes(UserId) ClientesDataService.getAllClientes(UserId)
.then((response) => { .then((response) => {
@ -286,7 +294,10 @@ export default function RptCorresponsalesTraficos (props: IProps) {
function exportExcel(jsonData: any[], fileName: string): void { function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [ let Heading = [
[ [
{ title: 'Aduana Seccion Despacho', style: { font: { sz: '18', bold: true } } }, {
title: 'Aduana Seccion Despacho',
style: { font: { sz: '18', bold: true } },
},
'Patente', 'Patente',
'Referencia', 'Referencia',
'Pedimento', 'Pedimento',
@ -337,8 +348,8 @@ export default function RptCorresponsalesTraficos (props: IProps) {
<div> <div>
<Card> <Card>
<Card.Body> <Card.Body>
<div className='row'> <Row>
<div className='col-md-2'> <Col xs={2}>
<Form.Control <Form.Control
defaultValue={Inicio} defaultValue={Inicio}
type='date' type='date'
@ -350,8 +361,8 @@ export default function RptCorresponsalesTraficos (props: IProps) {
onChange={(e) => setInicio(e.target.value)} onChange={(e) => setInicio(e.target.value)}
size='sm' size='sm'
/> />
</div> </Col>
<div className='col-md-2'> <Col xs={2}>
<Form.Control <Form.Control
defaultValue={Fin} defaultValue={Fin}
type='date' type='date'
@ -362,11 +373,11 @@ export default function RptCorresponsalesTraficos (props: IProps) {
onChange={(e) => setFin(e.target.value)} onChange={(e) => setFin(e.target.value)}
size='sm' size='sm'
/> />
</div> </Col>
<div className='col-md-1 right-label'> <Col className='right-label'>
<Form.Label>Tipo oper</Form.Label> <Form.Label>Tipo oper</Form.Label>
</div> </Col>
<div className='col-md-1'> <Col>
<Form.Control <Form.Control
as='select' as='select'
onChange={(e) => setTipoOperacion(parseInt(e.target.value))} onChange={(e) => setTipoOperacion(parseInt(e.target.value))}
@ -376,11 +387,11 @@ export default function RptCorresponsalesTraficos (props: IProps) {
<option value='1'>Importacion</option> <option value='1'>Importacion</option>
<option value='2'>Exportacion</option> <option value='2'>Exportacion</option>
</Form.Control> </Form.Control>
</div> </Col>
<div className='col-md-1 right-label'> <Col className='right-label'>
<Form.Label>Cliente</Form.Label> <Form.Label>Cliente</Form.Label>
</div> </Col>
<div className='col-md-4'> <Col xs={4}>
<Form.Control <Form.Control
as='select' as='select'
onChange={(e) => { onChange={(e) => {
@ -399,8 +410,8 @@ export default function RptCorresponsalesTraficos (props: IProps) {
}) })
: null} : null}
</Form.Control> </Form.Control>
</div> </Col>
<div className='col-md-1 right-label'> <Col className='right-label'>
<Button <Button
variant='primary' variant='primary'
size='sm' size='sm'
@ -411,11 +422,11 @@ export default function RptCorresponsalesTraficos (props: IProps) {
<BsSearch /> <BsSearch />
Buscar Buscar
</Button> </Button>
</div> </Col>
</div> </Row>
<div className='row' style={{ paddingTop: 5 }}> <Row style={{ paddingTop: 5 }}>
<div className='col'> <Col>
{Depto === 'Corresponsalias' ? ( {(Depto === 'Corresponsalias' || Depto === 'Sistemas') ? (
<Button <Button
size='sm' size='sm'
variant='primary' variant='primary'
@ -429,8 +440,8 @@ export default function RptCorresponsalesTraficos (props: IProps) {
) : ( ) : (
'' ''
)} )}
</div> </Col>
<div className='col-4'> <Col xs={4}>
<Form.Control <Form.Control
type='text' type='text'
size='sm' size='sm'
@ -439,8 +450,8 @@ export default function RptCorresponsalesTraficos (props: IProps) {
filtraReporte(e) filtraReporte(e)
}} }}
/> />
</div> </Col>
<div className='col'> <Col>
<Button <Button
size='sm' size='sm'
variant='success' variant='success'
@ -451,9 +462,9 @@ export default function RptCorresponsalesTraficos (props: IProps) {
<BsFileEarmarkExcel /> <BsFileEarmarkExcel />
&nbsp; Excel &nbsp; Excel
</Button> </Button>
</div> </Col>
<div className='col'>Corresponsal</div> <Col>Corresponsal</Col>
<div className='col-4'> <Col xs={4}>
<Form.Control <Form.Control
as='select' as='select'
onChange={(e) => { onChange={(e) => {
@ -472,9 +483,9 @@ export default function RptCorresponsalesTraficos (props: IProps) {
}) })
: null} : null}
</Form.Control> </Form.Control>
</div> </Col>
<div className='col'></div> <Col></Col>
</div> </Row>
</Card.Body> </Card.Body>
</Card> </Card>
<br /> <br />
@ -501,15 +512,16 @@ export default function RptCorresponsalesTraficos (props: IProps) {
/> />
<Modal <Modal
show={ShowModal} show={ShowModal}
/* onHide={() => setShowModal(false)} */
size='sm' size='sm'
dialogClassName='modal-90w modal-innerDiv' dialogClassName='modal-90w'
disableEscapeKeyDown={true} disableEscapeKeyDown={true}
> >
<Modal.Body style={{ <Modal.Body
maxHeight: 'calc(100vh)', style={{
overflowY: 'auto' maxHeight: 'calc(90vh)',
}}> overflowY: 'auto',
}}
>
<div> <div>
<TraficoCorresponsales <TraficoCorresponsales
IDTrafico={IDTrafico} IDTrafico={IDTrafico}

@ -0,0 +1,258 @@
import { useEffect, useState } from 'react'
import { Alert, Button, Card, Col, Form, Modal, Row } from 'react-bootstrap'
import UsuariosDS from '../../Services/Catalogos/Usuarios.Services'
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import DTOUsuariosShort from '../../DTO/DTOUsuariosShort'
import { IconContext } from 'react-icons'
import {
BsCheckCircleFill,
BsFillPencilFill,
BsFillXCircleFill,
} from 'react-icons/bs'
import DataTable from 'react-data-table-component'
import { IUsuario } from '../../Interfaces/IUsuario'
export interface IUserControlProps {}
export default function UserControl(props: IUserControlProps) {
const [Usuario, setUsuario] = useState('')
const [IDEstatus, setIDEstatus] = useState(false)
const [IDUser, setIDUser] = useState(0)
const [header, setHerader] = useState('Error!')
const [msgColor, setMsgColor] = useState('Primary')
const [showMsg, setShowMsg] = useState(false)
const [ModalDisableUser, setModalDisableUser] = useState(false)
const [UsersData, setUsersData] = useState<DTOUsuariosShort[]>([])
const [msg, setMsg] = useState('')
const colData = [
{
name: 'id',
width: '100px',
selector: (row: DTOUsuariosShort) => row.id,
sortable: true,
},
{
name: 'Usuario',
selector: (row: DTOUsuariosShort) => row.usuario,
},
{
name: '',
width: '80px',
cell: (row: DTOUsuariosShort) => (
<div
style={{ textAlign: 'center', cursor: 'pointer' }}
onClick={() => {
setIDUser(row.id)
setIDEstatus(row.activo)
setUsuario(row.usuario)
}}
>
<IconContext.Provider value={{ color: 'blue', size: '25px' }}>
<BsFillPencilFill />
</IconContext.Provider>
</div>
),
},
{
name: 'Activo',
width: '80px',
cell: (row: DTOUsuariosShort) => (
<div
style={{ textAlign: 'center', cursor: 'pointer' }}
onClick={() => {
setIDUser(row.id)
setIDEstatus(row.activo)
setUsuario(row.usuario)
setModalDisableUser(true)
}}
>
{row.activo ? (
<IconContext.Provider value={{ color: 'green', size: '25px' }}>
<BsCheckCircleFill />
</IconContext.Provider>
) : (
<IconContext.Provider value={{ color: 'red', size: '25px' }}>
<BsFillXCircleFill />
</IconContext.Provider>
)}
</div>
),
},
]
const loadUsers = () => {
UsuariosDS.getAllUsuariosShort()
.then((response) => {
//console.log(response.data)
setUsersData(response.data)
})
.catch((e: Error) => {
setMsg('Ocurrio un error: ' + e.toString())
setShowMsg(true)
})
}
useEffect(() => {
loadUsers()
}, [])
const disableUser = () => {
UsuariosDS.disableUser(IDUser)
.then((response) => {
setModalDisableUser(false)
loadUsers()
})
.catch((e: Error) => {
setMsg('Ocurrio un error: ' + e.toString())
setShowMsg(true)
})
}
const createUser = () => {
const data: IUsuario = {
id: IDUser,
usuario: Usuario,
nombre: Usuario,
correo: Usuario
}
UsuariosDS.create(data)
.then((response) => {
setModalDisableUser(false)
loadUsers()
})
.catch((e: Error) => {
setMsg('Ocurrio un error: ' + e.toString())
setShowMsg(true)
})
}
function closeToast(arg: boolean): void {
throw new Error('Function not implemented.')
}
return (
<div>
<Row>
<Col xs={12}>&nbsp;</Col>
</Row>
<Row>
<Col></Col>
<Col xs={4}>
<Card>
<Card.Header style={{ fontWeight: 'bold', fontSize: '20px' }}>
Control de usuarios
</Card.Header>
<Card.Body>
<Card.Text>
<Row>
<Col xs={2}>Usuario</Col>
<Col xs={10}>
<Form.Control
id='Usuario'
className='form-control'
placeholder='Usuario'
value={Usuario}
onChange={(e) => {
setUsuario(e.target.value)
}}
/>
</Col>
</Row>
</Card.Text>
<Row>
<Col xs={10}></Col>
<Col xs={2}>
<Button variant='primary' onClick={()=>{createUser()}}>Guarda</Button>
</Col>
</Row>
</Card.Body>
</Card>
</Col>
<Col xs={3}></Col>
<Col xs={3}>
<Card>
<Card.Header style={{ fontWeight: 'bold', fontSize: '20px' }}>
Lista de usuarios
</Card.Header>
<Card.Body>
<Card.Text>
<Row>
<Col xs={12}>
<DataTable
noHeader
defaultSortFieldId={'id'}
defaultSortAsc={true}
pagination
highlightOnHover
columns={colData}
data={UsersData.filter(function (row) {
return row
})}
/>
</Col>
</Row>
</Card.Text>
</Card.Body>
</Card>
</Col>
<Col></Col>
</Row>
<Modal
show={ModalDisableUser}
onHide={() => setModalDisableUser(false)}
size='lg'
>
<Modal.Body>
<Card className='labelSize13px'>
<Card.Body>
<Card>
<Row>
<Col xs={12}>
<Alert variant='warning' style={{ textAlign: 'center' }}>
<h6>
Esta seguro de { IDEstatus ? 'deshabilitar' : 'habilitar'} este este usuario ({Usuario})?
<br />
</h6>
</Alert>
</Col>
</Row>
<Row style={{ paddingTop: '10px', paddingBottom: '10px' }}>
<Col></Col>
<Col xs={1}>
<Button
variant='secondary'
style={{ textAlign: 'right' }}
onClick={() => {
setModalDisableUser(false)
}}
>
Cerrar
</Button>
</Col>
<Col xs={7}></Col>
<Col xs={3}>
<Button
variant={IDEstatus ? 'danger' : 'primary'}
onClick={() => {
disableUser()
}}
>
{ IDEstatus ? 'Deshabilitar' : 'Habilitar'}
</Button>
</Col>
</Row>
</Card>
</Card.Body>
</Card>
</Modal.Body>
</Modal>
<MsgInformativo
show={showMsg}
msg={msg}
header={header}
msgColor={msgColor} closeToast={()=> {}} />
</div>
)
}

@ -1,99 +0,0 @@
import React, { FC } from 'react'
import { Button, Form, Toast, ToastContainer } from 'react-bootstrap'
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import DTOUsuario from '../../DTO/DTOUsuario'
import usuariosServices from '../../Services/Catalogos/Usuarios.Services'
interface IProps {}
export default function ResetCredentials(props: IProps) {
const [header, setHerader] = React.useState('Error!')
const [msgColor, setMsgColor] = React.useState('Primary')
const [showMsg, setShowMsg] = React.useState(false)
const [msg, setMsg] = React.useState('')
const [usuario, setUsuario] = React.useState('')
const [contrasena, setContrasena] = React.useState('')
const [confirmaContrasena, setConfirmaContrasena] = React.useState('')
const validaFormulario = () => {
if (contrasena != confirmaContrasena) {
setMsg('Contrasena no coincide con su confirmacion!')
setShowMsg(true)
return
}
const data: DTOUsuario = {
Usuario: usuario,
Contrasena: contrasena,
}
usuariosServices
.resetPassword(data)
.then((response) => {
if (response.status == 200) alert('La contrasena se reseteo exisosamente')
if (response.status == 204) alert('Usuario no existe')
console.log(response.data)
})
.catch((e: Error) => {
console.log(e)
//alert(e);
let message = e.message
setMsg(message)
if (message.includes('400')) setMsg('Usuario no encontrado')
setShowMsg(true)
})
}
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
return (
<div>
{' '}
<div id='login'>
<div className='container'>
<div id='login-row' className='row justify-content-center align-items-center'>
<div id='login-column' className='col-md-4'>
<div id='login-box' className='col-md-12'>
<Form id='login-form' className='form'>
<h3 className='text-center text-info'>Olvido su contraseña</h3>
<Form.Group className='mb-3 control-label' controlId='formBasicEmail'>
<Form.Label>Usuario</Form.Label>
<Form.Control placeholder='Usuario' onChange={(e) => setUsuario(e.currentTarget.value)} />
</Form.Group>
<Form.Group className='mb-3 control-label' controlId='formBasicPassword'>
<Form.Label>Nueva contraseña</Form.Label>
<Form.Control
type='password'
placeholder='Contraseña'
onChange={(e) => setContrasena(e.currentTarget.value)}
/>
</Form.Group>
<Form.Group className='mb-3 control-label' controlId='formBasicPassword'>
<Form.Label>Confirme su nueva contraseña</Form.Label>
<Form.Control
type='password'
placeholder='Confirme su contraseña'
onChange={(e) => setConfirmaContrasena(e.currentTarget.value)}
/>
</Form.Group>
<Button
variant='primary'
onClick={() => {
validaFormulario()
}}
>
Submit
</Button>
</Form>
</div>
</div>
</div>
</div>
<MsgInformativo show={showMsg} msg={msg} header={header} msgColor={msgColor} closeToast={closeToast} />
</div>
</div>
)
}

@ -0,0 +1,4 @@
export interface DTOPINUsuario {
pin: number,
usuario: string
}

@ -0,0 +1,4 @@
export interface DTOResetPassword {
pin: number,
contrasena: string
}

@ -1,4 +1,5 @@
export default interface DTOUsuariosShort { export default interface DTOUsuariosShort {
id: number; id: number,
usuario: string; usuario: string,
activo: boolean
} }

@ -0,0 +1,6 @@
export interface IUsuario {
id: number,
usuario: string,
nombre: string,
correo: string
}

@ -2,38 +2,31 @@ import http from "../common/http-common";
import ILogin from "../../Interfaces/Ilogin" import ILogin from "../../Interfaces/Ilogin"
import ItemMenuData from "../../Interfaces/Catalogos/IItemMenu"; import ItemMenuData from "../../Interfaces/Catalogos/IItemMenu";
import Token from '../../Interfaces/token' import Token from '../../Interfaces/token'
import IRespuesta from "../../Interfaces/IRespuesta";
import { DTOPINUsuario } from "../../DTO/DTOPINUsuario";
import { DTOResetPassword } from "../../DTO/DTOResetPassword";
import DTOUsuario from "../../DTO/DTOUsuario";
class authDataService { class authDataService {
/**
*
*/
constructor() { constructor() {
// super(); // super();
type token = string; type token = string;
type returnData = [ItemMenuData[], Token] type returnData = [ItemMenuData[], Token]
} }
login(data: ILogin) {
/*getAll() {
return http.get<Array<ILogin>>("/tutorials");
}
get(id: string) {
return http.get<ITutorialData>(`/tutorials/${id}`);
}*/
create(data: ILogin) {
return http.post<[ItemMenuData[], Token]>("/Auth", data); return http.post<[ItemMenuData[], Token]>("/Auth", data);
} }
/* loginTransaport(data: ILogin) {
update(data: ITutorialData, id: any) { return http.post<[ItemMenuData[], Token]>("/Auth/AreYouTransport", data);
return http.put<any>(`/tutorials/${id}`, data); }
forgotPassword(data: ILogin) {
return http.post<IRespuesta>("/Auth/forgotPassword", data);
} }
delete(id: any) { validatePIN(data: DTOPINUsuario) {
return http.delete<any>(`/tutorials/${id}`); return http.post<IRespuesta>("/Auth/validatePIN", data);
} }
deleteAll() { resetPassword(data: DTOResetPassword) {
return http.delete<any>(`/tutorials`); return http.post<DTOUsuario>("/Auth/resetPassword", data);
} }
findByTitle(title: string) {
return http.get<Array<ITutorialData>>(`/tutorials?title=${title}`);
}*/
} }
export default new authDataService(); export default new authDataService();

@ -2,7 +2,7 @@ import http from "../common/http-common";
import { IRegister } from "../../Interfaces/IRegister"; import { IRegister } from "../../Interfaces/IRegister";
import DTOUsuariosShort from "../../DTO/DTOUsuariosShort"; import DTOUsuariosShort from "../../DTO/DTOUsuariosShort";
import DTOClonarUsuario from "../../DTO/DTOClonarUsuario"; import DTOClonarUsuario from "../../DTO/DTOClonarUsuario";
import DTOUsuario from "../../DTO/DTOUsuario"; import { IUsuario } from "../../Interfaces/IUsuario";
class usuariosService { class usuariosService {
@ -17,33 +17,14 @@ class usuariosService {
getAllUsuariosShort() { getAllUsuariosShort() {
return http.get<DTOUsuariosShort[]>("/Usuarios/getAllUsuariosShort"); return http.get<DTOUsuariosShort[]>("/Usuarios/getAllUsuariosShort");
} }
create(data: IRegister) { create(data: IUsuario) {
return http.post<[IRegister[]]>("/Usuarios/createUser", data); return http.post<[IRegister[]]>("/Usuarios/createUsuario", data);
} }
clonarUsuario(data: DTOClonarUsuario) { clonarUsuario(data: DTOClonarUsuario) {
return http.post<[DTOClonarUsuario[]]>("/Usuarios/clonarUsuario", data); return http.post<[DTOClonarUsuario[]]>("/Usuarios/clonarUsuario", data);
} }
resetPassword(data: DTOUsuario) { disableUser(id: number) {
return http.post<DTOUsuario>("/Usuarios/resetPassword", data); return http.put<boolean>(`/Usuarios/disableUser?id=${id}`);
} }
/* get(id: string) {
return http.get<ITutorialData>(`/tutorials/${id}`);
}
create(data: ILogin) {
return http.post<[ItemMenuData[]]>("/Auth", data);
}
update(data: ITutorialData, id: any) {
return http.put<any>(`/tutorials/${id}`, data);
}
delete(id: any) {
return http.delete<any>(`/tutorials/${id}`);
}
deleteAll() {
return http.delete<any>(`/tutorials`);
}
findByTitle(title: string) {
return http.get<Array<ITutorialData>>(`/tutorials?title=${title}`);
}*/
} }
export default new usuariosService(); export default new usuariosService();

@ -13,8 +13,19 @@ const instance = axios.create({
instance.interceptors.response.use( instance.interceptors.response.use(
function (response) { function (response) {
/* if (process.env.NODE_ENV === 'development') return response
console.log('log: ' + JSON.stringify(response)) */ },
function (error) {
const Excluded = ['login', 'Reset', 'forgotPassword', 'PIN']
const currentUrl = window.location.href
var urlExceptuado = new RegExp(Excluded.join('|')).test(currentUrl)
if (401 === error.response.status && !urlExceptuado) {
window.location.href = '/#/login'
} else {
return Promise.reject(error)
}
return Promise.reject(error)
/* function (response) {
return response return response
}, },
function (error) { function (error) {
@ -24,13 +35,11 @@ instance.interceptors.response.use(
) { ) {
return Promise.reject(error) return Promise.reject(error)
} else if (401 === error.response.status) { } else if (401 === error.response.status) {
/* localStorage.clear();*/
window.location.href = '/#/login' window.location.href = '/#/login'
} else if ( } else if (
409 === error.response.status && 409 === error.response.status &&
error.response.data.respuesta.indexOf('factura') error.response.data.respuesta.indexOf('factura')
) { ) {
//console.log(JSON.stringify(error.response))
if (error.response.data.registro.factura) { if (error.response.data.registro.factura) {
error.response.data.registro.id === -1 error.response.data.registro.id === -1
? alert( ? alert(
@ -44,7 +53,7 @@ instance.interceptors.response.use(
} }
} else { } else {
return Promise.reject(error) return Promise.reject(error)
} } */
} }
) )

@ -1,54 +0,0 @@
.mainDiv {
/* padding-top: 50px; */
font-family: sans-serif;
text-align: left;
/*width: 300px;*/
/*margin: 0 auto;*/
}
.typeahead-form-group {
position: relative;
z-index: 1000;
}
.typeahead-form-group1 {
position: relative;
z-index: 999;
}
.typeahead-form-group2 {
position: relative;
z-index: 998;
}
.typeahead-form-group3 {
position: relative;
z-index: 998;
}
.typeahead-list-group4 {
position: absolute;
width: 100%;
top: 38px;
left: 0;
}
.typeahead-list-group-item {
/* padding: 0.3rem 1.3rem; */
background-color: rgb(228, 243, 240);
}
.typeahead-list-group-item:hover {
cursor: pointer;
background: #2d4ddc;
color: #fff;
}
.textBoxViaje {
z-index: 100;
}
.textField {
margin-right: 0px !important;
padding-right: 0px;
}

@ -0,0 +1,130 @@
.MDTable {
width: 3500px;
font-size: 0.8em;
font-family: Verdana, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue,
sans-serif;
background-color: #ffffff;
}
.MDHeaderSticky {
position: 'sticky';
top: '0';
}
.MDTable th,
.MDTable td {
padding: 0px 0px 0px 0px;
border: none;
/* padding-top: 5px; */
background-color: #ebecfa;
}
.MDTable tr {
background-color: #dddcdc;
}
.MDTable thead tr th {
/* text-shadow: 1px 1px 1px #ccc; */
font-weight: normal;
font-size: 1.1em;
background-color: #0f5129;
color: #ffffff;
height: 30px;
}
.MDTable tbody tr td {
border-top: solid 1px #c8cacd;
/* border-bottom: solid 1px #092a84; */
font-size: 1.2em;
background-color: #ffffff;
/* height: 25px; */
}
.MDTable tbody tr:nth-of-type(even) {
background-color: #c2bfbf;
}
.MDTable tbody tr:nth-of-type(odd) {
background-color: #c0bdbd;
}
.MDcontainer {
width: 100%;
height: 600px;
overflow: auto;
}
.zui-table {
border: solid 1px #ddeeee;
border-collapse: collapse;
border-spacing: 0;
font: normal 11px Arial, sans-serif;
}
.zui-table thead tr th {
background-color: #ddefef;
border: solid 1px #ddeeee;
color: #336b6b;
padding: 5px;
text-align: left;
text-shadow: 1px 1px 1px #fff;
}
.zui-table tbody td {
border: dotted 1px #ddeeee;
color: #333;
padding: 0px;
text-shadow: 1px 1px 1px #fff;
border-bottom: none;
border-top: none;
}
.zui-table-rounded {
border: none;
}
.zui-table-rounded thead th {
background-color: #cfad70;
border: none;
text-shadow: 1px 1px 1px #ccc;
color: #333;
}
.zui-table-rounded thead th:first-child {
border-radius: 10px 0 0 0;
}
.zui-table-rounded thead th:last-child {
border-radius: 0 10px 0 0;
}
.zui-table-rounded tbody tr td {
border: none;
border-top: dotted 1px #09840f;
background-color: #eed592;
border-bottom: none;
}
.zui-table-rounded tbody tr:last-child td:first-child {
border-radius: 0 0 0 10px;
}
.zui-table-rounded tbody tr:last-child td:last-child {
border-radius: 0 0 10px 0;
}
.zui-table-min {
height: 0px;
}
.Color1 {
border-color: #E8E9F0;
}
.Color2 {
background-color: #E8E9F0;
}
.btn-customColor {
background-color: blue;
color: white;
}

@ -21,8 +21,8 @@
.modal-90w { .modal-90w {
width: 90%; width: 90%;
/* max-height: 90% !important; */ max-width: none !important;
max-height: 'calc(100vh - 50px)' !important; max-height: none !important;
} }
.modal-innerDiv { .modal-innerDiv {

@ -1,101 +0,0 @@
body {
width: 100% !important;
font-family: Verdana, 'Flamenco', serif;
}
h1 {
color: #fff;
font-weight: normal;
font-size: 1rem;
text-align: center;
}
/*_________________ Accordion
________________________________________*/
.accordion {
position: relative;
margin: 60px auto;
width: 250px;
}
[id*="open-accordion"],
[id*="close-accordion"] {
background: #153f8e;
border-bottom: 1px solid #fff;
line-height: 40px;
height: 40px;
display: block;
margin: 0 auto;
position: relative;
width: 99%;
}
[id*="close-accordion"] {
display: none;
}
.accordion a {
color: #d8f0ef;
font-size: 1em;
font-weight: normal;
padding-left: 2%;
text-decoration: none;
text-shadow: none;
background-color: #153f8e;
}
[id*="open-accordion"]:after,
[id*="close-accordion"]:after {
/* content: "";
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid rgba(255, 255, 255, 0.6);*/
position: absolute;
right: 5px;
top: 15px;
z-index: 999;
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
}
.target-fix {
display: block;
top: 0;
left: 0;
position: fixed;
}
.accordion-content {
color: #000000;
background: #153f8e;
height: 0;
margin: -1px auto 0;
/* padding: 0 2.5%; */
position: relative;
overflow: hidden;
width: 90%;
transition: all 0.1s ease;
-webkit-transition: all 0.1s ease;
-moz-transition: all 0.1s ease;
}
.accordion span:target~.accordion-content {
display: block;
height: auto;
padding-bottom: 25px;
padding-top: 10px;
}
.accordion span:target~[id*="close-accordion"] {
display: block;
}
.accordion span:target~[id*="open-accordion"] {
display: none;
}
.accordion span:target~[id*="close-accordion"]:after {
border-top: 10px solid #333;
transform: rotate(0deg);
-webkit-transform: rotate(0deg);
}

@ -1,91 +0,0 @@
* {
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: 13px;
list-style: none;
text-decoration: none;
}
body {}
.middle {
position: absolute;
top: 50%;
/* left: 50%; */
transform: translate(-50%, -50%);
}
.menu {
width: 200px;
border-radius: 8px;
overflow: hidden;
}
.item {
border-top: 1px solid #2980b9;
overflow: hidden;
}
/* .btn {
display: block;
padding: 16px 20px;
background: #3498db;
color: white;
position: relative;
} */
/* .btn:before {
content: "";
position: absolute;
width: 14px;
height: 14px;
background-color: #3498db;
left: 20px;
bottom: -7px;
transform: rotate(45deg);
} */
.btn i {
margin-right: 10px;
}
.smenu {
background: #333;
overflow: hidden;
transition: max-height 0.3s;
max-height: 0;
}
.smenu a {
display: block;
padding: 16px 26px;
color: #fff;
font-size: 13px;
/* margin: 4px 0; */
position: relative;
}
.smenu a:before {
content: "";
position: absolute;
width: 4px;
height: 100%;
background: #3498db;
left: 0;
top: 0;
transition: 0.3s;
opacity: 0;
}
.smenu a:hover:before {
opacity: 1;
}
.item:target .smenu {
max-height: 15em;
}
.card {
height: 100%;
}

@ -1,24 +0,0 @@
.printableDiv {
background-color: #ffffff;
width: 100%;
height: calc(100vh);
border: none !important;
border-radius: 5px;
margin: auto;
text-align: center;
}
table {
background-color: #ffffff;
border: none !important;
display: inline-table;
}
.noneBorder {
border-top: 2 px solid #ffffff !important;
border-bottom: 2 px solid #ffffff !important;
}
td:nth-child(odd) {
background-color: #ffffff;
}

@ -0,0 +1,12 @@
/* .react-captcha {
background-color: #000000;
}
*/
/* .react-captcha-icon-wrapper {
}
*/
.react-captcha-canvas{
background-color: rgb(242, 242, 248);
color: #fff;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

@ -1,5 +1,5 @@
import React, { useEffect } from 'react' import React, { useEffect } from 'react'
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom/client'
import 'bootstrap/dist/css/bootstrap.min.css' import 'bootstrap/dist/css/bootstrap.min.css'
import App from './App' import App from './App'
import reportWebVitals from './reportWebVitals' import reportWebVitals from './reportWebVitals'
@ -11,12 +11,15 @@ import CatTabuladores from './Components/Catalogos/CatTabulador/CatTabulador'
import DashboardCorresponsales from './Components/Dashboard/DashboardCorresponsales' import DashboardCorresponsales from './Components/Dashboard/DashboardCorresponsales'
import Dashboard from './Components/Dashboard/Dashboard' import Dashboard from './Components/Dashboard/Dashboard'
import Logout from './Components/Logout/logout' import Logout from './Components/Logout/logout'
import ResetCredentials from './Components/resetCredentials/resetCredentials'
import Register from './Components/Register/register' import Register from './Components/Register/register'
import RegisterPermisoClientes from './Components/registerPermisoClientes/registerPermisoClientes' import RegisterPermisoClientes from './Components/registerPermisoClientes/registerPermisoClientes'
import TraficoCorresponsales from './Components/Corresponsales/TraficoCorresponsales' import TraficoCorresponsales from './Components/Corresponsales/TraficoCorresponsales'
import RptCorresponsalesTraficos from './Components/Reportes/RptCorresponsalesTraficos' import RptCorresponsalesTraficos from './Components/Reportes/RptCorresponsalesTraficos'
import RptCorresponsalesTraficosHst from './Components/Reportes/RptCorresponsalesTraficosHst' import RptCorresponsalesTraficosHst from './Components/Reportes/RptCorresponsalesTraficosHst'
import ForgotPassword from './Components/Login/ForgotPassword'
import PIN from './Components/Login/PIN'
import UserControl from './Components/UserControl/UserControl'
import ResetCredentials from './Components/Login/ResetCredentials'
require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`) require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`)
function PageNotFound() { function PageNotFound() {
@ -27,7 +30,8 @@ function PageNotFound() {
) )
} }
ReactDOM.render( const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
root.render(
<Provider store={store}> <Provider store={store}>
<React.StrictMode> <React.StrictMode>
<HashRouter> <HashRouter>
@ -36,8 +40,11 @@ ReactDOM.render(
<Route path="/" element={<Dashboard />}></Route> <Route path="/" element={<Dashboard />}></Route>
<Route path="/login" element={<Login />} /> <Route path="/login" element={<Login />} />
<Route path="/logout" element={<Logout />} /> <Route path="/logout" element={<Logout />} />
<Route path='/forgotPassword' element={<ForgotPassword />} />
<Route path='/PIN' element={<PIN />} />
<Route path='/UserControl' element={<UserControl />} />
<Route path="/reset" element={<ResetCredentials />} /> <Route path="/reset" element={<ResetCredentials />} />
<Route path="/register" element={<Register />} /> <Route path="/Register" element={<Register />} />
<Route path="/permisos" element={<RegisterPermisoClientes />} /> <Route path="/permisos" element={<RegisterPermisoClientes />} />
<Route <Route
path="/TraficoCorresponsales" path="/TraficoCorresponsales"
@ -69,8 +76,7 @@ ReactDOM.render(
</Routes> </Routes>
</HashRouter> </HashRouter>
</React.StrictMode> </React.StrictMode>
</Provider>, </Provider>
document.getElementById('root')
) )
reportWebVitals() reportWebVitals()

@ -3176,7 +3176,7 @@ camelcase-css@^2.0.1:
resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5"
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
camelcase@^5.3.1: camelcase@^5.0.0, camelcase@^5.3.1:
version "5.3.1" version "5.3.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
@ -7875,6 +7875,13 @@ react-bootstrap@^2.7.4:
uncontrollable "^7.2.1" uncontrollable "^7.2.1"
warning "^4.0.3" warning "^4.0.3"
react-captchaa@^1.0.13:
version "1.0.13"
resolved "https://registry.yarnpkg.com/react-captchaa/-/react-captchaa-1.0.13.tgz#ee1d95e4d2ed11481c11c462881a897820b6fe0f"
integrity sha512-3z/734oX4PzCs9DlNbkroaFlPGTI0skPSFW2HrM+5I5wS0Mjo3nbDMxuFy/YjUXIuqV0C/Lgdfb0saGkkMnUgg==
dependencies:
react-icons-wrapper "^1.0.8"
react-currency-format@^1.1.0: react-currency-format@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/react-currency-format/-/react-currency-format-1.1.0.tgz#efef7f18045fc09a987de270b144f5eec8801dab" resolved "https://registry.yarnpkg.com/react-currency-format/-/react-currency-format-1.1.0.tgz#efef7f18045fc09a987de270b144f5eec8801dab"
@ -7975,6 +7982,20 @@ react-flexy-table@^1.8.11:
resolved "https://registry.yarnpkg.com/react-flexy-table/-/react-flexy-table-1.8.11.tgz#c9a1c00ff06a2afdcacdddb990fe7a16ef1b667c" resolved "https://registry.yarnpkg.com/react-flexy-table/-/react-flexy-table-1.8.11.tgz#c9a1c00ff06a2afdcacdddb990fe7a16ef1b667c"
integrity sha512-/3rBki6JDaa8gvRUqlJPoL9nC/sGnxX8YApT+QIStOXYTZ4jE0o5WOVd45hT+UU5D//xB+OSCVl6KyZAsT+1cQ== integrity sha512-/3rBki6JDaa8gvRUqlJPoL9nC/sGnxX8YApT+QIStOXYTZ4jE0o5WOVd45hT+UU5D//xB+OSCVl6KyZAsT+1cQ==
react-icons-wrapper@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/react-icons-wrapper/-/react-icons-wrapper-1.0.8.tgz#5d2a9447bc13fcdef405a84ef622b04daf697a37"
integrity sha512-6nO/Z5+l/5MxXS6LeMKNoaYBo8MFKg+mC4/ZAJ6q2EGfTg6LoOarcOWHyYF7oNbGPG3jv0/UyA2CkwfpT7eqpw==
dependencies:
react-icons "^3.10.0"
react-icons@^3.10.0:
version "3.11.0"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-3.11.0.tgz#2ca2903dfab8268ca18ebd8cc2e879921ec3b254"
integrity sha512-JRgiI/vdF6uyBgyZhVyYJUZAop95Sy4XDe/jmT3R/bKliFWpO/uZBwvSjWEdxwzec7SYbEPNPck0Kff2tUGM2Q==
dependencies:
camelcase "^5.0.0"
react-icons@^4.8.0: react-icons@^4.8.0:
version "4.8.0" version "4.8.0"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.8.0.tgz#621e900caa23b912f737e41be57f27f6b2bff445" resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.8.0.tgz#621e900caa23b912f737e41be57f27f6b2bff445"

Loading…
Cancel
Save