|
@@ -10,8 +10,7 @@ import toast, { Toaster } from 'react-hot-toast';
|
|
|
|
|
|
|
|
import { useMutation, useQueryClient } from 'react-query';
|
|
import { useMutation, useQueryClient } from 'react-query';
|
|
|
import { Service } from '../../../Utils/HTTP.js'
|
|
import { Service } from '../../../Utils/HTTP.js'
|
|
|
-import useAuth from '../../../Auth/useAuth.js'
|
|
|
|
|
-import { useSelector } from 'react-query';
|
|
|
|
|
|
|
+import { useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
|
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
|
|
|
|
|
|
@@ -32,11 +31,13 @@ let theme = createTheme({
|
|
|
export function Resume(props) {
|
|
export function Resume(props) {
|
|
|
|
|
|
|
|
let { handleBack, password: key, handleClose,handleReset } = props
|
|
let { handleBack, password: key, handleClose,handleReset } = props
|
|
|
|
|
+
|
|
|
const fmt = React.useRef({ weekday: 'long', year: 'numeric', month: 'short', day: 'numeric' })
|
|
const fmt = React.useRef({ weekday: 'long', year: 'numeric', month: 'short', day: 'numeric' })
|
|
|
const [pwdID, setPwdID] = React.useState(null);
|
|
const [pwdID, setPwdID] = React.useState(null);
|
|
|
const [loading, setLoading] = React.useState(false);
|
|
const [loading, setLoading] = React.useState(false);
|
|
|
|
|
+
|
|
|
const auth = useSelector((state) => state.token)
|
|
const auth = useSelector((state) => state.token)
|
|
|
- // const token = auth.getToken();
|
|
|
|
|
|
|
+ const profile = useSelector((state) => state.user.profile)
|
|
|
const queryClient = useQueryClient();
|
|
const queryClient = useQueryClient();
|
|
|
|
|
|
|
|
const savePassword = async (body) => {
|
|
const savePassword = async (body) => {
|
|
@@ -57,10 +58,9 @@ export function Resume(props) {
|
|
|
setLoading(true);
|
|
setLoading(true);
|
|
|
|
|
|
|
|
let {
|
|
let {
|
|
|
- deadpwd, dateToActived, puesto, pwd,
|
|
|
|
|
- nombres, apellidos, sendmail, nombrepuesto, nombreEmpresa,mail
|
|
|
|
|
|
|
+ deadpwd, dateToActived, puesto,
|
|
|
|
|
+ pwd,nombreEmpresa,nombrepuesto, candidatos
|
|
|
} = key;
|
|
} = key;
|
|
|
- console.log("KEY: ", key)
|
|
|
|
|
|
|
|
|
|
let pwdBody = {
|
|
let pwdBody = {
|
|
|
id: -1,
|
|
id: -1,
|
|
@@ -80,10 +80,10 @@ export function Resume(props) {
|
|
|
|
|
|
|
|
let candidatoBody = {
|
|
let candidatoBody = {
|
|
|
id: -1,
|
|
id: -1,
|
|
|
- nombres,
|
|
|
|
|
- apellidos,
|
|
|
|
|
- sendmail: sendmail ? 1 : 0,
|
|
|
|
|
- mail,
|
|
|
|
|
|
|
+ //nombres,
|
|
|
|
|
+ //apellidos,
|
|
|
|
|
+ //sendmail: sendmail ? 1 : 0,
|
|
|
|
|
+ //mail,
|
|
|
idContrasenia: password_id,
|
|
idContrasenia: password_id,
|
|
|
nombrepuesto,
|
|
nombrepuesto,
|
|
|
nombreEmpresa
|
|
nombreEmpresa
|
|
@@ -118,6 +118,14 @@ export function Resume(props) {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const getLi = (user) => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <li style={{ listStyleType: 'none'}}>
|
|
|
|
|
+ {user.nombres + " " + user.apellidos} - {user.mail}
|
|
|
|
|
+ </li>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<React.Fragment>
|
|
<React.Fragment>
|
|
|
<ThemeProvider theme={theme}>
|
|
<ThemeProvider theme={theme}>
|
|
@@ -128,30 +136,34 @@ export function Resume(props) {
|
|
|
) : null}
|
|
) : null}
|
|
|
<Table>
|
|
<Table>
|
|
|
<thead>
|
|
<thead>
|
|
|
- <tr>
|
|
|
|
|
- <th>{key.pwd}</th>
|
|
|
|
|
- <th>{btoa(key.pwd)}</th>
|
|
|
|
|
|
|
+ <tr className="table_password">
|
|
|
|
|
+ <th>{"Contraseña: "}</th>
|
|
|
|
|
+ <th>{ key.pwd } - {btoa(key.pwd)}</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td className="title_td">{"Candidato"}</td>
|
|
|
|
|
- <td colSpan={2}>{key.nombres + " " + key.apellidos} - {key.mail}</td>
|
|
|
|
|
|
|
+ <td className="title_td">{"Candidatos:"}</td>
|
|
|
|
|
+ <td colSpan={2}>
|
|
|
|
|
+ <ul style={{ margin:0, padding:0}}>
|
|
|
|
|
+ {key.candidatos.map(u => getLi(u))}
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td className="title_td">{"Puesto"}</td>
|
|
|
|
|
|
|
+ <td className="title_td">{"Puesto:"}</td>
|
|
|
<td colSpan={2}>{key.puesto.length > 0 ? key.puesto[0].nombrepuesto : ''}</td>
|
|
<td colSpan={2}>{key.puesto.length > 0 ? key.puesto[0].nombrepuesto : ''}</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td className="title_td">{"Empresa"}</td>
|
|
|
|
|
- <td colSpan={2}>{key.nombreEmpresa}</td>
|
|
|
|
|
|
|
+ <td className="title_td">{"Empresa:"}</td>
|
|
|
|
|
+ <td colSpan={2}>{profile.nombre}</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td className="title_td">{"Fecha Activación"}</td>
|
|
|
|
|
|
|
+ <td className="title_td">{"Fecha Activación:"}</td>
|
|
|
<td colSpan={2}>{new Date(key.dateToActived).toLocaleDateString('es-GT', fmt.current)}</td>
|
|
<td colSpan={2}>{new Date(key.dateToActived).toLocaleDateString('es-GT', fmt.current)}</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td className="title_td">{"Fecha de Vencimiento"}</td>
|
|
|
|
|
|
|
+ <td className="title_td">{"Fecha de Vencimiento:"}</td>
|
|
|
<td colSpan={2}>{new Date(key.deadpwd).toLocaleDateString('es-GT', fmt.current)}</td>
|
|
<td colSpan={2}>{new Date(key.deadpwd).toLocaleDateString('es-GT', fmt.current)}</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</tbody>
|
|
</tbody>
|