Browse Source

create password steps

amenpunk 3 years ago
parent
commit
6c6c64477d

+ 0 - 2
src/App.css

1
 .App {
1
 .App {
2
     text-align: center;
2
     text-align: center;
3
 }
3
 }
4
-
5
 .App-logo {
4
 .App-logo {
6
     height: 40vmin;
5
     height: 40vmin;
7
     pointer-events: none;
6
     pointer-events: none;
8
 }
7
 }
9
-
10
 @media (prefers-reduced-motion: no-preference) {
8
 @media (prefers-reduced-motion: no-preference) {
11
     .App-logo {
9
     .App-logo {
12
         animation: App-logo-spin infinite 20s linear;
10
         animation: App-logo-spin infinite 20s linear;

+ 0 - 1
src/Components/Home/Actividades.js

5
 import TextField from '@mui/material/TextField';
5
 import TextField from '@mui/material/TextField';
6
 import { Col, Row } from 'react-bootstrap';
6
 import { Col, Row } from 'react-bootstrap';
7
 
7
 
8
-
9
 import DateFnsUtils from '@date-io/date-fns';
8
 import DateFnsUtils from '@date-io/date-fns';
10
 
9
 
11
 import { HelpModal } from './HelpAcividades.jsx'
10
 import { HelpModal } from './HelpAcividades.jsx'

+ 107 - 0
src/Components/Modal/PasswordModal.jsx

1
+import { Modal } from 'react-bootstrap'
2
+import * as React from 'react';
3
+
4
+import { 
5
+    Box, Stepper, Step,
6
+    StepLabel, Button , Typography
7
+} from '@mui/material'
8
+
9
+const steps = ['Información del candidato', 'Seleccionar plaza', 'Seleccionar pruebas', 'Confirmar'];
10
+
11
+export function HelpModal (props) {
12
+
13
+    let { visible, handleClose } = props
14
+
15
+    const [activeStep, setActiveStep] = React.useState(0);
16
+    const [skipped, setSkipped] = React.useState(new Set());
17
+
18
+    const isStepSkipped = (step) => {
19
+        return skipped.has(step);
20
+    };
21
+
22
+    const handleNext = () => {
23
+        let newSkipped = skipped;
24
+        if (isStepSkipped(activeStep)) {
25
+            newSkipped = new Set(newSkipped.values());
26
+            newSkipped.delete(activeStep);
27
+        }
28
+
29
+        setActiveStep((prevActiveStep) => prevActiveStep + 1);
30
+        setSkipped(newSkipped);
31
+    };
32
+
33
+    const handleBack = () => {
34
+        setActiveStep((prevActiveStep) => prevActiveStep - 1);
35
+    };
36
+
37
+    const handleReset = () => {
38
+        setActiveStep(0);
39
+    };
40
+
41
+
42
+    return (
43
+        <Modal size="lg" 
44
+            aria-labelledby="contained-modal-title-vcenter" 
45
+            centered show={visible} 
46
+            onHide={handleClose}
47
+        > 
48
+            <Modal.Header>
49
+                <button type="button" className="close" onClick={handleClose}>&times;</button>
50
+                <h4 className="modal-title">Crear Contraseña</h4>
51
+            </Modal.Header>
52
+            <Modal.Body className="modal-body">
53
+
54
+                <Box sx={{ width: '100%' }}>
55
+                    <Stepper activeStep={activeStep}>
56
+                        {steps.map((label, index) => {
57
+                            const stepProps = {};
58
+                            const labelProps = {};
59
+                            if (isStepSkipped(index)) {
60
+                                stepProps.completed = false;
61
+                            }
62
+                            return (
63
+                                <Step key={label} {...stepProps}>
64
+                                    <StepLabel {...labelProps}>{label}</StepLabel>
65
+                                </Step>
66
+                            );
67
+                        })}
68
+                    </Stepper>
69
+                    {activeStep === steps.length ? (
70
+                        <React.Fragment>
71
+                            <Typography sx={{ mt: 2, mb: 1 }}>
72
+                                All steps completed - you&apos;re finished
73
+                            </Typography>
74
+                            <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
75
+                                <Box sx={{ flex: '1 1 auto' }} />
76
+                                <Button onClick={handleReset}>Reiniciar</Button>
77
+                            </Box>
78
+                        </React.Fragment>
79
+                    ) : (
80
+                            <React.Fragment>
81
+
82
+                                <Typography sx={{ mt: 2, mb: 1 }}>
83
+                                    Paso numero: {activeStep + 1}
84
+                                </Typography>
85
+
86
+                                <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
87
+                                    <Button
88
+                                        color="inherit"
89
+                                        disabled={activeStep === 0}
90
+                                        onClick={handleBack}
91
+                                        sx={{ mr: 1 }}
92
+                                    >
93
+                                        Anterior
94
+                                    </Button>
95
+                                    <Box sx={{ flex: '1 1 auto' }} />
96
+                                    <Button onClick={handleNext}>
97
+                                        {activeStep === steps.length - 1 ? 'Guardar' : 'Siguiente'}
98
+                                    </Button>
99
+                                </Box>
100
+                            </React.Fragment>
101
+                        )}
102
+                </Box>
103
+
104
+            </Modal.Body>
105
+        </Modal>
106
+    )
107
+}

+ 6 - 1
src/Components/Password/HeaderOperation.jsx

1
+import {useState} from 'react'
1
 import { 
2
 import { 
2
     IconButton,Typography,Toolbar,
3
     IconButton,Typography,Toolbar,
3
     Tooltip
4
     Tooltip
4
 } from '@mui/material'
5
 } from '@mui/material'
5
 
6
 
6
 import { alpha } from '@mui/material/styles';
7
 import { alpha } from '@mui/material/styles';
8
+import { HelpModal } from '../Modal/PasswordModal'
7
 
9
 
8
 import {
10
 import {
9
     Delete as DeleteIcon,
11
     Delete as DeleteIcon,
12
 } from '@mui/icons-material/'
14
 } from '@mui/icons-material/'
13
 
15
 
14
 export const TableEncabezadoOperation = (props) => {
16
 export const TableEncabezadoOperation = (props) => {
17
+
15
     const { numSelected } = props;
18
     const { numSelected } = props;
19
+    const [ visible, setVisible ] = useState(false);
16
 
20
 
17
     return (
21
     return (
18
         <Toolbar
22
         <Toolbar
59
                             </IconButton>
63
                             </IconButton>
60
                         </Tooltip>
64
                         </Tooltip>
61
                         <Tooltip title="Agregar">
65
                         <Tooltip title="Agregar">
62
-                            <IconButton onClick={() => console.log('click')}>
66
+                            <IconButton onClick={() => setVisible(true) }>
63
                                 <AddIcon />
67
                                 <AddIcon />
64
                             </IconButton>
68
                             </IconButton>
65
                         </Tooltip>
69
                         </Tooltip>
66
                     </div>
70
                     </div>
67
                 )}
71
                 )}
72
+            <HelpModal visible={visible} handleClose={() => setVisible(false)} />
68
         </Toolbar>
73
         </Toolbar>
69
     );
74
     );
70
 
75
 

+ 2 - 2
src/Components/Password/Rows.js

42
         label: 'Con CV',
42
         label: 'Con CV',
43
     },
43
     },
