Ver Fonte

som random fixes

amenpunk há 2 anos atrás
pai
commit
758ca2f018

+ 1 - 0
src/App.css

@@ -418,6 +418,7 @@
 }
 
 .headert_pwdu{
+  height :10px;
   background:var(--main);
   color:white !important;
   font-weight:bold! important;

+ 3 - 1
src/Components/Navigation/MenuMovil.jsx

@@ -13,6 +13,8 @@ import { useDispatch } from 'react-redux';
 import { useNavigate } from 'react-router';
 import { removeToken } from '../../Slices/tokenSlice';
 
+const WITH_OF_PANEL = 50;
+
 export function MenuMovil(props) {
   let { anchor, control } = props;
   const dispatch = useDispatch();
@@ -33,7 +35,7 @@ export function MenuMovil(props) {
         onClose={() => control(false)}
         sx={{
           '& .MuiDrawer-paper': {
-            width : '67%'
+            width : `${WITH_OF_PANEL}%`
           }
         }}>
         <List style={{ paddingTop : 64 }}>

+ 52 - 42
src/Components/Password/Operation.jsx

@@ -80,51 +80,61 @@ function Candidatos(props) {
 
   return (
     <FormikProvider style={{ padding: 25 }} value={formik}>
-      <Typography style={{ padding: !home ? 5 : 0, marginBottom: !home ? 15 : 0 }}>
-        {home ? "" : "Ingresa la informacion del candidato"}
-      </Typography>
-      <Divider />
       <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
         <Stack spacing={3}>
 
-          <Stack 
-            style={{ paddingTop: !home ? 15 : 0, paddingBottom: !home ? 15 : 0 }} 
-            direction={{ xs: 'column', sm: 'row' }} 
-            spacing={2}>
-
-            <TextField
-              style={{ display: home ? 'none' : 'block', background: '' }}
-              label="Nombre"
-              {...getFieldProps('nombres')}
-              error={Boolean(touched.nombres && errors.nombres)}
-              helperText={touched.nombres && errors.nombres}
-            />
-
-            <TextField
-              style={{ display: home ? 'none' : 'block' }}
-              label="Apellidos"
-              {...getFieldProps('apellidos')}
-              error={Boolean(touched.apellidos && errors.apellidos)}
-              helperText={touched.apellidos && errors.apellidos}
-            />
-          </Stack>
-
-          <Stack direction={{ xs: 'column', sm: 'row' }} >
-            <TextField
-              style={{ display: home ? 'none' : 'block' }}
-              fullWidth
-              type="email"
-              label="Correo Electronico"
-              {...getFieldProps('mail')}
-              error={Boolean(touched.mail && errors.mail)}
-              helperText={touched.mail && errors.mail}
-            />
-
-            <Button hidden={home} type="submit">
-              <AddCircle style={{ color: 'var(--main)' }} />
-            </Button>
-
-          </Stack>
+          {
+            !home ?
+              (
+                <>
+
+                  <Typography style={{ padding: 5, marginBottom: !home ? 15 : 0 }}>
+                    {home ? "" : "Ingresa la informacion del candidato"}
+                  </Typography>
+                  <Divider />
+
+
+                  <Stack
+                    style={{ paddingTop: 15, paddingBottom: !home ? 15 : 0 }}
+                    direction={{ xs: 'column', sm: 'row' }}
+                    spacing={2}>
+
+                    <TextField
+                      style={{ display: 'block', background: '' }}
+                      label="Nombre"
+                      {...getFieldProps('nombres')}
+                      error={Boolean(touched.nombres && errors.nombres)}
+                      helperText={touched.nombres && errors.nombres}
+                    />
+
+                    <TextField
+                      style={{ display: 'block' }}
+                      label="Apellidos"
+                      {...getFieldProps('apellidos')}
+                      error={Boolean(touched.apellidos && errors.apellidos)}
+                      helperText={touched.apellidos && errors.apellidos}
+                    />
+                  </Stack>
+
+                  <Stack direction={{ xs: 'column', sm: 'row' }} >
+                    <TextField
+                      style={{ display: 'block' }}
+                      fullWidth
+                      type="email"
+                      label="Correo Electronico"
+                      {...getFieldProps('mail')}
+                      error={Boolean(touched.mail && errors.mail)}
+                      helperText={touched.mail && errors.mail}
+                    />
+
+                    <Button type="submit">
+                      <AddCircle style={{ color: 'var(--main)' }} />
+                    </Button>
+
+                  </Stack>
+                </>
+              ) : undefined
+          }
 
           <MailTable
             home={home}

+ 1 - 1
src/Components/Password/Steps/MailTable.jsx

@@ -14,7 +14,7 @@ export function MailTable(props) {
     <TableContainer 
       style={{marginTop:'0px !important',marginBottom:'0px !important'}} 
     >
-      <Table aria-label="simple table">
+      <Table size="small" aria-label="a dense table">
         <TableHead>
           <TableRow>
             <TableCell className="headert_pwdu">Correo</TableCell>

+ 0 - 1
src/Components/Password/Steps/TypePwd.jsx

@@ -67,7 +67,6 @@ function validatePassword(password) {
 function PermisosList(props) {
 
   let { recursos, selectedRole, setSelectedRole } = props
-  console.log("recursos len", recursos.data.length)
   if(recursos.data.length === 0) return (<></>);
 
   return (

+ 1 - 1
src/Components/Password/Steps/password.jsx

@@ -27,7 +27,7 @@ export function Password(props) {
   });
 
   let { handleNext, handleBack, password, setPassword } = props
-  console.log('PASS: ',password)
+  // console.log('PASS: ',password)
 
   const formik = useFormik({
     initialValues: {

+ 1 - 1
src/Pages/Logincs.jsx

@@ -42,7 +42,7 @@ export function LoginCs() {
   const handleClose = () => false
   const navigate = useNavigate();
   const { usuario, pwd } = useParams();
-  console.log('usuariopwd: ',{usuario,pwd})
+  // console.log('usuariopwd: ',{usuario,pwd})
   const auth = useSelector((state) => state.token.candi)
 
   React.useEffect(() => {

+ 2 - 1
src/Pages/Prueba.jsx

@@ -27,6 +27,7 @@ export function Prueba() {
     let rest = new Service(`/prueba/findid/${id}`)
     rest.get(auth.token)
       .then(resp => {
+      console.log("PRUEBA:", resp.data)
         setData(resp.data)
       })
       .catch(_e => setData({}))
@@ -34,7 +35,7 @@ export function Prueba() {
     let status_asign_url = `/prueba/estatus/${perfil.pass}/${perfil.email}/${id}`
     rest = new Service(status_asign_url)
 
-    rest.getQuery(auth.token)
+    rest.get(auth.token)
       .then(resp => {
         setAsignacion(resp.data)
       })

+ 30 - 0
src/Utils/HTTP.js

@@ -30,6 +30,36 @@ export class Service {
     })
   }
 
+  async getXHR(token) {
+
+    if (!token) {
+      let response = await axios({
+        method: "GET",
+        url: this.url,
+        headers: {
+          'Content-Type': 'application/json',
+        },
+      })
+      return await response.data;
+    }
+
+
+    const MyHeaders = {
+      'Authorization': 'Bearer ' + token,
+      'Content-Type': 'application/json',
+    }
+
+    let response = await axios({
+      method: "GET",
+      url: this.url,
+      headers: MyHeaders,
+    })
+    // console.log('response', response)
+
+    return await response.data;
+
+  }
+
   async get(token) {
     return axios.get(this.url, {
       headers: {