Browse Source

home fix style

amenpunk 2 years ago
parent
commit
4f2a8cd842

+ 13 - 2
src/App.css

407
   flex-direction: row;
407
   flex-direction: row;
408
 }
408
 }
409
 .pwd_info{
409
 .pwd_info{
410
-  padding:10px;
411
   border-right:1px solid #f1f1f1;
410
   border-right:1px solid #f1f1f1;
412
   display: grid;
411
   display: grid;
413
-  justify-items: center;
412
+  justify-items:stretch;
414
   align-items: center;
413
   align-items: center;
415
 }
414
 }
416
 .btn_pwd{
415
 .btn_pwd{
417
   color:white !important;
416
   color:white !important;
418
   background:var(--main) !important;
417
   background:var(--main) !important;
419
 }
418
 }
419
+
420
+body > div.MuiDialog-root.MuiModal-root.css-zw3mfo-MuiModal-root-MuiDialog-root > div.MuiDialog-container.MuiDialog-scrollPaper.css-hz1bth-MuiDialog-container > div > div > div > div:nth-child(2) > form > div > div:nth-child(2){
421
+  margin-top:0;
422
+}
423
+
424
+body > div.MuiDialog-root.MuiModal-root.css-zw3mfo-MuiModal-root-MuiDialog-root > div.MuiDialog-container.MuiDialog-scrollPaper.css-hz1bth-MuiDialog-container > div > div > div > div:nth-child(2) > form > div > div.MuiTableContainer-root.css-rorn0c-MuiTableContainer-root{
425
+  margin-top :0;
426
+}
427
+.headert_pwdu{
428
+  background:var(--main);
429
+  color:white !important;
430
+}

+ 0 - 3
src/Components/Home/Candidatos.js

49
     let divided = Divide(list);
49
     let divided = Divide(list);
50
     setUser(divided)
50
     setUser(divided)
51
 
51
 
52
-    // setPassword({})
53
-    // setVisible(true)
54
-
55
   }, [passwords])
52
   }, [passwords])
56
 
53
 
