Browse Source

som random fixes

amenpunk 1 year ago
parent
commit
758ca2f018

+ 1 - 0
src/App.css

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

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

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

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

80
 
80
 
81
   return (
81
   return (
82
     <FormikProvider style={{ padding: 25 }} value={formik}>
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
       <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
83
       <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
88
         <Stack spacing={3}>
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
           <MailTable
139
           <MailTable
130
             home={home}
140
             home={home}

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

14
     <TableContainer 
14
     <TableContainer 
15
       style={{marginTop:'0px !important',marginBottom:'0px !important'}} 
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
         <TableHead>
18
         <TableHead>
19
           <TableRow>
19
           <TableRow>
20
             <TableCell className="headert_pwdu">Correo</TableCell>
20
             <TableCell className="headert_pwdu">Correo</TableCell>

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

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

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

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

+ 1 - 1
src/Pages/Logincs.jsx

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

+ 2 - 1
src/Pages/Prueba.jsx

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

+ 30 - 0
src/Utils/HTTP.js

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
   async get(token) {
63
   async get(token) {
34
     return axios.get(this.url, {
64
     return axios.get(this.url, {
35
       headers: {
65
       headers: {