diff --git a/.env.development b/.env.development index 8dc4075..94fe642 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,2 @@ REACT_APP_ENVIRONMENT=development -REACT_APP_API=https://localhost:5041/api \ No newline at end of file +REACT_APP_API=https://localhost:5051/api \ No newline at end of file diff --git a/.env.production b/.env.production index 624dd3e..c9f3bcd 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ REACT_APP_ENVIRONMENT=production -REACT_APP_API=https://www.gemcousa.mx/CORRESPONSALBackend/api +REACT_APP_API=https://corresponsal.gemcousa.mx/CORRESPONSALBackend/api diff --git a/.env.qa b/.env.qa index 3f60a2c..0af14c8 100644 --- a/.env.qa +++ b/.env.qa @@ -1,2 +1,2 @@ REACT_APP_ENVIRONMENT=qa -REACT_APP_API=https://www.gemcousa.solutions/CORRESPONSALBackend/api \ No newline at end of file +REACT_APP_API=https://corresponsal.gemcousa.solutions/CORRESPONSALBackend/api \ No newline at end of file diff --git a/package.json b/package.json index 1d039d4..5b149aa 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "react": "^18.2.0", "react-apexcharts": "^1.4.0", "react-bootstrap": "^2.7.4", + "react-captchaa": "^1.0.13", "react-currency-format": "^1.1.0", "react-data-table-component": "^7.5.3", "react-data-table-component-extensions": "^1.6.0", diff --git a/src/App.tsx b/src/App.tsx index 8c7ad4f..e66f6e2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -96,12 +96,11 @@ function App() { {!userLogued ? ( <> login  - reset ) : ( <> Logout -
+
diff --git a/src/Components/Corresponsales/Contenedores/SelectContainer.tsx b/src/Components/Corresponsales/Contenedores/SelectContainer.tsx index 9a07f54..9d1c9d1 100644 --- a/src/Components/Corresponsales/Contenedores/SelectContainer.tsx +++ b/src/Components/Corresponsales/Contenedores/SelectContainer.tsx @@ -12,7 +12,9 @@ import { import { Alert, Button, Col, Form, Modal, Row } from 'react-bootstrap' import DatePicker from 'react-datepicker' 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 { IDTrafico: number @@ -110,7 +112,7 @@ export const SelectContainer: FC = (props) => { = (props) => { /> = (props) => { = (props) => { /> { setIDCliente(parseInt(e.target.value)) }} @@ -1198,7 +1198,7 @@ export default function TraficoCorresponsales (props:IProps) { { - return Depto === 'Corresponsalias' + return (Depto === 'Corresponsalias' || Depto === 'Sistemas') ? showModalBox(10) : '' }} @@ -1263,7 +1263,7 @@ export default function TraficoCorresponsales (props:IProps) { setTipoOperacion(parseInt(e.target.value)) } value={TipoOperacion} - disabled={Depto !== 'Corresponsalias'} + disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')} className="form-select form-select-sm" > @@ -1276,7 +1276,7 @@ export default function TraficoCorresponsales (props:IProps) { id="CmbOpEntrada" onChange={(e) => setOpEntrada(parseInt(e.target.value))} value={OpEntrada} - disabled={Depto !== 'Corresponsalias'} + disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')} className="form-select form-select-sm" > @@ -1292,7 +1292,7 @@ export default function TraficoCorresponsales (props:IProps) { id="CmbOpSalida" onChange={(e) => setOpSalida(parseInt(e.target.value))} value={OpSalida} - disabled={Depto !== 'Corresponsalias'} + disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')} className="form-select form-select-sm" > @@ -1328,7 +1328,7 @@ export default function TraficoCorresponsales (props:IProps) { }} className="form-select form-select-sm" value={IDCorresponsal} - disabled={Depto !== 'Corresponsalias' ? true : false} + disabled={(Depto !== 'Corresponsalias' && Depto !== 'Sistemas')} > {mCorresponsales diff --git a/src/Components/Dashboard/Dashboard.tsx b/src/Components/Dashboard/Dashboard.tsx index 46d18e4..e15d2ea 100644 --- a/src/Components/Dashboard/Dashboard.tsx +++ b/src/Components/Dashboard/Dashboard.tsx @@ -3,8 +3,6 @@ import DashboardCorresponsales from './DashboardCorresponsales' import { DashboardContabilidad } from './DashboardContabilidad' import { Col, Container, Row } from 'react-bootstrap' import { DashboardFacturacion } from './DashboardFacturacion' -import { DashboardClasificacion } from './DashboardClasificacion' -import DashboardTrafico from './DashboardTrafico' interface IProps {} @@ -34,12 +32,6 @@ export default function Dashboard(props: IProps) { {[['Direcccion', 'Sistemas', 'Facturacion'].includes(Depto) ? : ''].map((item) => { return {item} })} - {[['Direcccion', 'Sistemas', 'Operaciones', 'Clasificacion'].includes(Depto) ? : ''].map((item) => { - return {item} - })} - {[['Direcccion', 'Sistemas', 'Operaciones', 'Trafico'].includes(Depto) ? : ''].map((item) => { - return {item} - })} diff --git a/src/Components/Dashboard/DashboardTrafico.tsx b/src/Components/Dashboard/DashboardTrafico.tsx deleted file mode 100644 index cb66b8a..0000000 --- a/src/Components/Dashboard/DashboardTrafico.tsx +++ /dev/null @@ -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 ( - <> - - - Trafico - - - Facturas {' '} - - - - - - - - Terminadas - - - - - Pendientes - - - - - - - - - - - - - - {Terminadas} - - - {Pendientes} - - - - - - - - ) - } - \ No newline at end of file diff --git a/src/Components/Login/ForgotPassword.tsx b/src/Components/Login/ForgotPassword.tsx new file mode 100644 index 0000000..7308b91 --- /dev/null +++ b/src/Components/Login/ForgotPassword.tsx @@ -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 ( +
+ + + + +   + +
+ + + + + Corresponal + + + + + + +   + +
+ + + { + setUsuario(e.target.value) + }} + /> + + + +   + + + + { + 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' + } + /> + + + + + { + setCaptcha(e.target.value) + }} + /> + + + +   + +
+
+
+
+ +
+
+
+
+ +   +
+ +
+ ) +} diff --git a/src/Components/Login/PIN.tsx b/src/Components/Login/PIN.tsx new file mode 100644 index 0000000..cd9d0e2 --- /dev/null +++ b/src/Components/Login/PIN.tsx @@ -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 ( +
+ + + + +   + +
+ + + + + ZINC Internacional + + + + + + +   + +
+ + + { + setPIN(e.target.value) + }} + /> + + + +   + +
+
+
+
+ +
+
+
+
+ +   +
+ +
+ ) +} diff --git a/src/Components/Login/ResetCredentials.tsx b/src/Components/Login/ResetCredentials.tsx new file mode 100644 index 0000000..f610bf1 --- /dev/null +++ b/src/Components/Login/ResetCredentials.tsx @@ -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 ( +
+
+ + + + +   + +
+ + + + + ZINC Internacional + + + + + + + Proporcione su nueva contraseña? + + +   + +
+ + + + + + + + { + setContrasena(e.target.value) + }} + /> + + + +   + + + + { + setConfirmaContrasena(e.target.value) + }} + /> + + + +   + +
+
+
+ +
+
+
+
+ +   +
+ +
+ {/* */} +
+ ) +} diff --git a/src/Components/Login/login.tsx b/src/Components/Login/login.tsx index 1c126f9..11a6190 100644 --- a/src/Components/Login/login.tsx +++ b/src/Components/Login/login.tsx @@ -1,149 +1,187 @@ import * as React from 'react' import { useNavigate } from 'react-router-dom' -import { Formik, Form, Field } from 'formik' import { useSelector, useDispatch } from 'react-redux' -//import { RootState } from '../../store/store' import { logued } from '../../store/features/userStatusSlice/userStatusSlice' import ILogin from '../../Interfaces/Ilogin' -import authDataService from '../../Services/Auth/Auth.Service' +import ItemMenu from '../../Interfaces/Catalogos/IItemMenu' import '../../css/login.css' import jwt_decode from 'jwt-decode' import IjwtStructure from '../../Interfaces/IjwtStructure' import { RootState } from '../../store/store' import { AxiosError } from 'axios' 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 { 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<{}> = () => { const dispatch = useDispatch() const navigate = useNavigate() + let _menu: ItemMenu[] = [] + const [mainMenu, setMainMenu] = React.useState(_menu) const userLogued = useSelector((state: RootState) => state.userStatus.value) const [show, setShow] = React.useState(false) + const [Usuario, setUsuario] = React.useState('') + const [Contrasenia, setContrasenia] = React.useState('') const [msg, setMsg] = React.useState('') const [header, setHeader] = React.useState('') const [msgColor, setMsgColor] = React.useState('primary') - const initialValues: ILogin = { Usuario: '', Contrasena: '' } + const menu = localStorage.getItem('menu') ? localStorage.getItem('menu') : '' + + const login = () => { + const credentials: ILogin = { + Usuario: Usuario, + Contrasena: Contrasenia, + } + AuthDS.login(credentials) + .then((response: any) => { + localStorage.setItem('menu', JSON.stringify(response.data.menu)) + localStorage.setItem('token', response.data.token) + localStorage.setItem( + 'tokenInfo', + JSON.stringify(jwt_decode(response.data.token)) + ) + var values: IjwtStructure = jwt_decode(response.data.token) + localStorage.setItem('UserId', JSON.stringify(values.UserId)) + localStorage.setItem('User', JSON.stringify(values.Usuario)) + localStorage.setItem( + 'Departamento', + JSON.stringify(values.Departamento) + ) + localStorage.setItem('UserType', JSON.stringify(values.UserType)) + localStorage.setItem('Perfil', JSON.stringify(values.Perfil)) + dispatch(logued(true)) + navigate('/') + }) + .catch((e: AxiosError) => { + localStorage.setItem('menu', '') + localStorage.setItem('token', '') + setShow(true) + setMsg('Credenciales invalidas!') + setHeader('Error') + if (e.message.includes('400')) { + setMsg('Credenciales invalidas!') + } else if (e.message.includes('401')) { + setMsg('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) + navigate('/') + } + }) + }, [dispatch, navigate]) return (
{!userLogued ? (
-{/*
- Aviso importante! -

- Proximanate esteremos reunicando el contenido de este servidor de aplicaciones, al nuevo dominio de aplicaciones: https://www.gemcousa.mx -

-
*/} -
-
-
-
-
- { - authDataService - .create(values) - .then((response: any) => { - localStorage.setItem( - 'menu', - JSON.stringify(response.data.menu) - ) - localStorage.setItem('token', response.data.token) - localStorage.setItem( - 'tokenInfo', - JSON.stringify(jwt_decode(response.data.token)) - ) - var values: IjwtStructure = jwt_decode( - response.data.token - ) - localStorage.setItem( - 'UserId', - JSON.stringify(values.UserId) - ) - localStorage.setItem( - 'User', - JSON.stringify(values.Usuario) - ) - localStorage.setItem( - 'Departamento', - JSON.stringify(values.Departamento) - ) - localStorage.setItem( - 'UserType', - JSON.stringify(values.UserType) - ) - localStorage.setItem( - 'Perfil', - JSON.stringify(values.Perfil) - ) - dispatch(logued(true)) - }) - .catch((e: AxiosError) => { - localStorage.setItem('menu', '') - localStorage.setItem('token', '') - setHeader('Error') - if (e.message.includes('400')) { - setMsg('Credenciales invalidas!') - } else if (e.message.includes('401')) { - setMsg( - 'Debere cambiar la contraseña, para poder entrar a este sitio' - ) - } - setShow(true) - }) - }} - > -
-
+ + + + +   + +
+ + + + GEMCO -
-
-

Bienvenido

-
- - -
-
- - -
-
-
- -
- - -
+ + + + + + +   + +
+ + + { + setUsuario(e.target.value) + }} + /> + + + +   + + + + { + setContrasenia(e.target.value) + }} + /> + + + +   + +
+ ¿Olvido contraseña? +
+
+ +
+
+ +
+
+
-
-
+ +   + = () => { }} />
-
) : ( -
+
+ +
)}
) -} +} \ No newline at end of file diff --git a/src/Components/Reportes/RptCorresponsalesTraficos.tsx b/src/Components/Reportes/RptCorresponsalesTraficos.tsx index eb6a3cc..f86995c 100644 --- a/src/Components/Reportes/RptCorresponsalesTraficos.tsx +++ b/src/Components/Reportes/RptCorresponsalesTraficos.tsx @@ -1,31 +1,44 @@ +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 { 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 IClientes from '../../Interfaces/Catalogos/IClientes' -import { BsPlusLg, BsFileEarmarkExcel, BsSearch, BsFillXCircleFill, BsCheckCircleFill } from 'react-icons/bs' + import * as XLSX from 'xlsx' +import moment from 'moment' + +import { ProgressBar } from './customCells/progressBar' 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 ClientesDataService from '../../Services/Catalogos/Clientes.Services' import CorresponsalesDataService from '../../Services/Catalogos/Corresponsales.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 { InitCorresponsalesFacturasTerceros } from '../../store/features/Corresponsales/CorresponsalesFacturasTercerosSlice' import { InitCorresponsalesContenedores } from '../../store/features/Corresponsales/CorresponsalesContenedoresSlice' -import { useDispatch } from 'react-redux' -import { IconContext } from 'react-icons' -import { ProgressBar } from './customCells/progressBar' -import { useParams } from 'react-router-dom' -import { FaHandSparkles } from 'react-icons/fa' +/* import '../../css/generic01.css' */ interface IProps {} -export default function RptCorresponsalesTraficos (props: IProps) { +export default function RptCorresponsalesTraficos(props: IProps) { const { proc, modo } = useParams() const [UserId, setUserId] = useState(() => { const stickyValue = window.localStorage.getItem('UserId') @@ -37,7 +50,9 @@ export default function RptCorresponsalesTraficos (props: IProps) { }) const queryParams = new URLSearchParams(window.location.search) 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 [IDTrafico, setIDTrafico] = useState(0) const [Data, setData] = useState([]) @@ -54,7 +69,9 @@ export default function RptCorresponsalesTraficos (props: IProps) { const [Clientes, setClientes] = useState>() const [filtro, setFiltro] = useState('') const gridRef = React.useRef(null) - const [DataCorresponsales, setDataCorresponsales] = useState([]) + const [DataCorresponsales, setDataCorresponsales] = useState< + ICatCorresponsales[] + >([]) const [columnDefs] = useState([ { field: 'id', headerName: 'id', width: 70, sortable: true, filter: true }, { @@ -91,10 +108,30 @@ export default function RptCorresponsalesTraficos (props: IProps) { sortable: true, filter: true, }, - { field: 'sTipoOperacion', headerName: 'Tipo operacion', 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: 'sTipoOperacion', + headerName: 'Tipo operacion', + 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: 'aduana', sortable: true, filter: true }, { field: 'pedimento', sortable: true, filter: true }, @@ -181,35 +218,6 @@ export default function RptCorresponsalesTraficos (props: IProps) { 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(() => { ClientesDataService.getAllClientes(UserId) .then((response) => { @@ -232,7 +240,7 @@ export default function RptCorresponsalesTraficos (props: IProps) { setShowMsg(true) return }) - generaReporte() + generaReporte() }, []) function getParams(e: RowClickedEvent) { @@ -249,28 +257,28 @@ export default function RptCorresponsalesTraficos (props: IProps) { const generaReporte = () => { if (proc && modo) { - const data: DTORptCorresponsalesTraficos = { - Inicio: moment(Inicio).format('YYYY-MM-DD'), - Fin: moment(Fin).format('YYYY-MM-DD'), - TipoOperacion: TipoOperacion, - NoCliente: Cliente, - 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) - console.log(response.data) - }) - .catch((e: Error) => { - setHeader('Error') - setMsg('Ocurrio un error: ' + e) - setShowMsg(true) - return - }) + const data: DTORptCorresponsalesTraficos = { + Inicio: moment(Inicio).format('YYYY-MM-DD'), + Fin: moment(Fin).format('YYYY-MM-DD'), + TipoOperacion: TipoOperacion, + NoCliente: Cliente, + 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) + console.log(response.data) + }) + .catch((e: Error) => { + setHeader('Error') + setMsg('Ocurrio un error: ' + e) + setShowMsg(true) + return + }) } } @@ -286,7 +294,10 @@ export default function RptCorresponsalesTraficos (props: IProps) { function exportExcel(jsonData: any[], fileName: string): void { let Heading = [ [ - { title: 'Aduana Seccion Despacho', style: { font: { sz: '18', bold: true } } }, + { + title: 'Aduana Seccion Despacho', + style: { font: { sz: '18', bold: true } }, + }, 'Patente', 'Referencia', 'Pedimento', @@ -337,8 +348,8 @@ export default function RptCorresponsalesTraficos (props: IProps) {
-
-
+ + setInicio(e.target.value)} size='sm' /> -
-
+ + setFin(e.target.value)} size='sm' /> -
-
+ + Tipo oper -
-
+ + setTipoOperacion(parseInt(e.target.value))} @@ -376,11 +387,11 @@ export default function RptCorresponsalesTraficos (props: IProps) { -
-
+ + Cliente -
-
+ + { @@ -399,8 +410,8 @@ export default function RptCorresponsalesTraficos (props: IProps) { }) : null} -
-
+ + -
-
-
-
- {Depto === 'Corresponsalias' ? ( + + + + + {(Depto === 'Corresponsalias' || Depto === 'Sistemas') ? ( -
-
Corresponsal
-
+ + Corresponsal + { @@ -472,9 +483,9 @@ export default function RptCorresponsalesTraficos (props: IProps) { }) : null} -
-
-
+ + +

@@ -501,15 +512,16 @@ export default function RptCorresponsalesTraficos (props: IProps) { /> setShowModal(false)} */ size='sm' - dialogClassName='modal-90w modal-innerDiv' + dialogClassName='modal-90w' disableEscapeKeyDown={true} > - +
([]) + 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) => ( +
{ + setIDUser(row.id) + setIDEstatus(row.activo) + setUsuario(row.usuario) + }} + > + + + +
+ ), + }, + { + name: 'Activo', + width: '80px', + cell: (row: DTOUsuariosShort) => ( +
{ + setIDUser(row.id) + setIDEstatus(row.activo) + setUsuario(row.usuario) + setModalDisableUser(true) + }} + > + {row.activo ? ( + + + + ) : ( + + + + )} +
+ ), + }, + + ] + + 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 ( +
+ +   + + + + + + + Control de usuarios + + + + + Usuario + + { + setUsuario(e.target.value) + }} + /> + + + + + + + + + + + + + + + + + Lista de usuarios + + + + + + + + + + + + + + + setModalDisableUser(false)} + size='lg' + > + + + + + + + +
+ Esta seguro de { IDEstatus ? 'deshabilitar' : 'habilitar'} este este usuario ({Usuario})? +
+
+
+ +
+ + + + + + + + + + +
+
+
+
+
+ {}} /> +
+ ) +} diff --git a/src/Components/resetCredentials/resetCredentials.tsx b/src/Components/resetCredentials/resetCredentials.tsx deleted file mode 100644 index d98b5d4..0000000 --- a/src/Components/resetCredentials/resetCredentials.tsx +++ /dev/null @@ -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 ( -
- {' '} -
-
-
-
-
-
-

Olvido su contraseña

- - Usuario - setUsuario(e.currentTarget.value)} /> - - - Nueva contraseña - setContrasena(e.currentTarget.value)} - /> - - - Confirme su nueva contraseña - setConfirmaContrasena(e.currentTarget.value)} - /> - - -
-
-
-
-
- -
-
- ) -} diff --git a/src/DTO/DTOPINUsuario.ts b/src/DTO/DTOPINUsuario.ts new file mode 100644 index 0000000..5e50d94 --- /dev/null +++ b/src/DTO/DTOPINUsuario.ts @@ -0,0 +1,4 @@ +export interface DTOPINUsuario { + pin: number, + usuario: string +} \ No newline at end of file diff --git a/src/DTO/DTOResetPassword.ts b/src/DTO/DTOResetPassword.ts new file mode 100644 index 0000000..8d27345 --- /dev/null +++ b/src/DTO/DTOResetPassword.ts @@ -0,0 +1,4 @@ +export interface DTOResetPassword { + pin: number, + contrasena: string +} \ No newline at end of file diff --git a/src/DTO/DTOUsuariosShort.ts b/src/DTO/DTOUsuariosShort.ts index 1d3bf61..9273d23 100644 --- a/src/DTO/DTOUsuariosShort.ts +++ b/src/DTO/DTOUsuariosShort.ts @@ -1,4 +1,5 @@ export default interface DTOUsuariosShort { - id: number; - usuario: string; + id: number, + usuario: string, + activo: boolean } \ No newline at end of file diff --git a/src/Interfaces/IUsuario.ts b/src/Interfaces/IUsuario.ts new file mode 100644 index 0000000..2bf2e03 --- /dev/null +++ b/src/Interfaces/IUsuario.ts @@ -0,0 +1,6 @@ +export interface IUsuario { + id: number, + usuario: string, + nombre: string, + correo: string + } \ No newline at end of file diff --git a/src/Services/Auth/Auth.Service.ts b/src/Services/Auth/Auth.Service.ts index 19b62cb..20310c8 100644 --- a/src/Services/Auth/Auth.Service.ts +++ b/src/Services/Auth/Auth.Service.ts @@ -2,38 +2,31 @@ import http from "../common/http-common"; import ILogin from "../../Interfaces/Ilogin" import ItemMenuData from "../../Interfaces/Catalogos/IItemMenu"; 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 { - /** - * - */ constructor() { - // super(); - type token = string; - type returnData = [ItemMenuData[], Token] - } - - /*getAll() { - return http.get>("/tutorials"); - } - get(id: string) { - return http.get(`/tutorials/${id}`); - }*/ - create(data: ILogin) { - return http.post<[ItemMenuData[], Token]>("/Auth", data); - } - /* - update(data: ITutorialData, id: any) { - return http.put(`/tutorials/${id}`, data); - } - delete(id: any) { - return http.delete(`/tutorials/${id}`); - } - deleteAll() { - return http.delete(`/tutorials`); - } - findByTitle(title: string) { - return http.get>(`/tutorials?title=${title}`); - }*/ -} -export default new authDataService(); \ No newline at end of file + // super(); + type token = string; + type returnData = [ItemMenuData[], Token] + } + login(data: ILogin) { + return http.post<[ItemMenuData[], Token]>("/Auth", data); + } + loginTransaport(data: ILogin) { + return http.post<[ItemMenuData[], Token]>("/Auth/AreYouTransport", data); + } + forgotPassword(data: ILogin) { + return http.post("/Auth/forgotPassword", data); + } + validatePIN(data: DTOPINUsuario) { + return http.post("/Auth/validatePIN", data); + } + resetPassword(data: DTOResetPassword) { + return http.post("/Auth/resetPassword", data); + } + } + export default new authDataService(); \ No newline at end of file diff --git a/src/Services/Catalogos/Usuarios.Services.ts b/src/Services/Catalogos/Usuarios.Services.ts index ed0559c..dae1d32 100644 --- a/src/Services/Catalogos/Usuarios.Services.ts +++ b/src/Services/Catalogos/Usuarios.Services.ts @@ -2,7 +2,7 @@ import http from "../common/http-common"; import { IRegister } from "../../Interfaces/IRegister"; import DTOUsuariosShort from "../../DTO/DTOUsuariosShort"; import DTOClonarUsuario from "../../DTO/DTOClonarUsuario"; -import DTOUsuario from "../../DTO/DTOUsuario"; +import { IUsuario } from "../../Interfaces/IUsuario"; class usuariosService { @@ -17,33 +17,14 @@ class usuariosService { getAllUsuariosShort() { return http.get("/Usuarios/getAllUsuariosShort"); } - create(data: IRegister) { - return http.post<[IRegister[]]>("/Usuarios/createUser", data); + create(data: IUsuario) { + return http.post<[IRegister[]]>("/Usuarios/createUsuario", data); } clonarUsuario(data: DTOClonarUsuario) { return http.post<[DTOClonarUsuario[]]>("/Usuarios/clonarUsuario", data); } - resetPassword(data: DTOUsuario) { - return http.post("/Usuarios/resetPassword", data); + disableUser(id: number) { + return http.put(`/Usuarios/disableUser?id=${id}`); } - - /* get(id: string) { - return http.get(`/tutorials/${id}`); - } - create(data: ILogin) { - return http.post<[ItemMenuData[]]>("/Auth", data); - } - update(data: ITutorialData, id: any) { - return http.put(`/tutorials/${id}`, data); - } - delete(id: any) { - return http.delete(`/tutorials/${id}`); - } - deleteAll() { - return http.delete(`/tutorials`); - } - findByTitle(title: string) { - return http.get>(`/tutorials?title=${title}`); - }*/ } export default new usuariosService(); \ No newline at end of file diff --git a/src/Services/common/http-common.ts b/src/Services/common/http-common.ts index 4679c04..e310ebd 100644 --- a/src/Services/common/http-common.ts +++ b/src/Services/common/http-common.ts @@ -13,8 +13,19 @@ const instance = axios.create({ instance.interceptors.response.use( function (response) { - /* if (process.env.NODE_ENV === 'development') - console.log('log: ' + JSON.stringify(response)) */ + return 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 }, function (error) { @@ -24,13 +35,11 @@ instance.interceptors.response.use( ) { return Promise.reject(error) } else if (401 === error.response.status) { - /* localStorage.clear();*/ window.location.href = '/#/login' } else if ( 409 === error.response.status && error.response.data.respuesta.indexOf('factura') ) { - //console.log(JSON.stringify(error.response)) if (error.response.data.registro.factura) { error.response.data.registro.id === -1 ? alert( @@ -44,7 +53,7 @@ instance.interceptors.response.use( } } else { return Promise.reject(error) - } + } */ } ) diff --git a/src/css/autoComplete.css b/src/css/autoComplete.css deleted file mode 100644 index 3849e27..0000000 --- a/src/css/autoComplete.css +++ /dev/null @@ -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; -} \ No newline at end of file diff --git a/src/css/customerColors.css b/src/css/customerColors.css new file mode 100644 index 0000000..39a626f --- /dev/null +++ b/src/css/customerColors.css @@ -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; +} diff --git a/src/css/generic01.css b/src/css/generic01.css index dd7f1e7..0c596be 100644 --- a/src/css/generic01.css +++ b/src/css/generic01.css @@ -20,9 +20,9 @@ } .modal-90w { - width: 90%; - /* max-height: 90% !important; */ - max-height: 'calc(100vh - 50px)' !important; + width: 90%; + max-width: none !important; + max-height: none !important; } .modal-innerDiv { diff --git a/src/css/heineken.css b/src/css/heineken.css deleted file mode 100644 index 286be33..0000000 --- a/src/css/heineken.css +++ /dev/null @@ -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); -} \ No newline at end of file diff --git a/src/css/heineken1.css b/src/css/heineken1.css deleted file mode 100644 index 496738f..0000000 --- a/src/css/heineken1.css +++ /dev/null @@ -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%; -} \ No newline at end of file diff --git a/src/css/printableArea.css b/src/css/printableArea.css deleted file mode 100644 index 8613e2a..0000000 --- a/src/css/printableArea.css +++ /dev/null @@ -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; - } \ No newline at end of file diff --git a/src/css/reactCaptcha.css b/src/css/reactCaptcha.css new file mode 100644 index 0000000..1598ea9 --- /dev/null +++ b/src/css/reactCaptcha.css @@ -0,0 +1,12 @@ +/* .react-captcha { + background-color: #000000; +} + */ +/* .react-captcha-icon-wrapper { +} + */ + +.react-captcha-canvas{ + background-color: rgb(242, 242, 248); + color: #fff; +} \ No newline at end of file diff --git a/src/images/Clean.png b/src/images/Clean.png new file mode 100644 index 0000000..ca15cd4 Binary files /dev/null and b/src/images/Clean.png differ diff --git a/src/images/GEMCO_login.png b/src/images/GEMCO_login.png new file mode 100644 index 0000000..b65f961 Binary files /dev/null and b/src/images/GEMCO_login.png differ diff --git a/src/images/caret.png b/src/images/caret.png new file mode 100644 index 0000000..0875dbf Binary files /dev/null and b/src/images/caret.png differ diff --git a/src/index.tsx b/src/index.tsx index 5b34207..59a5756 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,5 @@ import React, { useEffect } from 'react' -import ReactDOM from 'react-dom' +import ReactDOM from 'react-dom/client' import 'bootstrap/dist/css/bootstrap.min.css' import App from './App' import reportWebVitals from './reportWebVitals' @@ -11,12 +11,15 @@ import CatTabuladores from './Components/Catalogos/CatTabulador/CatTabulador' import DashboardCorresponsales from './Components/Dashboard/DashboardCorresponsales' import Dashboard from './Components/Dashboard/Dashboard' import Logout from './Components/Logout/logout' -import ResetCredentials from './Components/resetCredentials/resetCredentials' import Register from './Components/Register/register' import RegisterPermisoClientes from './Components/registerPermisoClientes/registerPermisoClientes' import TraficoCorresponsales from './Components/Corresponsales/TraficoCorresponsales' import RptCorresponsalesTraficos from './Components/Reportes/RptCorresponsalesTraficos' 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`) function PageNotFound() { @@ -27,7 +30,8 @@ function PageNotFound() { ) } -ReactDOM.render( +const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement); +root.render( @@ -36,8 +40,11 @@ ReactDOM.render( }> } /> } /> + } /> + } /> + } /> } /> - } /> + } /> } /> - , - document.getElementById('root') + ) reportWebVitals() diff --git a/yarn.lock b/yarn.lock index 868a4a0..a39712e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3176,7 +3176,7 @@ camelcase-css@^2.0.1: resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" 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" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -7875,6 +7875,13 @@ react-bootstrap@^2.7.4: uncontrollable "^7.2.1" 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: version "1.1.0" 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" 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: version "4.8.0" resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.8.0.tgz#621e900caa23b912f737e41be57f27f6b2bff445"