57
   return (
54
   return (

+ 36 - 30
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" }
83
+      <Typography style={{ padding: !home ? 5 : 0, marginBottom: !home ? 15 : 0 }}>
84
+        {home ? "" : "Ingresa la informacion del candidato"}
85
       </Typography>
85
       </Typography>
86
       <Divider />
86
       <Divider />
87
       <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
87
       <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
88
         <Stack spacing={3}>
88
         <Stack spacing={3}>
89
 
89
 
90
-          <Stack style={{ paddingTop:!home? 15 :0, background:'' }} direction={{ xs: 'column', sm: 'row' }} spacing={2}>
90
+          <Stack 
91
+            style={{ paddingTop: !home ? 15 : 0, paddingBottom: !home ? 15 : 0 }} 
92
+            direction={{ xs: 'column', sm: 'row' }} 
93
+            spacing={2}>
94
+
91
             <TextField
95
             <TextField
92
-              style={{ display: home ?'none': 'block',background:'' }}
96
+              style={{ display: home ? 'none' : 'block', background: '' }}
93
               label="Nombre"
97
               label="Nombre"
94
               {...getFieldProps('nombres')}
98
               {...getFieldProps('nombres')}
95
               error={Boolean(touched.nombres && errors.nombres)}
99
               error={Boolean(touched.nombres && errors.nombres)}
97
             />
101
             />
98
 
102
 
99
             <TextField
103
             <TextField
100
-              style={{ display: home ?'none': 'block' }}
104
+              style={{ display: home ? 'none' : 'block' }}
101
               label="Apellidos"
105
               label="Apellidos"
102
               {...getFieldProps('apellidos')}
106
               {...getFieldProps('apellidos')}
103
               error={Boolean(touched.apellidos && errors.apellidos)}
107
               error={Boolean(touched.apellidos && errors.apellidos)}
105
             />
109
             />
106
           </Stack>
110
           </Stack>
107
 
111
 
108
-          <Stack style={{ marginTop:0}} direction={{ xs: 'column', sm: 'row' }} spacing={2}>
112
+          <Stack direction={{ xs: 'column', sm: 'row' }} >
109
             <TextField
113
             <TextField
110
-              style={{ display: home ?'none': 'block' }}
114
+              style={{ display: home ? 'none' : 'block' }}
111
               fullWidth
115
               fullWidth
112
               type="email"
116
               type="email"
113
               label="Correo Electronico"
117
               label="Correo Electronico"
169
 
173
 
170
 function ModalForm(props) {
174
 function ModalForm(props) {
171
 
175
 
172
-  let { pwdinfo, closeModal,home } = props
176
+  let { pwdinfo, closeModal, home } = props
173
   const auth = useSelector((state) => state.token)
177
   const auth = useSelector((state) => state.token)
174
   let [candidatos, setCandidatos] = React.useState([]);
178
   let [candidatos, setCandidatos] = React.useState([]);
175
   let [password, setPassword] = React.useState();
179
   let [password, setPassword] = React.useState();
194
 
198
 
195
   React.useEffect(() => {
199
   React.useEffect(() => {
196
     let { pwd, plz } = pwdinfo;
200
     let { pwd, plz } = pwdinfo;
197
-    console.log('PWDINOF',{pwd,plz})
198
-
199
     let rest = new Service(`/contrasenia/${home ? pwd : btoa(pwd)}/${plz}`)
201
     let rest = new Service(`/contrasenia/${home ? pwd : btoa(pwd)}/${plz}`)
200
 
202
 
201
     rest.getQuery(auth.token)
203
     rest.getQuery(auth.token)
203
 
205
 
204
         let json_data = resp;
206
         let json_data = resp;
205
         let mapCandi = resp.data.candidatospwds.map(pwd => {
207
         let mapCandi = resp.data.candidatospwds.map(pwd => {
206
-          let { apellidos, nombre, mail,id } = pwd.candi
208
+          let { apellidos, nombre, mail, id } = pwd.candi
207
           return { nombres: nombre, apellidos, mail, id }
209
           return { nombres: nombre, apellidos, mail, id }
208
         })
210
         })
209
 
211
 
222
       })
224
       })
223
       .catch(error => console.log(error))
225
       .catch(error => console.log(error))
224
 
226
 
225
-  }, [auth.token, pwdinfo, reset,home])
227
+  }, [auth.token, pwdinfo, reset, home])
226
 
228
 