44
     {
44
     {
45
-        id: 'replic',
45
+        id: 'estado',
46
         numeric: true,
46
         numeric: true,
47
         disablePadding: false,
47
         disablePadding: false,
48
-        label: 'Replicar',
48
+        label: 'Envido?',
49
     },
49
     },
50
     {
50
     {
51
         id: 'ope',
51
         id: 'ope',

+ 5 - 3
src/Components/Password/config.js

1
+import { Check } from '@mui/icons-material'
2
+
1
 export const rows = [
3
 export const rows = [
2
-    createData('Cupcake', 305, 'Analista',109238109238, 'SI', 'SI', 'Nice', 'Good'),
4
+    createData('Cupcake', 305, 'Analista',109238109238, 'SI', 'SI', 'Nice', <Check/>),
3
 ]
5
 ]
4
 
6
 
5
 new Array(50).fill(50).forEach( (_,i) => {
7
 new Array(50).fill(50).forEach( (_,i) => {
18
     margin :5
20
     margin :5
19
 }
21
 }
20
 
22
 
21
-export function createData( pass, nivel, puesto, cui, uso, picture, cv, replic, ope) {
23
+export function createData( pass, nivel, puesto, cui, uso, picture, cv, estado, ope) {
22
     return {
24
     return {
23
         pass,
25
         pass,
24
         nivel,
26
         nivel,
27
         uso,
29
         uso,
28
         picture,
30
         picture,
29
         cv,
31
         cv,
30
-        replic,
32
+        estado,
31
         ope,
33
         ope,
32
     };
34
     };
33
 }
35
 }

+ 6 - 7
src/Pages/Contras.jsx

1
 import * as React from 'react';
1
 import * as React from 'react';
2
 
2
 
3
-import { EditSharp, MailSharp } from '@mui/icons-material'
4
-
5
 import { 
3
 import { 
6
     rows,
4
     rows,
7
     action_icon,
5
     action_icon,
8
     Comparar,
6
     Comparar,
9
     Cuerpo,
7
     Cuerpo,
10
-    // TableEncabezadoOperation
11
 } from '../Components/Password/config.js';
8
 } from '../Components/Password/config.js';
12
 
9
 
13
-import { TableHeadCustom as TableHead } from '../Components/Password/Header'
14
-import { TableEncabezadoOperation as TableOperation } from '../Components/Password/HeaderOperation.jsx'
15
-
16
 import { 
10
 import { 
17
     Table, TableBody, TableCell, TableContainer, 
11
     Table, TableBody, TableCell, TableContainer, 
18
     TableRow, TablePagination,
12
     TableRow, TablePagination,
20
     Checkbox,
14
     Checkbox,
21
 } from '@mui/material';
15
 } from '@mui/material';
22
 
16
 
17
+import { EditSharp, MailSharp } from '@mui/icons-material'
18
+
19
+import { TableHeadCustom as TableHead } from '../Components/Password/Header'
20
+import { TableEncabezadoOperation as TableOperation } from '../Components/Password/HeaderOperation.jsx'
21
+
23
 export function Contras() {
22
 export function Contras() {
24
 
23
 
25
     const [order, setOrder] = React.useState('asc');
24
     const [order, setOrder] = React.useState('asc');
148
                                                 <TableCell align="right">{row.uso}</TableCell>
147
                                                 <TableCell align="right">{row.uso}</TableCell>
149
                                                 <TableCell align="right">{row.picture}</TableCell>
148
                                                 <TableCell align="right">{row.picture}</TableCell>
150
                                                 <TableCell align="right">{row.cv}</TableCell>
149
                                                 <TableCell align="right">{row.cv}</TableCell>
151
-                                                <TableCell align="right">{row.replic}</TableCell>
150
+                                                <TableCell align="right">{row.estado}</TableCell>
152
                                                 <TableCell align="center">
151
                                                 <TableCell align="center">
153
                                                     <EditSharp style={action_icon} />
152
                                                     <EditSharp style={action_icon} />
154
                                                     <MailSharp style={action_icon}/>
153
                                                     <MailSharp style={action_icon}/>