Bläddra i källkod

som random fixes

amenpunk 1 år sedan
förälder
incheckning
758ca2f018

+ 1 - 0
src/App.css

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

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

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

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

@@ -80,51 +80,61 @@ function Candidatos(props) {
80 80
 
81 81
   return (
82 82
     <FormikProvider style={{ padding: 25 }} value={formik}>
83
-      <Typography style={{ padding: !home ? 5 : 0, marginBottom: !home ? 15 : 0 }}>
84
-        {home ? "" : "Ingresa la informacion del candidato"}
85
-      </Typography>
86
-      <Divider />
87 83
       <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
88 84
         <Stack spacing={3}>
89 85
 
90
-          <Stack 
91
-            style={{ paddingTop: !home ? 15 : 0, paddingBottom: !home ? 15 : 0 }} 
92
-            direction={{ xs: 'column', sm: 'row' }} 
93
-            spacing={2}>
94
-
95
-            <TextField
96
-              style={{ display: home ? 'none' : 'block', background: '' }}
97
-              label="Nombre"
98
-              {...getFieldProps('nombres')}
99
-              error={Boolean(touched.nombres && errors.nombres)}
100
-              helperText={touched.nombres && errors.nombres}
101
-            />
102
-
103
-            <TextField
104
-              style={{ display: home ? 'none' : 'block' }}
105
-              label="Apellidos"
106
-              {...getFieldProps('apellidos')}
107
-              error={Boolean(touched.apellidos && errors.apellidos)}
108
-              helperText={touched.apellidos && errors.apellidos}
109
-            />
110
-          </Stack>
111
-
112
-          <Stack direction={{ xs: 'column', sm: 'row' }} >
113
-            <TextField
114
-              style={{ display: home ? 'none' : 'block' }}
115
-              fullWidth
116
-              type="email"
117
-              label="Correo Electronico"
118
-              {...getFieldProps('mail')}
119
-              error={Boolean(touched.mail && errors.mail)}
120
-              helperText={touched.mail && errors.mail}
121
-            />
122
-
123
-            <Button hidden={home} type="submit">
124
-              <AddCircle style={{ color: 'var(--main)' }} />
125
-            </Button>
126
-
127
-          </Stack>
86
+          {
87
+            !home ?
88
+              (
89
+                <>
90
+
91
+                  <Typography style={{ padding: 5, marginBottom: !home ? 15 : 0 }}>
92
+                    {home ? "" : "Ingresa la informacion del candidato"}
93
+                  </Typography>
94
+                  <Divider />
95
+
96
+
97
+                  <Stack
98
+                    style={{ paddingTop: 15, paddingBottom: !home ? 15 : 0 }}
99
+                    direction={{ xs: 'column', sm: 'row' }}
100
+                    spacing={2}>
101
+
102
+                    <TextField
103
+                      style={{ display: 'block', background: '' }}
104
+                      label="Nombre"
105
+                      {...getFieldProps('nombres')}
106
+                      error={Boolean(touched.nombres && errors.nombres)}
107
+                      helperText={touched.nombres && errors.nombres}
108
+                    />
109
+
110
+                    <TextField
111
+                      style={{ display: 'block' }}
112
+                      label="Apellidos"
113
+                      {...getFieldProps('apellidos')}
114
+                      error={Boolean(touched.apellidos && errors.apellidos)}
115
+                      helperText={touched.apellidos && errors.apellidos}
116
+                    />
117
+                  </Stack>
118
+
119
+                  <Stack direction={{ xs: 'column', sm: 'row' }} >
120
+                    <TextField
121
+                      style={{ display: 'block' }}
122
+                      fullWidth
123
+                      type="email"
124
+                      label="Correo Electronico"
125
+                      {...getFieldProps('mail')}
126
+                      error={Boolean(touched.mail && errors.mail)}
127
+                      helperText={touched.mail && errors.mail}
128
+                    />
129
+
130
+                    <Button type="submit">
131
+                      <AddCircle style={{ color: 'var(--main)' }} />
132
+                    </Button>
133
+
134
+                  </Stack>
135
+                </>
136
+              ) : undefined
137
+          }
128 138
 
129 139
           <MailTable
130 140
             home={home}

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

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

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

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

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

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

+ 1 - 1
src/Pages/Logincs.jsx

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

+ 2 - 1
src/Pages/Prueba.jsx

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

+ 30 - 0
src/Utils/HTTP.js

@@ -30,6 +30,36 @@ export class Service {
30 30
     })
31 31
   }
32 32
 
33
+  async getXHR(token) {
34
+
35
+    if (!token) {
36
+      let response = await axios({
37
+        method: "GET",
38
+        url: this.url,
39
+        headers: {
40
+          'Content-Type': 'application/json',
41
+        },
42
+      })
43
+      return await response.data;
44
+    }
45
+
46
+
47
+    const MyHeaders = {
48
+      'Authorization': 'Bearer ' + token,
49
+      'Content-Type': 'application/json',
50
+    }
51
+
52
+    let response = await axios({
53
+      method: "GET",
54
+      url: this.url,
55
+      headers: MyHeaders,
56
+    })
57
+    // console.log('response', response)
58
+
59
+    return await response.data;
60
+
61
+  }
62
+
33 63
   async get(token) {
34 64
     return axios.get(this.url, {
35 65
       headers: {