227
   const saveCandidato = async (body) => {
229
   const saveCandidato = async (body) => {
228
     let rest = new Service('/passwordcandidato/candidato')
230
     let rest = new Service('/passwordcandidato/candidato')
231
 
233
 
232
   function onSubmit(fields) {
234
   function onSubmit(fields) {
233
 
235
 
234
-    let candi_body = candidatos.map( c => {
235
-      return {...c, 
236
+    let candi_body = candidatos.map(c => {
237
+      return {
238
+        ...c,
236
         'nombrepuesto': 'test',
239
         'nombrepuesto': 'test',
237
-        'nombreEmpresa' : 'dit', 
238
-        "idContrasenia" : password.id,
240
+        'nombreEmpresa': 'dit',
241
+        "idContrasenia": password.id,
239
         "sendmail": 1,
242
         "sendmail": 1,
240
       }
243
       }
241
     })
244
     })
257
     }
260
     }
258
 
261
 
259
     rest.putQuery(body_req, auth.token)
262
     rest.putQuery(body_req, auth.token)
260
-      .then( async _result => {
261
-        queryClient.invalidateQueries('passwords')
263
+      .then(async _result => {
262
 
264
 
263
-        //TODO: insert into passwordcanidato/candidato 
265
+        queryClient.invalidateQueries('passwords')
264
         await saveCandidato(candi_body)
266
         await saveCandidato(candi_body)
265
 
267
 
266
         setTimeout(() => {
268
         setTimeout(() => {
287
 
289
 
288
   return (
290
   return (
289
     <Row>
291
     <Row>
290
-      <Col>
291
-        <form style={{ padding: !home? 20: 0, maxWidth: 950 }} onSubmit={handleSubmit(onSubmit)}>
292
+      <Col >
293
+        <form style={{ padding: !home ? 20 : 0, maxWidth: 950 }} onSubmit={handleSubmit(onSubmit)}>
292
           <Stack spacing={4}>
294
           <Stack spacing={4}>
293
 
295
 
294
             <TextField
296
             <TextField
295
               {...register('pwd')}
297
               {...register('pwd')}
296
               variant="filled"
298
               variant="filled"
297
-              disabled
298
               type="text"
299
               type="text"
299
               label="Contraseña Cifrada"
300
               label="Contraseña Cifrada"
301
+              InputProps={{
302
+                readOnly: home
303
+              }}
300
             />
304
             />
301
 
305
 
302
             <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
306
             <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
306
                 variant="filled"
310
                 variant="filled"
307
                 value={password ? atob(password.pwd) : ""}
311
                 value={password ? atob(password.pwd) : ""}
308
                 type="text"
312
                 type="text"
309
-                disabled
313
+                InputProps={{
314
+                  readOnly: home
315
+                }}
310
               />
316
               />
311
 
317
 
312
               {
318
               {
313
-                !home ? 
319
+                !home ?
314
                   <FormControlLabel
320
                   <FormControlLabel
315
                     label="Activo?"
321
                     label="Activo?"
316
                     control={
322
                     control={
378
               </Controller>
384
               </Controller>
379
             </LocalizationProvider>
385
             </LocalizationProvider>
380
 
386
 
381
-            { !home?
387
+            {!home ?
382
               <DialogActions style={{ paddingTop: 25, 'justifyContent': "flex-start" }}>
388
               <DialogActions style={{ paddingTop: 25, 'justifyContent': "flex-start" }}>
383
                 <Button onClick={() => closeModal(false)}>
389
                 <Button onClick={() => closeModal(false)}>
384
                   Cerrar
390
                   Cerrar
386
                 <Button type="submit" style={{ color: 'white', background: 'var(--main)' }} >
392
                 <Button type="submit" style={{ color: 'white', background: 'var(--main)' }} >
387
                   Guardar
393
                   Guardar
388
                 </Button>
394
                 </Button>
389
-              </DialogActions> : 
395
+              </DialogActions> :
390
 
396
 
391
-              <DialogActions 
397
+              <DialogActions
392
                 style={{
398
                 style={{
393
                   justifyContent: "flex-start",
399
                   justifyContent: "flex-start",
394
                 }} >
400
                 }} >
395
-                <Button onClick={() => { 
401
+                <Button onClick={() => {
396
                   console.log('close modal')
402
                   console.log('close modal')
397
                   console.log(closeModal)
403
                   console.log(closeModal)
398
-                  closeModal(true) 
404
+                  closeModal(true)
399
                 }}>
405
                 }}>
400
                   Cerrar
406
                   Cerrar
401
                 </Button>
407
                 </Button>
407
         </form>
413
         </form>
408
         <Toaster position="bottom-right" />
414
         <Toaster position="bottom-right" />
409
       </Col>
415
       </Col>
410
-      <Col>
416
+      <Col >
411
         <Candidatos
417
         <Candidatos
412
           home={home}
418
           home={home}
413
           add={addCandidato}
419
           add={addCandidato}

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

12
 
12
 
13
   return (
13
   return (
14
     <TableContainer 
14
     <TableContainer 
15
-      style={{boxShadow:'none',margin:'0px !important'}}
16
-      component={Paper}>
15
+      style={{marginTop:'0px !important',marginBottom:'0px !important'}} 
16
+    >
17
       <Table aria-label="simple table">
17
       <Table aria-label="simple table">
18
         <TableHead>
18
         <TableHead>
19
           <TableRow>
19
           <TableRow>
20
-            <TableCell>Correo</TableCell>
21
-            <TableCell align="right">Nombres</TableCell>
22
-            <TableCell align="right">Apellidos</TableCell>
23
-            <TableCell align="right"></TableCell>
20
+            <TableCell className="headert_pwdu">Correo</TableCell>
21
+            <TableCell className="headert_pwdu" align="right">Nombres</TableCell>
22
+            <TableCell className="headert_pwdu" align="right">Apellidos</TableCell>
23
+            <TableCell className="headert_pwdu" align="right"></TableCell>
24
           </TableRow>
24
           </TableRow>
25
         </TableHead>
25
         </TableHead>
26
         <TableBody>
26
         <TableBody>